I am removing the old version of my setup, before installing the new version. I have not changed any of the InstallAware code to perform this action. I have noticed a problem...
In my setup, I create a few virtual directories, and also delete them in the uninstallation. When I install, then uninstall my setup, they get removed fine. The issue is when my setup is being uninstalled via a newer version setup.
In my new version setup, it shows the prereq dialog, and seems to correctly uninstall my old version. So when it gets to the normal welcome dialog, I figure that the old version must be totally uninstalled, so I might as well double check some things to make sure its all done right. This is the point where I find that the virtual directories still exist! I am quite confused at this point as to why they are not being removed.
To try and help myself understand this problem, I am showing a message box right before I delete the virtual dreictories. The message box shows when I run the original installer (to uninstall), but the messagebox never shows when its uninstalled through the new setup.
Am I missing something? Does Install/Uninstall MSI command do something different then running the setup manually?
thanks for your help.
Uninstall old version during setup
-
- Posts: 46
- Joined: Tue Aug 22, 2006 9:16 am
- Location: NorthEast, USA
- Contact:
Sean:
Purple commands are Windows Installer commands. If you run Uninstall MSI, only purple commands are uninstalled.
Any additional uninstall logic is not executed during Uninstall MSI. These commands are only active during an interactive modify/uninstall.
If you want to remove folders/files you can try it this way:
This is a Windows Installer command and executed on Uninstall MSI.
Purple commands are Windows Installer commands. If you run Uninstall MSI, only purple commands are uninstalled.
Any additional uninstall logic is not executed during Uninstall MSI. These commands are only active during an interactive modify/uninstall.
If you want to remove folders/files you can try it this way:
Code: Select all
Delete Files $TARGETDIR$\\db\\verify\\*.* (when uninstalling)
This is a Windows Installer command and executed on Uninstall MSI.
Martin Rothschink
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
InstallAware MVP
AxoNet Software GmbH
http://www.axonet.de/products/other-pro ... stallaware
-
- Posts: 46
- Joined: Tue Aug 22, 2006 9:16 am
- Location: NorthEast, USA
- Contact:
This is exactly what I was afraid of. Thanks, that is interesting. It seems that I am out of luck now. Here is my situation...
I have two features. Each feature has a website demo with it, so each one needs a different virtual directory. On the first install, a user might install both features, so two virtual directories are created. The next time he installs an update, he might only select one of the features. I thought that both virtual directories would be deleted at this point, but it seems that they both exist. So the end result is two virtual directories, when I only expected 1 to exist.
Is there anywhere I can find a list of commands which are MSI commands?
I have two features. Each feature has a website demo with it, so each one needs a different virtual directory. On the first install, a user might install both features, so two virtual directories are created. The next time he installs an update, he might only select one of the features. I thought that both virtual directories would be deleted at this point, but it seems that they both exist. So the end result is two virtual directories, when I only expected 1 to exist.
Is there anywhere I can find a list of commands which are MSI commands?
-
- Posts: 46
- Joined: Tue Aug 22, 2006 9:16 am
- Location: NorthEast, USA
- Contact:
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Hi!
Purple commands (with default syntax highlighting) are the Windows Installer commands, this makes it quite easy to identify them.
If you want to do a full uninstall (which is generally not wanted during minor upgrades, that's why InstallAware uses the (Un)Install MSI Setup command for them), just run the InstallAware setup directly! This will run all commands and do a complete uninstall - I think this is what you want to do.
The command line parameters to silently uninstall a product are well-documented in the help file. All you need to do is replace the call to (Un)Install MSI Setup with a new call to Run Program, starting the InstallAware setup instead of just doing a plain MSI uninstall. That will take care of it for you. To make it easy to find where the InstallAware setup is, just store the $UNINSTALLLINK$ variable in the registry at install time, so you can just read it, add the necessary command line parameters to the end of it, and silently remove.
Purple commands (with default syntax highlighting) are the Windows Installer commands, this makes it quite easy to identify them.
If you want to do a full uninstall (which is generally not wanted during minor upgrades, that's why InstallAware uses the (Un)Install MSI Setup command for them), just run the InstallAware setup directly! This will run all commands and do a complete uninstall - I think this is what you want to do.
The command line parameters to silently uninstall a product are well-documented in the help file. All you need to do is replace the call to (Un)Install MSI Setup with a new call to Run Program, starting the InstallAware setup instead of just doing a plain MSI uninstall. That will take care of it for you. To make it easy to find where the InstallAware setup is, just store the $UNINSTALLLINK$ variable in the registry at install time, so you can just read it, add the necessary command line parameters to the end of it, and silently remove.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 46
- Joined: Tue Aug 22, 2006 9:16 am
- Location: NorthEast, USA
- Contact:
Thanks for the tip, I might end up doing that. Here is my real issue:
When I do a full uninstall, all of my folders are removed correctly. But between the uninstall and install of an upgrade, I looked at my folders (under program files) and I see an access is denied message. I assume that this is because of the virtual directories, but I am not sure.
When I do a full uninstall, all of my folders are removed correctly. But between the uninstall and install of an upgrade, I looked at my folders (under program files) and I see an access is denied message. I assume that this is because of the virtual directories, but I am not sure.
-
- Posts: 46
- Joined: Tue Aug 22, 2006 9:16 am
- Location: NorthEast, USA
- Contact:
I did a lot of looking, and I couldn't find any lines of MSI Script that (to me) seemed like they could cause this "access is denied" issue. The only difference between the msi commands and installAware commands is that I remove the virtual directory on uninstall. If there was a way to remove a virtual directory while doing an msi uninstall, I would love to hear about it.
Since I can't figure out why this is happening, and an InstallAware uninstall does do the right thing, I guess I'll take your suggestion and run the UNINSTALLLINK program rather than just the msi file to uninstall. This makes my setup work correctly, but the only downside is that I have no progress information or any sense whatsoever that my setup is doing anything. I guess I can't get this type of information from the Run Program Command, but is there some way that I can run an InstallAware setup AND get the progress info from it?
Are there any msi command that will run some type of external program? (I'm thinking I could write my own little utility that could remove virtual directories)
Since I can't figure out why this is happening, and an InstallAware uninstall does do the right thing, I guess I'll take your suggestion and run the UNINSTALLLINK program rather than just the msi file to uninstall. This makes my setup work correctly, but the only downside is that I have no progress information or any sense whatsoever that my setup is doing anything. I guess I can't get this type of information from the Run Program Command, but is there some way that I can run an InstallAware setup AND get the progress info from it?
Are there any msi command that will run some type of external program? (I'm thinking I could write my own little utility that could remove virtual directories)
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
You can set the PROGRESSMODE variable to MARQUEE and display a nice scrolling animation during the uninstall.
Alternately, you can delete the virtual folders after you have uninstalled using (Un)Install MSI Setup itself. There is no reason why you cannot do this.
MSI does not have any capabilities to process virtual folders, so you would ordinarily have to use custom actions for them. InstallAware makes the complexities and authoring problems of custom actions obsolete, and similarly there is no need for you to write your own EXE. You already have everything you need built-in.
Alternately, you can delete the virtual folders after you have uninstalled using (Un)Install MSI Setup itself. There is no reason why you cannot do this.
MSI does not have any capabilities to process virtual folders, so you would ordinarily have to use custom actions for them. InstallAware makes the complexities and authoring problems of custom actions obsolete, and similarly there is no need for you to write your own EXE. You already have everything you need built-in.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 15
- Joined: Tue Nov 21, 2006 5:16 pm
For anyone else interested:
I have to do some non-MSI cleanup when uninstalling certain components/features (like unregistering ports on the Windows Firewall). So if someone did an upgrade (new install without uninstalling the old version) and took out the component that needs open ports in the firewall then the ports would never get unregistered. The suggestions in this thread lead me to think that the only way to unregister the ports and get a progress bar of the uninstall would be to have the code that unregisters the firewall in two places. That's obviously bad since you have to remember to change it in two places if it ever changes. Then I remembered about Include Scripts. I put the firewall code in a separate script and included the script in both places. Include Scripts work like an inline function (remember that your scope hasn't changed). The downside to this approach (as opposed to being able to run non-MSI code from the previous install file) is that you'll have to leave the code in for a long time after you no longer need it. For instance, if we find a different approach that doesn't need to open the ports on the firewall, we have to leave the unregistration code in the installer until we are sure that no one will upgrade from a firewall version to a non-firewall version.
I have to do some non-MSI cleanup when uninstalling certain components/features (like unregistering ports on the Windows Firewall). So if someone did an upgrade (new install without uninstalling the old version) and took out the component that needs open ports in the firewall then the ports would never get unregistered. The suggestions in this thread lead me to think that the only way to unregister the ports and get a progress bar of the uninstall would be to have the code that unregisters the firewall in two places. That's obviously bad since you have to remember to change it in two places if it ever changes. Then I remembered about Include Scripts. I put the firewall code in a separate script and included the script in both places. Include Scripts work like an inline function (remember that your scope hasn't changed). The downside to this approach (as opposed to being able to run non-MSI code from the previous install file) is that you'll have to leave the code in for a long time after you no longer need it. For instance, if we find a different approach that doesn't need to open the ports on the firewall, we have to leave the unregistration code in the installer until we are sure that no one will upgrade from a firewall version to a non-firewall version.
Who is online
Users browsing this forum: No registered users and 87 guests