From b2e1e339c0bb01373c681b184a6839f0f2fedd86 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 13 Apr 2024 14:42:28 +0300 Subject: [PATCH] Adapt installer to new path to settings. --- dist/win/inno/valentina.iss | 38 ++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/dist/win/inno/valentina.iss b/dist/win/inno/valentina.iss index f0dcee6df..9ea481376 100644 --- a/dist/win/inno/valentina.iss +++ b/dist/win/inno/valentina.iss @@ -238,7 +238,10 @@ Source: "{#buildDirectory}\*.ini"; DestDir: "{app}"; Flags: ignoreversion [InstallDelete] Type: filesandordirs; Name: "{app}\translations" -Type: files; Name: "{autoappdata}\ValentinaTeam\*.ini"; Tasks: deletesettings +Type: files; Name: "{autodocs}\Valentina\common.ini"; Tasks: deletesettings +Type: files; Name: "{autodocs}\Valentina\Valentina.ini"; Tasks: deletesettings +Type: files; Name: "{autodocs}\Valentina\Tape.ini"; Tasks: deletesettings +Type: files; Name: "{autodocs}\Valentina\Puzzle.ini"; Tasks: deletesettings [Icons] Name: "{group}\{#MyAppName}{#MyAppStatus}"; Filename: "{app}\valentina.exe" @@ -660,14 +663,39 @@ var end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +var + CommonIniPath: string; + ValentinaIniPath: string; + TapeIniPath: string; + PuzzleIniPath: string; begin if CurUninstallStep = usPostUninstall then begin - if MsgBox(ExpandConstant('{cm:QuestionRemoveAnyExistingSettings}'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then - //this is the msg that will display after uninstall + CommonIniPath := ExpandConstant('{autodocs}\Valentina\common.ini'); + ValentinaIniPath := ExpandConstant('{autodocs}\Valentina\Valentina.ini'); + TapeIniPath := ExpandConstant('{autodocs}\Valentina\Tape.ini'); + PuzzleIniPath := ExpandConstant('{autodocs}\Valentina\Puzzle.ini'); + + if FileExists(CommonIniPath) or FileExists(ValentinaIniPath) or FileExists(TapeIniPath) or FileExists(PuzzleIniPath) then begin - DelTree(ExpandConstant('{autoappdata}\ValentinaTeam'), True, True, True); + if MsgBox(ExpandConstant('{cm:QuestionRemoveAnyExistingSettings}'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then + begin + if FileExists(CommonIniPath) then + if not DeleteFile(CommonIniPath) then + MsgBox('Failed to delete common.ini', mbError, MB_OK); + + if FileExists(ValentinaIniPath) then + if not DeleteFile(ValentinaIniPath) then + MsgBox('Failed to delete Valentina.ini', mbError, MB_OK); + + if FileExists(TapeIniPath) then + if not DeleteFile(TapeIniPath) then + MsgBox('Failed to delete Tape.ini', mbError, MB_OK); + + if FileExists(PuzzleIniPath) then + if not DeleteFile(PuzzleIniPath) then + MsgBox('Failed to delete Puzzle.ini', mbError, MB_OK); + end; end; - end; end;