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

How to run Install or update together through bat file

Currently I run my msi package through this .bat file command

msiexec /qn+ /i "ISProduct.msi"

The problem is when product is already installed, this command doesnt do anything. I want to prepare a bat file command that should Install or update product.

'/i' switch only installs the product. Is there a switch that does both Install or update existing installation?

Thanks
Naveed
Labels (1)
0 Kudos
(3) Replies
Apoorv_Jain
Level 5

In order to update an existing installed product your mis should be a minor or major upgrade. The same command will work fine if your new MSI is either getting installed as a first version on the system or is going to upgrade an existing old version.

If it is a patch then you would have an exe for the patch and that will not have the issue you mentioned in your post.

I hope it helps
0 Kudos
Naveed
Level 6

My understanding of your answer is:

If I change the version number only (major/minor), same installer command will work fine. I don't need to change anything else e.g. Product code, package code, upgrade code?


Naveed
0 Kudos
KathyMorey
Level 10

That's not quite right. If you're doing a minor upgrade (change the version number without changing the product code or upgrade code), you need to set REINSTALL and REINSTALLMODE properties to upgrade, but you can't set them for a new install. (If you wrap the MSI in setup.exe, setup.exe detects the existing product and sets these properties when it launches the MSI.)

If you're doing a major upgrade (change the version number and the product code but not the upgrade code), then each install is a new install and your bat file should work. On an upgrade, the MSI will detect the old version and uninstall it before installing the new version. (How it does that is based partly on the location of the RemoveExistingProducts action in the Execute Sequence; you might want to read up on that in the Windows Installer documentation to pick the scenario that's right for your product.)
0 Kudos