Changeset 891


Ignore:
Timestamp:
04/26/09 11:44:24 (5 years ago)
Author:
lowjoel
Message:

Delete user configuration files after uninstall.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Eraser.iss

    r886 r891  
    4343 
    4444[_ISTool] 
    45 EnableISX=true: 
     45EnableISX=true 
    4646 
    4747[Files] 
     
    127127Root: HKCU; SubKey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: Eraser; ValueData: {app}\eraser.exe -hide; Flags: dontcreatekey uninsdeletevalue 
    128128 
    129 [UninstallDelete] 
    130 Name: {app}\*.*; Type: filesandordirs 
    131  
    132129[Run] 
    133130Filename: {app}\eraser.exe; WorkingDir: {app}; Flags: postinstall nowait skipifsilent; Description: Run Eraser 
     
    138135function IsWin32: Boolean; 
    139136begin 
    140   Result := not IsWin64; 
     137    Result := not IsWin64; 
    141138end; 
     139 
     140procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); 
     141var 
     142    DeletedAppData: Boolean; 
     143    DeletedRegKeys: Boolean; 
     144    EraserAppDataPath: String; 
     145    EraserRegistryPath: String; 
     146begin 
     147    if (CurUninstallStep = usUninstall) then 
     148    begin 
     149        EraserAppDataPath := ExpandConstant('{localappdata}') + '\Eraser'; 
     150        EraserRegistryPath := 'Software\Heidi Computers Ltd'; 
     151        if (MsgBox('Do you want to delete Eraser''s configuration files?' + #13#13 + 
     152            'Do not do this if you intend to reinstall Eraser.' , mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES) then 
     153        begin 
     154            DeletedAppData := (not FileExists(EraserAppDataPath)) or DelTree(EraserAppDataPath, True, True, True); 
     155            DeletedRegKeys := (not RegKeyExists(HKEY_CURRENT_USER, EraserRegistryPath)) or RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, EraserRegistryPath); 
     156            if not (DeletedAppData and DeletedRegKeys) then 
     157            begin 
     158                MsgBox('Could not delete user configuraion files and entries:' #13#13 + SysErrorMessage(DLLGetLastError), mbError, MB_OK); 
     159            end; 
     160        end; 
     161    end; 
     162end; 
Note: See TracChangeset for help on using the changeset viewer.