|
#1
|
||||
|
||||
|
Not able to remove path for old version
My setup:
- Setup Factory v8.1.1004.0 - Vista Ultimate Many of my users have an older version of our program. During installation, I have to remove some of the old shortcuts and replace it with the new. 1) Desktop Before install of the new versjon the user have one icon called "Embla Familie og Slekt v2007". After install the user have 2 icons called "Embla Familie og Slekt v8". Why do I get 2 icons on the desktop? In the "On Post Install" window, I have the following code; Code:
-- remove the old desktop ikon for v2007
-- Delete user based shortcut
Shell.DeleteShortcut(SessionVar.Expand("%DesktopFolder%"), "Embla Familie og Slekt v2007");
nLastError = Application.GetLastError();
if(nLastError ~= 0)then
Dialog.Message("Error",_tblErrorMessages[nLastError]);
SetupData.WriteToLogFile("Error reported when deleting shortcut".."_tblErrorMessages[nLastError]",true);
else
SetupData.WriteToLogFile("Deleted shortcut OK", true);
end
--Delete common (all users) based shortcut
Shell.DeleteShortcut(SessionVar.Expand("%DesktopFolderCommon%"), "Embla Familie og Slekt v2007");
nLastError = Application.GetLastError();
if(nLastError ~= 0)then
Dialog.Message("Error",_tblErrorMessages[nLastError]);
SetupData.WriteToLogFile("Error reported when deleting shortcut".."_tblErrorMessages[nLastError]",true);
else
SetupData.WriteToLogFile("Deleted shortcut OK", true);
end
2) Program list Before install the user have one icon called "Embla Familie og Slekt v2007" with 4 sub icons. After install the user still have the v2007 icon and the new v8 icon. How can I get rid of the old v2007 icon + the sub icons? In the "On Post Install" window, I have the following code; Code:
-- Delete user based shortcut
Shell.DeleteShortcut(SessionVar.Expand("%StartProgramsFolder%"), "Embla Familie og Slekt v2007");
nLastError = Application.GetLastError();
if(nLastError ~= 0)then
Dialog.Message("Error",_tblErrorMessages[nLastError]);
SetupData.WriteToLogFile("Error reported when deleting program folder".."_tblErrorMessages[nLastError]",true);
else
SetupData.WriteToLogFile("Deleted program folder OK", true);
end
-- Delete common (all users) based shortcut
Shell.DeleteShortcut(SessionVar.Expand("%StartProgramsFolderCommon%"), "Embla Familie og Slekt v2007");
nLastError = Application.GetLastError();
if(nLastError ~= 0)then
Dialog.Message("Error",_tblErrorMessages[nLastError]);
SetupData.WriteToLogFile("Error reported when deleting program folder".."_tblErrorMessages[nLastError]",true);
else
SetupData.WriteToLogFile("Deleted program folder OK", true);
end
How can I get rid of the old v2007 icon + the sub icons? What have I done wrong here? 3) Quickstart icons Before install the user have one icon called "Embla Familie og Slekt v2007". After install the user still have the v2007 icon and the new v8 icon. I have no code to remove this shortcut icon. How can I get rid of the old v2007 icon? Best regards Stein Inge |
|
#2
|
||||
|
||||
|
Hi Stein Inge,
My first question for you is: Does this work properly on other operating systems? e.g. Windows XP. I ask this because I am able to create and delete shortcuts using the following code on Windows XP: Code:
-- Create Shortcut Shell.CreateShortcut(Shell.GetFolder(SHF_DESKTOP) , "Embla Familie og Slekt v2007" , "C:\\My Prog\\MyExe.exe" , "" , "" , "" , 0 , SW_SHOWNORMAL , nil , ""); -- Delete Shortcut Shell.DeleteShortcut(Shell.GetFolder(SHF_DESKTOP) , "Embla Familie og Slekt v2007"); If the shortcuts are created in the user's profile, and if your installation requires elevation then the desktop folder is now the administrators desktop folder and not the user's desktop folder. If you want a debug test you can use the following code to see if the shortcut exists and what path you are actually looking for it at: Code:
strFilePath = Shell.GetFolder(SHF_DESKTOP)
strFilePath = strFilePath.."\\Embla Familie og Slekt v2007.lnk"
if (File.DoesExist(strFilePath)) then
Dialog.Message("Exists", "The file exists: "..strFilePath)
else
Dialog.Message("Does Not Exist", "The file does not exist: "..strFilePath)
end
Code:
%LaunchUserDesktopFolder% %LaunchUserStartProgramsFolder% %LaunchUserApplicationDataFolder% You can access the Quick Launch folder using the following code (although in your case you may want to use the %LaunchUserApplicationDataFolder% variable on Vista): Code:
strQuickLaunch = SessionVar.Expand("%ApplicationDataFolder%")
strQuickLaunch = strQuickLaunch.."\\Microsoft\\Internet Explorer\\Quick Launch"
I hope this helps.
__________________
MSI Factory The Next Generation Intelligent Setup Builder |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| different install path depending on Windows version? | gnznroses | Setup Factory 7.0 Discussion | 2 | 09-11-2007 02:29 PM |
| How i Remove the Info at version | DaSoul | AutoPlay Media Studio 6.0 | 1 | 03-10-2007 02:22 PM |
| HOWTO: Detect Acrobat Version | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-22-2002 05:01 PM |
| INFO: Moving from the Trial Version to Commercial Version | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-07-2002 09:52 AM |
| Does uninstall remove path? | Jonnycab | Setup Factory 5.0 | 4 | 07-31-2001 03:29 PM |
All times are GMT -6. The time now is 04:35 AM.








Linear Mode

