PDA

View Full Version : Targetdir == Windir



nat2k4us
06-02-2004, 12:41 PM
Somehow the TARGETDIR is set to C:\Windows when the maintenance mode is entered. I know I can detect this(i.e if TARGETDIR == WINDIR) from the script and delete the setup.ilg file. But the sad part is that the file gets created again at the end of the un-installation process that was unsuccessful. Anyway to delete it when TARGETDIR is C:\Windows and prevent it from restoring itself when TARGETDIR == WINDIR.

Is there a better way or is there a way to prevent TARGETDIR == WINDIR situations?



function OnMaintUIBefore()
.........
MessageBox(WINDIR,INFORMATION);
MessageBox(TARGETDIR,INFORMATION);
if( TARGETDIR == WINDIR) then
MessageBox("Uninstallation log is corrupt!.\nBackup your files and run setup again.",INFORMATION);
szToDeleteFilePath = "C:\\Program Files\\InstallShield Installation Information\\{23313da8-0a92-11d4-901e-006008a8c8da}\\Setup.ilg";
MessageBox(szToDeleteFilePath,INFORMATION);
DeleteFile(PROGRAMFILES^szToDeleteFilePath);
AbortInstallation();
endif;

nat2k4us
06-03-2004, 09:52 AM
When TARGETDIR == WINDIR, we can be sure that we are going to be stuck in maintenance mode.

InstallShield support please suggest how to bring the user out of this situation ( without having manully deleting the registry entries ..GUID etc ). One thing I can think of is to delete the registry entries from the script itself and I think then IS would treat it as a fresh install.:)

nat2k4us
06-10-2004, 05:17 PM
// Are we going to be stuck in maintenance mode
//MessageBox(WINDIR,INFORMATION);
//MessageBox(TARGETDIR,INFORMATION);
//HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID}
// if TARGETDIR == WINDIR then we can be sure we are going to be stuck in maintenance mode
if( TARGETDIR == WINDIR) then
MessageBox("Uninstallation log is corrupt.\n\nPlease run setup again. Note that user \nsettings may be lost.",INFORMATION);
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBDeleteKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + PRODUCT_GUID );
endif;

Ok! This solution seem to work fine for now.

If u guys see any potential problems with this ..plz let me know. Install Shield ppl somehow do not want to hear about this problem.