Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    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.

  2. #2
    Josué Alba Guest
    Try using a wininit.ini file. it's preatty simple

  3. #3
    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.

  4. #4
    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!?

  5. #5
    Join Date
    Jan 2000
    Posts
    2,002
    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.

  6. #6
    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.

  7. #7
    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.

  8. #8
    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.)

  9. #9
    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".

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts