Lone Shepherd
2nd May 2008 19:36 UTC
Perform silent uninstall during upgrade install?
With my installer, I would like to provide the option of doing an upgrade install.
What is the best way to accomplish this?
I was thinking i might call the uninstaller and have it run silently (no UI) before doing the install; is that possible to do?
Also, I've noticed if I run my installer and install to the same directory, overwriting the files that are there, the install is VERY slow; whereas doing a 'clean' install is fast. What's up with that?
stb
2nd May 2008 21:50 UTC
Doing a silent uninstall for upgrades is a good idea. I use this in all my installers. You can have one installer that does all things you want this way:
1. Detect if software is installed already (=> UPDATE mode)
2. If UPDATE mode: read current settings (INSTDIR, startmenu ...)
3. If UPDATE mode: uninstall silently using something like this:
ExecWait '"$INSTDIR\uninstall.exe" /S _?=$INSTDIR'
4. If NOT UPDATE mode: ask user for INSTDIR, startmenu ...
5. Install new software version and store INSTDIR, startmenu and more somewhere (e.g. registry) for later use (step 2)