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

Install MSI more than once without uninstalling...

We have a need to have a MSI do a particular set of tasks over and over again. We need to run it from a batch file in a single command line that is not conditional.
I have tried all versions of amus omus REINSTALLMODEs etc with no luck and searched and clicked many howtos without finding a solution...

msiexec /i DoThisOverAndOver.MSI /qb

Has anyone ever got something like this to work?
Labels (1)
0 Kudos
(6) Replies
Level 13

Will you get an error because it is already installed... or is this just a test?
Do you want it to run forever... or until CTRL C pressed?
Or do you want it to run X number of times?
Just use a FOR loop from CMD line or in Bat file.
Post answers and I will provide a solution later if you don't have one by then.

Do something like this in bat file to execute test 100 times:
@echo off
for /L %%a in (1,1,100) do echo %%a. & msiexec /i "DoThisOverAndOver.MSI" /qb || pause

The "|| pause" will pause on error. Remove that if not desired.
Use single % if running from CMD line like this
for /L %a in (1,1,100) do echo %a. & msiexec /i "DoThisOverAndOver.MSI" /qb || pause
0 Kudos
Level 3

Thanks for your help. Just need it to run each login, not in a looping type fashion.
And correct, currently we get an error because it thinks it is installed already. I can get it to re-install but that requires a different command line.
I need the MSI to run at every login, do what is in there regardless of if the stuff is already done. Basically like a batch file works, but via an MSI.
We have to use SCCM to push this thing and SCCM doesn't have conditional tasks.

Examples of stuff I tried:
- run the msi over again: Error product is already installed
- run the msi with reinstall modes: Error Installation only works for products that are already installed.
- uninstall the msi every time before installing it: (only works if msi is prev installed) Error application not not installed.
Errors kick an errorlevel back to SCCM which has no mechanism to ignore errors and the app shows failed - that is what we are trying to avoid.

There should be something i can set/do in installsheild that will let me set the msi to be able to either ignore install status or reinstall as a default action. Similar to the setting to pretend it is a ARPSystemComp so it won't show up in ARP...
0 Kudos
Level 13

Sounds like you are almost there. How are you determining what to use for an uninstall string?
1. Getting it out of the registry?
2. Using WMIC?
3. Just using a hard coded uninstall string?
If you are using 1 or 2 you can just conditionally uninstall to avoid error.
0 Kudos
Level 3

Nope not so close....

For uninstall since it is just an msi - we use the standard msiexec /x switch.
and we can't do that every time since, well that is just plain silly and it will error with "This action is only valid for installed products" if it wasn't already installed.

Sounds like i need to clarify further... I have broken this down to a very simple msi to demonstrate what we need.

MSI writes a txt file to the C: Drive. That is all.

Need to run the msi so it writes the file every time the user logs in (no matter if the file is there already or not).

/i Works fine first time, second time it runs but doesn't write the file (cause it thinks it is installed already)
if I delete the txt file, it won't ever write it back with /i

/f If i repair it, that works but would error if trying to use /f as a first time run and would require a different command line for 1st and subsequent runs. Not an option.

What i am hoping is that there is a component setting or a setting in Property Manager that will ignore the fact that it is installed already and let me install it again with the /i
Allow a /f for a first time AND subsequent installs.

There are a few component options ("Reevaluate Condition") and permutations of ReinstallModeTxt Property ("amus") in there that look like they should work to do what we need but don't do it.

I need to be able to double click the msi, have it write the file >> Then i manually delete the file >> then i need to be able to double click the msi and have it write it back again (no errors).
0 Kudos
Level 6

0 Kudos
Level 3

MrTree wrote:
so you just want something like this: ?

Holy cow, all the way back to "The Year 2000..."? noted with a tip of the had to Conan... I didn't get all the way back there during my research 🙂 and would have probably dismissed it out of oldness even if i would have found it...

Thanks for trackin this down, I'll check it out and see if i can modernize the tip to see if it will do what we need in 2016. I'll post back if it works...
0 Kudos