Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

installing on already installed version


3 replies to this topic

Devang Parmar

Devang Parmar
  • Members
  • 64 posts

Posted 17 September 2001 - 17:04

Hello Dear Friends,

I am using Windows Installer 1.52. I have one problem with me. My software is not yet released. I have to make installation of my software once a week so all the changes done in the week are available to testers. Now when they start setup.exe of the new version the older version already starts uninstalling and then after reboot new installation doesnt start.

I want to be this way :

1. when user clik setup.exe the dialog box should appear "this will uninstall older version." with YES and NO button. I can make this but where should I put this ? I mean if user invokes uninstallation from ControlPanel then this should not appear. This should appear only when user starts new installation.
2. Depending upon the user's choice of YES or NO, I will start uninstalling and add setup.exe in runonce so that it runs new setup when computer reboots. or abort uninstallation if user chose NO.


Can anyone have any idea ? Can anyone help me in this ?

Thanks,
Devang.


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 18 September 2001 - 00:07

Have a look at the document on upgrading by Robert M. Dickau, available from this site under Windows Installer, Tools & Tips.  That should start you off in the right direction.

Devang Parmar

Devang Parmar
  • Members
  • 64 posts

Posted 25 September 2001 - 14:45

Hi,

Thanks for the info. One more thing. I will have to reboot the PC before installing newer version. How can I get the location from where the setup.exe is being run.

My question would be more clear if I say that user is installing from network location. He has already installed from one directory on the network. Now he runs second setup.exe from the another folder. My installation should uninstall previous version, store the new setup.exe location, reboot PC and run installation again.

How can I get the location of setup.exe ?

Regards,
Devang.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 25 September 2001 - 21:40

It is unlikely you really need to reboot before upgrading.  Windows installer will handle locked files.

Your custom actions should  be conditioned depending on whether a  particular component is being installed or removed and should probably do nothing if the related component is already installed and is not being upgraded.  Unfortuately there is a tendancy among beginners to condition on features or even worse (and disasterously wrong) REMOVE="ALL".  If you have componetised and conditioned your product properly upgrades are really effective.

The upgrade can  work by simple overwriting components with older key files (minor upgrade - reinstallation).  Or by "Major" upgrades which is a more controlled way of doing things.   In a major upgrade at some point the new installation exectutes an action called RemoveExistingProducts.  This exectues the msi database of the previous installation to remove itself.  

There are two points where the RemoveExistingProducts action is commonly placed.  The first is before InstallInitialize.  This results in the old installation being completely removed before the new installation is installed.  If this forces a reboot the install should resume and install the new installation.

The second location is  in my opinion the better choice. RemoveExistingProducts is placed immediately after InstallFinalize.  In this case the install will install only components with newer key files.  (The installer will record that these components are used by the new product. in the registry).   Now when RemoveExistingProducts calls the old install.  The old install does not remove the components that were referenced by the new install and just removes components that are completely obsolete.

Now, for example.  if all your upgrade is doing is changing the user interface of your installation you do not need to reboot as the awkward component is staying the same.

I can not say if you really need to reboot half way through an upgrade but you can work around a lot of cases.  For instance one of my installations  has a kernel mode driver that can not be stopped.  So at first sight I need to reboot before  this driver is to be upgraded.  But in practice I have just overwrite the old component and let a reboot at the end take care of reinitialisation.

(Edited by Ian Blake at 9:41 pm on Sep. 25, 2001)