Page 1 of 1

Add Remove Logic

Posted: Wed Dec 17, 2008 8:41 am
by tj
I have some config files that my setup needs to create on the initial install only. To accomplish this I added some registry values to retain the previous installed state of each feature, allowing me to skip the creation of the config files for an add/remove action even though the selected component state is TRUE. However, in doing so, I noticed that if I don't add the Windows Installer actions during an add/remove --EVEN FOR ALREADY INSTALLED FILES-- then Windows Installer identifies this as an uninstall for that feature and removes the files.

This led me to wonder if, during an add/remove, files get re-installed even if they are already there. To test this, I used my instance of Install Aware 8. I went through add/remove programs to enter the maintenance mode of the IA8 install. I selected the radio button for add/remove but I didn't change a thing in the component tree. To my surprise, setup went through what appeared to be a re-install of the complete package. I even had to rerun my license .exe after this process. To me, this seems more like a repair action.

I'm hoping that Windows Installer checks versions and doesn't overwrite a currently installed and running Windows Service. I expected the component selections to be remembered between add/remove actions such that adding a single component would truly only add the newly selected component files.

Can someone help me understand what I am experiencing? It looks like we need to put non-Windows Installer actions in a separate conditional section and trust that the Windows Installer will not overwrite files that do not need to be overwritten?

Posted: Wed Dec 17, 2008 12:01 pm
by CandiceJones
This is covered in full detail in our MSIcode whitepaper. Please read this whitepaper and post back here if you have further questions.

Posted: Fri Mar 13, 2009 10:15 am
by tj
Just to follow up from my original post...

I ended up identifying that stopping the service during the update and restarting the servic after the update prevented the need for the reboot. Apparently, that was the trigger for Windows Installer to flag the reboot.

Thus, at the beginning of my update logic, I use the Run Program scritp to call "sc" to stop all of the application services, apply the update and then restart the services again manually at the end of the udpate.

Hope this helps someone else.

Posted: Sat Mar 14, 2009 7:57 am
by MichaelNesmith
Any reason you did not use Control Service?

Posted: Sat Mar 14, 2009 10:00 am
by tj
I started using Control Service but I needed to be able to start and stop the services without the install/uninstall trigger. Thus, I have an include script for starting and one for stopping that allows me to start the services in order to do some configuration/testing/analysis during the setup and/or updates.

Posted: Sat Mar 14, 2009 9:30 pm
by MichaelNesmith
Makes sense.