PC Review


Reply
Thread Tools Rate Thread

C# deployment project - overwriting config

 
 
Nuno Magalhaes
Guest
Posts: n/a
 
      31st Mar 2011
Hello,

I've made an application that consists on 2 files:
HelloWorld.exe
HelloWorld.exe.config

When I increase the version of the setup project from 1.0.0 to 1.1.0
(and the product code as recommended) the upgrade does not update
HelloWorld.exe.config that remains as in version 1.0.0.
How can I upgrade the file HelloWorld.exe.config through the setup
project deployment?

Regards,
Nuno
 
Reply With Quote
 
 
 
 
Nuno Magalhaes
Guest
Posts: n/a
 
      1st Apr 2011
On 1 Abr, 01:42, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.com> wrote:
> On 3/31/11 10:31 AM, Nuno Magalhaes wrote:
>
> > Hello,

>
> > I've made an application that consists on 2 files:
> > HelloWorld.exe
> > HelloWorld.exe.config

>
> > When I increase the version of the setup project from 1.0.0 to 1.1.0
> > (and the product code as recommended) the upgrade does not update
> > HelloWorld.exe.config that remains as in version 1.0.0.
> > How can I upgrade the file HelloWorld.exe.config through the setup
> > project deployment?

>
> First, it is typical to use the Project/Add New Item.../Application
> Configuration File to put a config file in your project. *This creates a
> file named "App.config" that VS then knows to use for various settings,
> and which is renamed to the assembly output name (plus the .config) at
> compile time. *(It's created automatically if you add settings via the
> Designer, so that the defaults for the settings can be stored and deployed).
>
> But second, by default a config file wouldn't typically have application
> version information in it. *So your question isn't very clear.
>
> Normally, assembly information such as the version is stored in the
> AssemblyInfo.cs file under the Properties folder of the project.
> Perhaps you can clarify why it is a) your project item is named
> "HelloWorld.exe.config" instead of "App.config" and b) what version
> information is in that file that you expect VS to update?
>
> Pete


Hi Pete, thanks for your response.

a) I'm adding the files manually and I would like to stay that way
because in the future there will be more directories and more
applications in one single install package (there will be also data
files that I would like to be updated/upgraded). The version I expect
to update is always to the latest version.

b) I guess there is no version information on HelloWorld.exe.config
nor in the possible future .png data files for example but I would
really want those files to be upgraded/updated.

Regards,
Nuno
 
Reply With Quote
 
Nuno Magalhaes
Guest
Posts: n/a
 
      1st Apr 2011
On 1 Abr, 15:17, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.com> wrote:
> On 4/1/11 2:14 AM, Nuno Magalhaes wrote:
>
> > [...]
> > a) I'm adding the files manually and I would like to stay that way
> > because in the future there will be more directories and more
> > applications in one single install package (there will be also data
> > files that I would like to be updated/upgraded). The version I expect
> > to update is always to the latest version.

>
> > b) I guess there is no version information on HelloWorld.exe.config
> > nor in the possible future .png data files for example but I would
> > really want those files to be upgraded/updated.

>
> Sorry, I cannot make sense of your question. *If you acknowledge that
> the .config file contains no version information, what is it that you
> think VS should be doing to the file in terms of being
> "upgraded/updated" and why?
>
> In any case, I also don't see how you can insist on adding files
> manually, but then be concerned about having to maintain the same files
> manually. *It seems to me that the two go hand in hand. *If you bypass
> Visual Studio's mechanisms for dealing with automatically maintained
> files, that's an implicit agreement to maintain the files yourself
> rather than to have VS do it.
>
> Again, for the .config file it's a moot point anyway, since it doesn't
> contain version information. *But even for other files that might
> contain version information, if you are not allowing VS to add the files
> in the first place, it should not be surprising that VS might not
> necessarily identify the files as being special and in need of automatic
> maintenance.
>
> Pete


Hi Pete,

Sorry to be so confusing but I think I found what I want.
I edited the resulting .msi file with ORCA MSI Editor and set in the
Properties table the flag REINSTALLMODE=amus which is the same as
invoking "msiexec.exe /i HelloWorld.msi REINSTALLMODE=amus".
From what I read in some sites:
• a - Force all files to be reinstalled, regardless of version.
• m - Rewrite all registry keys that go to HKEY_LOCAL_MACHINE or
HKEY_CLASSES_ROOT.
• u - Rewrite all registry keys that go to HKEY_CURRENT_USER or
HKEY_USERS.
• s - Reinstall shortcuts and icons.

Nuno
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web deployment project - config section replacement files =?Utf-8?B?RHVrZSAoQU4yNDcp?= Microsoft ASP .NET 3 3rd Sep 2007 10:04 AM
Web Deployment Project replace config section wdp00002 error =?Utf-8?B?SWFu?= Microsoft ASP .NET 0 1st Jul 2007 11:12 AM
Web Deployment Project and web.config file section replacements?? Brian McCullough Microsoft ASP .NET 0 16th Feb 2007 09:55 PM
Deployment Overwriting Registry Values yohaas Microsoft Dot NET 0 28th Sep 2005 11:13 PM
Write to config file from deployment project =?Utf-8?B?UGV0ZXJX?= Microsoft Dot NET Framework 2 1st Jun 2005 03:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 AM.