PDA

View Full Version : More uninstall shortcut...



UpWritePress
06-29-2004, 01:05 PM
Hi, I used the following code provided in a previous post to create an uninstall icon in the start menu.

-----------------------------------------------------------------------------------
prototype NUMBER MakeUninstallIcon();
//ProductType value
function NUMBER MakeUninstallIcon()
STRING szWorkingDir;
STRING szIconPath;
NUMBER nIcon;
STRING szShortCutKey;
NUMBER nFlag;
STRING szItemName;
STRING szProgramFolder;
STRING szCommand;
STRING szParam;
STRING szCommandLine;
NUMBER nResult;
STRING tmpString;

begin
szWorkingDir = "";
szIconPath = TARGETDIR ^ "Uninstall.ico";
nIcon = 0;
szShortCutKey = "";
nFlag = REPLACE;
szItemName = "unInstall " + IFX_PRODUCT_NAME;
szProgramFolder = FOLDER_PROGRAMS ^ IFX_COMPANY_NAME ^ IFX_PRODUCT_NAME;

szCommand = COMMONFILES ^ "InstallShield\\Professional\\RunTime\\09\\00\\Intel32";
LongPathToShortPath(szCommand);
szCommand = szCommand ^ "Ctor.dll" + ",LaunchSetup";
szParam = PROGRAMFILES ^ "InstallShield Installation Information" ^ PRODUCT_GUID ^ "Setup.exe";
LongPathToQuote(szParam, TRUE);
szCommandLine = "RunDll32 " + szCommand + " " + szParam + " -10x7";
nResult = AddFolderIcon(szProgramFolder, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag);
// NumToStr(tmpString,nResult);
// MessageBox(tmpString,INFORMATION);


return nResult;
end;
----------------------------------------------------------------------------------

I just noticed, on other machine besides my development machine, clicking this icon give the following 'RunDLL' error message: "Error loading C:\Program The specified module could not be found".

Looking at the target of the shorcut on the machine it doesn't work on, it reads - C:\WINNT\system32\rundll32.exe C:\Program Files\Common Files\InstallShield\Professional\RunTime\09\00\Intel32\Ctor.dll,LaunchSetup "C:\Program Files\InstallShield Installation Information\{D870F6FA-EFC8-40FE-AC45-7DE7263ED955}\Setup.exe" -10x7

That path does not exist on the machine. The path 'C:\Program Files\Common File\InstallShield\Professional\RunTime\09\01...etc' does exist, but simply a quick change of the 00 to 01 produced the same result. Also, I thought it was kinda strange it didn't convert it to a short path.

Anyone have a clues why I'm getting this message? I would assume something isn't being installed (on the installshield 'engine'?? part).

Any pointers on where to start would be great! All the stuff that is in the Common File is done automatically, so I'm not sure where to even look.

This is a InstallScript Project.

Thanks,
Jason

UpWritePress
06-29-2004, 02:16 PM
Alright... If I comment out the LongPathToShortPath(szCommand); line of code, I can reproduce it on my dev machine. The command is returning 0 (success) on the machine I'm having problems with.

So (don't know if I'm track or not)... but 2 questions:
1) Why isn't it turning the path into a short path, yet still returns 0.
2)Why doesn't the path 'COMMONFILES ^ "InstallShield\\Professional\\RunTime\\09\\00\\Intel32' not exist, or should it? This isn't the problem that is showing now though, because like I said... If I don't convert it to a short path on my dev machine I can reproduce the error.

Also, is there a way I'm not seeing to debug the uninstall process?

Thanks,
Jason

alatten
06-30-2004, 05:09 AM
Hi Jason,

I would guess the reason that on your machine the path
COMMONFILES ^ "InstallShield\\Professional\\RunTime\\09\\00\\Intel32"
must read
COMMONFILES ^ "InstallShield\\Professional\\RunTime\\09\\01\\Intel32"
instead, is that you have SP 1 installed, i.e. V9.01? For some reasons IS is not willing to release a German SP1. So I have to stay with V9.00. If I read in the documentation about LongPathToShortPath, it says that the corresponding Path must exist on the target machine. Is it working, if you replace '00' with '01' in your script?
Otherwise check the UninstallString-Value in the registry for further differences (HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID}).

HTH,
Andrees

UpWritePress
07-01-2004, 11:01 AM
It seems there is a IS variable UNINSTALL_STRING I can use for the command parameter (instead of hard coding anything) and it worked beautifully...

Thanks for the response!
Jason