KevinD
11-04-2008, 12:58 PM
Can someone please tell me what is wrong with the following code?
sFolder = SessionVar.Expand("%AppShortcutFolderName%");
sTarget = SessionVar.Expand("%AppFolder%\\cpsproc.exe");
sArgs = "-L:" .. sFile;
sDescription = sFile;
SetupData.WriteToLogFile( "SCFolder\t" .. sFolder .. "\r\n", true );
SetupData.WriteToLogFile( "SCTarget\t" .. sTarget .. "\r\n", true );
SetupData.WriteToLogFile( "SCArgs\t" .. sArgs .. "\r\n", true );
SetupData.WriteToLogFile( "SCTitle\t" .. sDescription .. "\r\n", true );
Shell.CreateShortcut(sFolder, sDescription, sTarget, sArgs, SessionVar.Expand("%AppFolder%"), sTarget, 0, SW_SHOWNORMAL, nil, "");
The program that is being installed has four configuration settings which the user can select to install or not. In the On Post Install Actions tab I have a table which the names of the config files. a loop checks for the presence of the config file and makes a few modifications if needed. That part works fine.
Next I want the installer to create individual shortucts to the EXE passing the config file as an arugment and using a different name for each. The script fails at the Shell.CreateShortcut line above. The log file returns
Error Script: On Post Install, Line 37 (2300)
The help file describes this as "Could not create the folder for the shortcut.".
I get the same error if the EXE file properties are set to create an icon or not. The SetupData lines return the following which are as expected:
[11/04/2008 17:59:14] SCFolder Kevin Murphy\CPS Processor
[11/04/2008 17:59:15] SCTarget E:\Program Files\Kevin Murphy\CPS Processor\cpsproc.exe
[11/04/2008 17:59:15] SCArgs -L:cps.ini
[11/04/2008 17:59:15] SCDescript cps.ini
The installer is being run on Windows Server 2003.
What am I missing?
Thanks in advance.
Kevin
sFolder = SessionVar.Expand("%AppShortcutFolderName%");
sTarget = SessionVar.Expand("%AppFolder%\\cpsproc.exe");
sArgs = "-L:" .. sFile;
sDescription = sFile;
SetupData.WriteToLogFile( "SCFolder\t" .. sFolder .. "\r\n", true );
SetupData.WriteToLogFile( "SCTarget\t" .. sTarget .. "\r\n", true );
SetupData.WriteToLogFile( "SCArgs\t" .. sArgs .. "\r\n", true );
SetupData.WriteToLogFile( "SCTitle\t" .. sDescription .. "\r\n", true );
Shell.CreateShortcut(sFolder, sDescription, sTarget, sArgs, SessionVar.Expand("%AppFolder%"), sTarget, 0, SW_SHOWNORMAL, nil, "");
The program that is being installed has four configuration settings which the user can select to install or not. In the On Post Install Actions tab I have a table which the names of the config files. a loop checks for the presence of the config file and makes a few modifications if needed. That part works fine.
Next I want the installer to create individual shortucts to the EXE passing the config file as an arugment and using a different name for each. The script fails at the Shell.CreateShortcut line above. The log file returns
Error Script: On Post Install, Line 37 (2300)
The help file describes this as "Could not create the folder for the shortcut.".
I get the same error if the EXE file properties are set to create an icon or not. The SetupData lines return the following which are as expected:
[11/04/2008 17:59:14] SCFolder Kevin Murphy\CPS Processor
[11/04/2008 17:59:15] SCTarget E:\Program Files\Kevin Murphy\CPS Processor\cpsproc.exe
[11/04/2008 17:59:15] SCArgs -L:cps.ini
[11/04/2008 17:59:15] SCDescript cps.ini
The installer is being run on Windows Server 2003.
What am I missing?
Thanks in advance.
Kevin