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

an open directory causes uninstall to fail


1 reply to this topic

Cookie Crumb

Cookie Crumb
  • Members
  • 6 posts

Posted 25 November 2002 - 20:03

Some General information:

 Build System:    Win XP with SP1
 Software:         InstallShield Dev 7 SP4
 Project:           Standard


I have a project that installs fine, and even uninstalls fine. I use InstallScript to create one shortcut on the desktop to the installed application and three shortcuts in the Start/Programs menu to the application, a manual and the uninstall (i just used the InstallScript UNINSTALL_STRING value for the uninstall shortcut). These three shortcuts are installed at

 Start Menu/Programs/Company/Product x.x

The reason I use InstallScript to install the shortcuts is so I can automatically take the version and release number off the ProductVersion string (x.x).x and include that information in the Product x.x directory that's created in the Start/Programs/Company directory as well as append it to the shortcut names, as follows:

[Desktop]
 Product x.x

[Start/Programs/Company/Product x.x]
 Product x.x
 Product x.x Manual (a PDF file)
 Uninstall Product x.x

The reason for this is so multiple versions of the product may be installed at the same time (but not multiple versions of the micro release, those do a major upgrade).

This is the problem I am running into:

When I uninstall the product from the system, if the Start/Programs/Company or Start/Programs/Company/Product x.x folder is open (via the Windows file explorer), the uninstall partially completes, then says the uninstall was interupted, can't complete and that the system has not been changed (but it has!). At this point, the uninstall has removed the desktop shortcut, the shortcuts in Start/Programs/Company/Product x.x (but not the directory itself), well over half the registery entries, but non of the installed application files.

If I try go to the Control Panel at this point to remove the product, I don't find the product entered there, and so can't remove it from the Control Panel.

At this point, trying to reinstall will cause an extra "Product x.x" to be appended to the existing INSTALLDIR path so that it ends up being (as the default):

 C:\Program Files\Company\Product x.x\Product x.x

The reinstall will work if I remove that extra "Product x.x", but if I don't, then the shortcuts that are installed end up pointing to the location one directory level back. The shortcuts point to where INSTALLDIR points, so this means the extra "Product x.x" is not part of the INSTALLDIR string, though the files are actually installed at the path mentioned above! Quite a puzzle.

Has anyone experienced simmilar? If so, has anyone come across a solution for simmilar? If not, does anyone have any idea how I can keep the uninstall from failing when the Start/Programs/Company/Product x.x folder is open in the explorer?

I've looked at other uninstalls and the normal behavior is to close the explorer window and then remove the directory, but I don't seem to be able to implement this normal behavior.

Any help will be greatly appreciated!



Cookie Crumb

Cookie Crumb
  • Members
  • 6 posts

Posted 26 November 2002 - 08:48

Turns out I managed to solve the problem myself. I failed to mention that I was running the uninstall from the installed Uninstall shortcut in the program folder put in the start menu.

In the script, I was using the AddFolderIcon this way:

Code Sample
AddFolderIcon(
FOLDER_PROGRAMS + "Company\Product x.x",
"Product Icon",
"Icon Path",
"",
"",
0,
"",
RUN_MAXIMIZED
);


What I should have been doing was specifying the working directory in the forth argument like so:

Code Sample
AddFolderIcon(
FOLDER_PROGRAMS + "Company\Product x.x",
"Uninstall Product",
"\"Path to Uninstall\"" + "Parameters",
WINDIR,
"",
0,
"",
RUN_MAXIMIZED
);


I had assumed that the default "working directory" would be the location where the program was run, not the location of of the icon itself. When the Uninstall is run from the program menu and the program menu is open in the explorer, it makes that directory active, and therefore unable to be removed. InstallShield then buggers out when trying to remove that program group. So, a working directory needs to be specified for the Uninstall, wherever that icon is placed, that is not amongst the directories to be removed. In the above example it's the windows directory.