Summary
This article discusses how to always overwrite files in InstallShield Express.
Discussion
The Windows Installer engine uses File Versioning Rules to update or overwrite files on the system. However, sometimes setup authors must overwrite or update files regardless of version or date stamp.
NOTE: For more information on file versioning rules, refer to How are Files Overwritten by Windows Installer Service?.
InstallShield 12 Express and Earlier
The recommended method for forcing files to be overwritten is to use the Always Overwrite property. Follow these steps:
- Navigate to the Files view under Specify Application Data.
- Find the files that you always want to overwrite existing files.
- Right-click the file and choose properties from the menu options.
- Select the Advanced tab.
- Select the Always Overwrite radio button.
- Click OK.
InstallShield Express 5.0 and Earlier
The Windows Installer Service also provides the REINSTALLMODE property. This property can be set to various command-line arguments to control how files are installed on the machine. However, by using this property it will force all files in the setup to overwrite existing files. This property should be used carefully. This property can be used in place of the method described above but is not recommended.
To always overwrite files using the REINSTALLMODE property, you must set the REINSTALLMODE property to 'amus', where 'a' refers to always overwriting, 'm' and 'u' refer to rewriting all registry data, and 's' refers to rewriting shortcuts. For more options that can be passed to REINSTALLMODE, see Sending a Minor Upgrade to an Existing Product Without Uninstalling/Reinstalling.
Setting the REINSTALLMODE Property in Your Setup
- You can pass the property REINSTALLMODE=amus to the installation via the following command-line parameters:
MsiExec.exe /I project.msi REINSTALLMODE=amusSetup.exe /V" REINSTALLMODE=amus".
- To automate the process, you can pass the property REINSTALLMODE=amus in the Setup.ini file. This way when setup.exe is launched, these parameters are passed to the MSI package automatically for you. Follow these steps to specify this parameter in the Setup.ini file:
- Open the Disk1 folder under the Release location to locate the setup.ini file. The Release location can be found by selecting Tools > Options in the Express IDE.
- On the File Location tab in the Options dialog, note the Project Location field.
- Open the setup.ini file from the respective folder using Notepad.
- Under the [Startup] section in the setup.ini file, set the CmdLine to:
CmdLine = REINSTALLMODE=amus - Save the setup.ini file and burn your setup CD or deploy your setup files.
If Using the SingleImage Compressed Option
If building the release with the SingleImage compressed option, you will not see the Setup.ini file in the release location, as it is compressed inside the setup.exe file. To work around this, you can set the Setup.ini file found in the Support directory to incorporate the above command-line arguments. Follow these steps to accomplish this:
- Go to <DRIVE>\Program Files\InstallShield\Express\Support and locate the Setup.ini file.
- Under the [Startup] section in the setup.ini file, set the CmdLine to:
CmdLine = REINSTALLMODE=amus. - Save the changes made to the Setup.ini file and rebuild your compressed release to ensure that these changes are included in the setup, as this updated setup.ini file will be included in the setup.exe file.
- After deploying your release, be sure to revert the Setup.ini file in the <DRIVE>\Program Files\InstallShield\Express\Support location back to its original state, i.e., delete the changes made to the Setup.ini file.
NOTE: <DRIVE> in the paths specified above should be replaced by the drive letter where Express is installed on the machine. e.g., C:\, D:\, etc.
InstallShield X and Later
The InstallShield X Express and later versions contain an enhancement that will allow you to workaround this Windows Installer limitation. To use this product enhancement select the Always Overwrite option contained on the File Properties view.
Additional Information
In Express 3.5 through 5.0, you can set the REINSTALLMODE property via a VBScript custom action. For more information on setting properties via VBScript custom actions, refer to Setting or Getting the Value of a Property Via a VBScript Custom Action.
All the possible values that can be set to the REINSTALLMODE property are as follows:
| Code or Value | Description |
|---|---|
| p | Reinstalls only if file(s) is missing (similar to Never Overwrite). |
| o | Reinstalls if the file is missing or is an older version. |
| e | Reinstalls if the file is missing or if an equal or older version is present. |
| d | Reinstalls if the file is missing and if a different version is present. |
| c | Reinstalls if the file is missing or corrupt. This is a repair option. |
| a | Forces a reinstall of all files regardless of version, time, or date stamp check. |
| u | Rewrites all registry keys being created under HKEY_CURRENT_USER or HKEY_USERS. |
| m | Rewrites all registry keys being created under HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT. |
| s | Reinstalls all shortcuts and recaches icons overwriting any existing icons. |
| v | This switch forces the installation to ignore the cached MSI package on the machine and recache the new package being run. This should only be used in an upgrade and not with a first-time installation. |
The above information can be found in REINSTALLMODE Property on the Microsoft Learn website.
The ollowing article discusses the REINSTALLMODE property in some detail:
Related Articles
Red error bar displayed when attempting to configure multiple date and time filter with an OR condition on a grid 1Number of Views Never Overwrite a File Regardless of the File Version 4Number of Views Set File Version to Always Overwrite using an InstallShield Automation Interface script 26Number of Views Setting Files to Always Overwrite 3Number of Views Dynamic File Linking and the Always Overwrite file functionality 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago