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

Always Overwrite Files Regardless of Version, Date, and Time Stamp

Always Overwrite Files Regardless of Version, Date, and Time Stamp

Summary

This article discusses how to always overwrite files in InstallShield Express.

Synopsis

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 Knowledge Base article Q105988 INFO: 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:

  1. Navigate to the Files view under the Specify Application Data.

  2. Find the files that you always want to overwrite existing files.

  3. Right-click the file and choose properties from the menu options.

  4. Select the Advanced tab.

  5. Select the Always OverWrite radio button.

  6. 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, refer to the Additional Information section of this article.

Setting the REINSTALLMODE property in your setup

  1. You can pass the property REINSTALLMODE=amus to the installation via the following command-line parameters:

    • MsiExec.exe /I project.msi REINSTALLMODE=amus

    • Setup.exe /V" REINSTALLMODE=amus"

  2. 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:

    1. 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.

    2. Open the setup.ini file from the respective folder using Notepad.

    3. Under the [Startup] section in the setup.ini file, set the CmdLine t
      CmdLine = REINSTALLMODE=amus
    4. 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:

    1. Go to <DRIVE>\Program Files\InstallShield\Express\Support and locate the Setup.ini file.

    2. Under the [Startup] section in the setup.ini file, set the CmdLine t
      CmdLine = REINSTALLMODE=amus
    3. 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.

    4. 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.
    <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.

Related KB Articles

Q105988
Q108003
Q105223

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 Knowledge Base article Q108003 HOWTO: 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 ValueDescription
pReinstalls only if file(s) is missing (similar to Never Overwrite).
oReinstalls if the file is missing or is an older version.
eReinstalls if the file is missing or if an equal or older version is present.
dReinstalls if the file is missing and if a different version is present.
cReinstalls if the file is missing or corrupt. This is a repair option.
aForces a reinstall of all files regardless of version, time, or date stamp check.
uRewrites all registry keys being created under HKEY_CURRENT_USER or HKEY_USERS.
mRewrites all registry keys being created under HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT.
sReinstalls all shortcuts and recaches icons overwriting any existing icons.
vThis 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 the MSI Help Library topic REINSTALLMODE Property.

Following articles discuss REINSTALLMODE property in some details:

  • Q105223 INFO: Sending a Minor Upgrade to an Existing Product Without Uninstalling/Reinstalling

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Oct 17, 2007 07:49 PM
Updated by: