cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sumeet182k
Level 3

Don't want to overwrite the config file during major upgrade

Hi All,

I am using the InstallShield 2012 Professional edition and created a Basic MSI Project in it. I have deployed the project on various systems.

We are making some changes in the config file of the project by using TextReplacement feature of the InstallShield.

Now I have made some changes in the existing project and also few components and features removed in the upgrade version. I have created a major upgrade for the existing project.

Now when I am applying the major upgrade its uninstalling the config file as well. But I don't want the config file to be removed or overwritten during major upgrade.

Please help me out as soon as possible.

Thanks in advance.

--Sumeet Sharma
Labels (1)
0 Kudos
(3) Replies
D_Fraz
Level 4

You will need to set the config file component properties to Permanent = "Yes" and NeverOverwrite = "Yes". After that installations forward will leave the config alone.
0 Kudos
sumeet182k
Level 3

Thanks for your reply.

I tried Permanent = "Yes" and NeverOverwrite = "Yes" but there is one problem again.
I tell you the case....I have a project version say 1.01.0.0 and installed it on one of the system. Now I have done a major upgrade and changed its version to 1.02.0.0 and also changed the product code. I upgraded the the project with the latest version 1.02.0.0 but the config file was overwritten.
Then for testing purpose I uninstalled the 1.02.0.0 version and installed the 1.01.0.0 version again on the same system after that I again installed the 1.02.0.0 upgraded version. This time the config file was not overwritten and also no changes have been made in the config file. This is the thing which I actually want.

Now I understood that I should have been mark the config file as Permanent = "Yes" and NeverOverwrite = "Yes" in project version 1.01.0.0 only then it will work in upgrade version 1.02.0.0.

Is there any other way to avoid overwriting the config file in major upgrade version of the InstallShield project.

Thanks,
Sumeet Sharma
0 Kudos
D_Fraz
Level 4

There are two options you can try that might work, unless someone else has a thought.

1. Add a System search for the file and set a property. Then in the Components view for the config file, set Condition value to PROPERTY (your property name) = "".

Or

2. Write an InstallScript that copies the file at the beginning of your installation to a Temp directory and then copy back when the installation is complete. I think the source is CopyFile (szSrcFile,szTargetFile); or XCopyFile (szSrcFile,szTargetFile,nOp);. A search on the Web would probably give a full example.

Or

Add a Install Condition with a Message Box having the User backup the file this time around, and then they replace it. Moving forward it would not be the case...So, only do the condition based on a version/registry entry, (as well as finding the file, of course.).

Hope that helps...
0 Kudos