This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Force file overwrite in Basic MSI install
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 30, 2012
03:42 PM
Force file overwrite in Basic MSI install
Hi all,
I'm working on a very large Basic MSI install.
This install has about 50 components 20 features and over 13,000 files.
These files are mostly data files and compiled business basic files. The files do not have versions. When running our install over an old install it will fail to overwrite many files because it finds them and they do not have versions and may be modified or the hash does not match.
Now I know if I have a staticly linked file I can right click it and check the box to force overwite but the files are not all staticly linked and to do that to 13,000 files would take forever plus be a pain to manage. How can I force the MSI installer to always overwrite a file no matter what?
Brandon
I'm working on a very large Basic MSI install.
This install has about 50 components 20 features and over 13,000 files.
These files are mostly data files and compiled business basic files. The files do not have versions. When running our install over an old install it will fail to overwrite many files because it finds them and they do not have versions and may be modified or the hash does not match.
Now I know if I have a staticly linked file I can right click it and check the box to force overwite but the files are not all staticly linked and to do that to 13,000 files would take forever plus be a pain to manage. How can I force the MSI installer to always overwrite a file no matter what?
Brandon
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2012
07:12 AM
When running our install over an old install...
Am I right in thinking that you are trying to perform a minor upgrade?
And you have dynamically linked files, which are a pain to handle with a minor upgrade.
You need to remember that you cannot remove files when doing a minor upgrade, unless you author the RemoveFile table.
http://kb.flexerasoftware.com/doc/Helpnet/installshield18helplib/MajorMinorSmall.htm
The problem is that you don't have a good control over components and files when using dynamic links.
So what you need is a major upgrade.
Here are some useful resources:
- http://kb.flexerasoftware.com/doc/Helpnet/installshield18helplib/Upgrades.htm
- http://kb.flexerasoftware.com/doc/Helpnet/installshield18helplib/CreatingMajorUpgrades.htm
A part from that, I understand you have a problem with the number of resource files. One good practice would consist of packing all these resources in one or more DLL's, if these are not resources that users should be able to modify.
It has some advantages:
- You have only a few resources DLL instead of thousands of single resource files.
- Your resource DLL can then be versioned.
Finally, a dirty workaround to force all files to get overwritten is to set the REINSTALLMODE property to "amus" or "vamus" when performing a minor upgrade, but it won't remove files that existed in the previous package and no longer exist in the upgrade package. So to me, that's a no go!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2012
08:29 AM
I should have been more clear on the install over old install part.
Our old installs were done with installscript so this is our first MSI version. So when I say install over the old install what is really happening is the new install is running like a new install and the user is pointing it to the directory where the old install was. The expected behavor is to have the new install put down all the new files and replace everything.
When we were using installscript we would just set out component groups to always overwrite and this worked great.
So we are not running in upgrade mode and we are not running in any maintiance modes, we are just running like it is a new install.
Brandon
Our old installs were done with installscript so this is our first MSI version. So when I say install over the old install what is really happening is the new install is running like a new install and the user is pointing it to the directory where the old install was. The expected behavor is to have the new install put down all the new files and replace everything.
When we were using installscript we would just set out component groups to always overwrite and this worked great.
So we are not running in upgrade mode and we are not running in any maintiance modes, we are just running like it is a new install.
Brandon
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2012
01:52 AM
What you need to do is a sort of hybrid major upgrade:
[LIST=1]
Detect if the previous InstallScript-based version is installed.
If it is installed, deinstall it.
Install the new version.
Here is how I would implement it:
[LIST=1]
Detect if the previous InstallScript-based version is installed. I don't think there is a method like MsiGetProductInfo for InstallScript-based installed products. So, you could use a System Search instead. There are many traces of the previous installation you could search for:
You need to store the value of "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{OldProductCode}\\UninstallString" in a property, let's call it "UNINSTALL_PREVIOUS_PRODUCT_COMMAND".
Insert a "RemoveExistingInstallScriptInstallation" CustomAction just before or just after RemoveExistingProduct. This new CustomAction will use the UNINSTALL_PREVIOUS_PRODUCT_COMMAND property to start the deinstallation.
Install the new version. There is nothing special to do, this will be done by the rest of the sequence you already have.
The procedure above assumes that the deinstallation of your previous version works.
One more point: the deinstallation of the previous product won't be rollback-able.
[LIST=1]
Here is how I would implement it:
[LIST=1]
- "[ProgramFilesFolder]\InstallShield Installation Information\{OldProductCode}\Setup.exe", for instance.
- Or search for registry keys/values in "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{OldProductCode}".
You need to store the value of "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{OldProductCode}\\UninstallString" in a property, let's call it "UNINSTALL_PREVIOUS_PRODUCT_COMMAND".
The procedure above assumes that the deinstallation of your previous version works.
One more point: the deinstallation of the previous product won't be rollback-able.
![](/skins/images/38BD1F77107C53AC66BF1514F770E563/responsive_peak/images/icon_anonymous_message.png)