Indigo Rose Software
  #1  
Old 10-20-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Deleting the Uninstaller

I'm fond of housekeeping, but only INSIDE the computer (ask my wife).

When the end user wants to uninstall my app (I have some 'dumb' customers), I want to clean up his computer. By default SUF70 saves uninstall.exe (450,000 bytes) in C:\WINDOWS\ProductName. You will notice: After building 10 projects you have 10 occurrences of uninstall.exe (=4,500,000 bytes). After uninstalling your app, the subfolder with content still is on the disk.

In addition you eventually have two log files; by default:
%WindowsFolder%\%ProductName% Setup Log.txt
%WindowsFolder%\%ProductName% Uninstall Log.txt


Personally I don't like to have a lot of files in Windows root directory; I want to put them into subfolders. In SUF70 I always replace the space in the log file names with a backslash. Then I have all three files in the Product Folder under Windows.

Space available isn't the main problem these days. Still I want to 'clean up' when the end user uninstalls my app (can you understand why?). I have now created a global function to perform this task. Just add gu_DeleteUninstaller() to Uninstall Action.On Shutdown.

If you want to delete the log files, you have to add another line: gu_DeleteLogFiles(). All the files are deleted on reboot. (Both 'default location' and 'preferred location' is covered by the function.)

Why create an Uninstall Log and immediately delete it in the same operation? Well, if an error occurs during the uninstall process, the log files can be copied to another location (before reboot). (You can add a message to tell the user to do so.)

I you want to try my functions, save the attached file to the ..\Includes\Scripts folder with .lua extension. You have to add three lines in Actions.On Shutdown. You'll find all instructions as comments in the lua file.

Feel free to comment and suggest improvements! Do you think I'm crazy with my housekeeping? Please tell me.
Reply With Quote
  #2  
Old 10-20-2004
Josué Alba
Guest
 
Posts: n/a
Try using a wininit.ini file. it's preatty simple
Reply With Quote
  #3  
Old 10-20-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Josué Alba
Try using a wininit.ini file. it's preatty simple
Sorry, I don't understand. Could you please tell me what you mean?
Preferably with an example; the forum users would than have another option to use.
Reply With Quote
  #4  
Old 10-21-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Josué Alba
Try using a wininit.ini file. it's preatty simple
Hello Josué, I'm listening!?
Reply With Quote
  #5  
Old 10-21-2004
Brett's Avatar
Brett Brett is offline
Indigo Rose Staff Member
 
Join Date: Jan 2000
Posts: 2,001
I think he is referring to the fact that Windows 9x systems use that INI file as a way to delete files on reboot. In our products, use File.DeleteOnReboot to do the same thing and it works on all Windows OSs.
Reply With Quote
  #6  
Old 10-21-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Brett
In our products, use File.DeleteOnReboot to do the same thing and it works on all Windows OSs.
Yes, it works for sure. I have never had any problem with File.DeleteOnReboot during all the year I have used Setup Factory.

I confess; I'm a teaser now, but when Josué steps in and tells "there is en easier way", I think he should tell the forum users HOW. (The challenge in this case is not the delete command, but how to identify the files to be deleted (in a generic function)).

I ran into some "problems" (from my commented source):

-- We can not use UninstallData.GetItem() as an Uninstall action; it will give Error 2864 "Action not available during uninstall."
-- We need the value at Uninstall, we obtain it now (at Setup), creates a Session Variable. That Session Variable we can get when uninstalling.

Q: Is this the correct way to do it?


BTW, I tried the winiit.ini option (on XP), but I couldn't have it to work.
Reply With Quote
  #7  
Old 10-22-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Sorry, the previously posted lua file is missing closing comment brackets after the description of function #2. This is corrected in the enclosed file and I have added deletion of the "Uninstall files folder".

Save the .txt file with .lua extension.
Reply With Quote
  #8  
Old 10-23-2004
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
The amendment (10/22/04)"Delete Uninstall files folder" should NOT be necessary. According to the uninstall log the last actions (AFTER On Shutdown) are:
Remove uninstall support files
Remove folder: %AppFolder%\Uninstall


The last lines in function gu_DeleteUninstaller() may be removed.

(The reason why the folder wasn't removed the other day, probably was that the folder was opened in a file manager.)
Reply With Quote
  #9  
Old 06-27-2005
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
I should like to warn you if you want to use the uploaded script (post#7). Please read the reflections in http://www.indigorose.com/forums/showthread.php?t=11634 (post#3).

SUF70 isn't capable of reading the specific REG_MULTI_SZ registry entry (due to OS restrictions I suppose). The Delete Uninstall Files can be performed in a proper way by using a "flag file".
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
project size same after deleting startup video? rdf AutoPlay Media Studio 5.0 2 10-12-2004 10:44 PM
Custom Icon for Control Panel Uninstaller? eric_darling Setup Factory 6.0 4 09-20-2004 10:58 AM
Conditional Uninstaller? Goldenhawk Setup Factory 6.0 3 05-11-2004 12:13 AM
Uninstaller keeps crashing Marker0077 Setup Factory 6.0 11 05-28-2003 10:14 AM
Uninstaller problem ETREE Setup Factory 6.0 1 12-10-2002 02:37 PM


All times are GMT -6. The time now is 03:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software