View Full Version : Uninstall completely?
kneighbour
08-22-2006, 06:10 AM
I have read with much interest the discussion about removing the last vestiges of SF7 during an uninstall. ie removing the "uninstall.exe" file.
The fact that a complete uninstall does not in fact take place is a real problem for me for a couple of reasons.
1. I cannot put anything into or near a user's "Windows" folder - as a matter of company policy. I guess I can move the "uninstall.exe" file to the Common folder - is there any problem with doing this?
2. It is also a matter of pride (and a good selling point) that we completely remove ourselves from a system when a user uninstalls.
Has anyone found a reliable way to completely uninstall an application?
Lorne
08-22-2006, 10:15 AM
Have you tried deleting it with File.DeleteOnReboot?
kneighbour
08-22-2006, 10:13 PM
Have you tried deleting it with File.DeleteOnReboot?
Well, I have not actually tried anything yet. But I am following the discussion and I can see the problems with this approach.
In this case - what if I do the DeleteOnReboot, then before doing a reboot, I re-install again. This is a very real situation - here at work I rarely reboot at all - probably once a week. I never reboot when an uninstall program tells me to - I am doing too many other things to waste the time.
When I do eventually do reboot, the uninstall folder will still be deleted, so uninstall will not work in the future.
So - what can you do to get around this?
1. force a reboot at this point??
2. set a flag so that when you next do an install, you can notify the user that a reboot is pending, and that it has to be done before you do the install?
3. somehow cancel the DeleteOnReboot during an install.
any other ideas?
csd214
08-27-2006, 08:25 AM
It is also a matter of pride (and a good selling point) that we completely remove ourselves from a system when a user uninstalls.
Exactly!
So - what can you do to get around this?
1. force a reboot at this point??
2. set a flag so that when you next do an install, you can notify the user that a reboot is pending, and that it has to be done before you do the install?
3. somehow cancel the DeleteOnReboot during an install.
I have successfully created a general script file that deletes the uninstaller (& log files) 'on reboot' when the user starts the uninstall process. I this case a flag file (your method #2) is created. The file FlagToReboot.txt has this content:
local lsFlagMsg = SessionVar.Expand("%ProductName%")..
" was uninstalled ..System.GetDate(DATE_FMT_ISO).." "..
System.GetTime(TIME_FMT_MIL)..
". You have to reboot the computer before reinstalling "..
SessionVar.Expand("%ProductName%");
I usually install an update over the previous version, but I perform a silent uninstall as the first step in “While installing”.
bUninstSuccess = Auto.Uninstall(sUniqueKey, true);
When the uninstaller is called from the setup (bSetupCall = true), the flag file is *NOT* created, and of course, the delete on reboot actions is *NOT* performed.
if not bSetupCall then
Auto.DeleteUninstaller(); -- deletes uninstall.exe (On reboot)
-- if you want to delete the logs, add this line:
Auto.DeleteLogs(); -- deletes Setup Log and Uninstall log (On reboot)
end
The flag file idea popped up during an “on line chat” with Eagle (SUF6NEWBIE) in March 2005 because I couldn’t have SUF70 to read the actual REG_MULTI_SZ value (http://www.indigorose.com/forums/showthread.php?t=10572) (PendingFileRenameOperations) in a proper way.
kneighbour
08-28-2006, 12:35 AM
Exactly!
I have successfully created a general script file that deletes the uninstaller (& log files) 'on reboot' when the user starts the uninstall process. I this case a flag file (your method #2) is created. The file FlagToReboot.txt has this content:
Thanks for these hints. I have done what you said, basically. I generate the flag file, etc.
Since I am simply testing this idea, and not actually doing a reboot, I puzzled on how SF7 was doing the DeleteOnReboot. I could not see how it is done. Does anyone know?
Manikandan
03-19-2007, 07:10 AM
Hello,
When i'm uninstalling my program i verify that my application folder remains intact when uninstall finish.
I beleive that's because my program creates subfolders and other files, that are not listed to be deleted with uninstall program.
I try to use a script in Uninstall Actions, On Post Uninstall, but couldn't do it.
Can someone help me, please?
I need a script to remove my application folder and subfolders with uninstall program!
Thanks!
Manikandan
Manikandan
03-19-2007, 08:55 AM
Hello,
When i'm uninstalling my program i verify that my application folder remains intact when uninstall finish.
I beleive that's because my program creates subfolders and other files, that are not listed to be deleted with uninstall program.
I try to use a script in Uninstall Actions, On Post Uninstall, but couldn't do it.
Can someone help me, please?
I need a script to remove my application folder and subfolders with uninstall program!
Thanks!
Manikandan
kneighbour
03-19-2007, 06:09 PM
ok - here is the code I use
-- remove application folders
stPath =SessionVar.Expand("%AppFolder%");
result = Folder.DoesExist(stPath);
if (result == true) then
Shell.DeleteShortcut(stPath, "PDF Manual");
Shell.DeleteShortcut(stPath, "Help file");
Folder.DeleteTree(stPath, nil);
end
%AppFolder% is a session variable I have setup as
%AppFolder% = %ProgramFilesFolder%\%ProductName%
No doubt yours would be similar.
Manikandan
03-20-2007, 03:37 AM
HI
Thanks for your Valuable reply.
Could you please send me the details where i can apply the below script
-- remove application folders
stPath =SessionVar.Expand("%AppFolder%");
result = Folder.DoesExist(stPath);
if (result == true) then
Shell.DeleteShortcut(stPath, "PDF Manual");
Shell.DeleteShortcut(stPath, "Help file");
Folder.DeleteTree(stPath, nil);
end
%AppFolder% is a session variable I have setup as
%AppFolder% = %ProgramFilesFolder%\%ProductName%
Thanks
S.Manikandan
kneighbour
03-20-2007, 08:37 AM
in the On Post Uninstall area
Manikandan
03-20-2007, 09:10 AM
Hi
Thanks once again. I can able to see in Setup Factory only for Action Tabs
On Startup,On preInstall,On postInstall,On Shutdown
But Uninstall tabs there is no option called post uninstall. Can you please guide me where i can implement the code.
Thanks & Regards
S.Manikandan
tmancey
03-20-2007, 06:47 PM
I would assume it uses:
MoveFileEx( szPath, NULL, MOVEFILE_DELAY_UNTIL_REBOOT );
to delete files upon reboot, however the user must have admin privileges, which I believe SF 7.0.6.1 would give on Vista/XP. If somebody could confirm this it would be great!
Thanks
Terry
tmancey
03-20-2007, 06:48 PM
Well if you re-install there must be a way of showing what is in the to do at reboot queue and then removing this entry which would fix this issue, if somebody works this out please post here so I can also see.
Thanks
Terry
tmancey
03-20-2007, 06:52 PM
Ok after some research you can check as it contains a list of files to delete on reboot, so I would search this regkey and delete the command to deleteonreboot if you reinstall, this would fix your problem:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\PendingFileRenameOperations
kneighbour
03-20-2007, 08:38 PM
Hi
Thanks once again. I can able to see in Setup Factory only for Action Tabs
On Startup,On preInstall,On postInstall,On Shutdown
But Uninstall tabs there is no option called post uninstall. Can you please guide me where i can implement the code.
S.Manikandan
You have a whole range of menu sections - Files, Settings, Screens, Actions, Resources and Uninstall. Select the Uninstall section. In there you will see the Actions option. Then Post Uninstall.....
Manikandan
03-21-2007, 08:26 AM
I am very happy to see the result. Thanks you very much for putting effort
Thanks & Regards
S.Manikandan
Manikandan
03-21-2007, 09:05 AM
I am very happy to see the result. Thank you very much for putting effort
Thanks & Regards
S.Manikandan
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.