Stein Inge
09-08-2008, 02:51 PM
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;
-- 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
What have I done wrong here?
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;
-- 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
- 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;
-- 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
What have I done wrong here?
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;
-- 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