Adapt installer to new path to settings.

This commit is contained in:
Roman Telezhynskyi 2024-04-13 14:42:28 +03:00
parent 0fd034c483
commit b2e1e339c0

View File

@ -238,7 +238,10 @@ Source: "{#buildDirectory}\*.ini"; DestDir: "{app}"; Flags: ignoreversion
[InstallDelete] [InstallDelete]
Type: filesandordirs; Name: "{app}\translations" 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] [Icons]
Name: "{group}\{#MyAppName}{#MyAppStatus}"; Filename: "{app}\valentina.exe" Name: "{group}\{#MyAppName}{#MyAppStatus}"; Filename: "{app}\valentina.exe"
@ -660,14 +663,39 @@ var
end; end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
CommonIniPath: string;
ValentinaIniPath: string;
TapeIniPath: string;
PuzzleIniPath: string;
begin begin
if CurUninstallStep = usPostUninstall then if CurUninstallStep = usPostUninstall then
begin begin
if MsgBox(ExpandConstant('{cm:QuestionRemoveAnyExistingSettings}'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then CommonIniPath := ExpandConstant('{autodocs}\Valentina\common.ini');
//this is the msg that will display after uninstall 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 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;
end; end;