Skip to content

Commit 78137b3

Browse files
committed
Prompt user to delete settings folder after uninstaller closes
Moved settings deletion prompt to post-uninstall phase using DeinitializeUninstall, to ensure it appears after the uninstaller window closes.
1 parent b22d069 commit 78137b3

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

albayan.iss

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
AppName={#MyAppName}
1010
AppId={{5BDDE425-E22F-4A82-AF2F-72AF71301D3F}
1111
AppVersion={#AppVersion}
12-
;AppVersion={#MyAppVersion}
1312
VersionInfoDescription=Albayan كل ما يخص الإسلام.
1413
AppPublisher=tecwindow
1514
VersionInfoVersion={#MyAppVersion}
@@ -21,11 +20,12 @@ VersionInfoOriginalFileName=Albayan_Setup.exe
2120
AppPublisherURL={#MyAppURL}
2221
AppSupportURL={#MyAppURL}
2322
AppUpdatesURL={#MyAppURL}
23+
ArchitecturesAllowed=x64compatible arm64
24+
ArchitecturesInstallIn64BitMode=x64compatible arm64
2425
SetupIconFile=Albayan.ico
2526

2627
DefaultDirName={sd}\program files\tecwindow\{#MyAppName}
2728
DisableProgramGroupPage=yes
28-
; Uncomment the following line to run in non-administrative install mode (install for the current user only.)
2929
PrivilegesRequired=admin
3030
OutputDir=albayan_build
3131
OutputBaseFilename=AlbayanSetup
@@ -36,8 +36,6 @@ SolidCompression=yes
3636
WizardStyle=modern
3737
DisableWelcomePage=no
3838
MinVersion=0,6.2
39-
ArchitecturesAllowed=x64compatible arm64
40-
ArchitecturesInstallIn64BitMode=x64compatible arm64
4139

4240
[Languages]
4341
Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -83,42 +81,34 @@ Type: filesandordirs; Name: "{app}\*"
8381
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall
8482

8583
[Code]
84+
procedure DeleteSettingsFolder();
85+
begin
86+
DelTree(ExpandConstant('{userappdata}\tecwindow\albayan'), True, True, True);
87+
end;
88+
8689
function InitializeSetup(): Boolean;
8790
begin
8891
Result := True;
8992
end;
9093
91-
9294
procedure CurStepChanged(CurStep: TSetupStep);
9395
begin
9496
if CurStep = ssInstall then
9597
begin
9698
if FileExists(ExpandConstant('{userappdata}\tecwindow\{#MyAppName}\Settingss.ini')) then
97-
begin
98-
RenameFile(ExpandConstant('{userappdata}\tecwindow\{#MyAppName}\Settingss.ini'), ExpandConstant('{userappdata}\tecwindow\{#MyAppName}\config.ini'));
99-
end;
100-
99+
begin
100+
RenameFile(ExpandConstant('{userappdata}\tecwindow\{#MyAppName}\Settingss.ini'),
101+
ExpandConstant('{userappdata}\tecwindow\{#MyAppName}\config.ini'));
102+
end;
101103
end;
102104
end;
103105
104-
procedure DeleteSettingsFolder();
105-
begin
106-
DelTree(ExpandConstant('{userappdata}\tecwindow\albayan'), True, True, True);
107-
end;
108-
109-
function AskDeleteSettingsFolder(): Boolean;
106+
procedure DeinitializeUninstall();
110107
begin
111-
Result := MsgBox(ExpandConstant('{cm:DeleteSettingsPrompt}') + #13#10 + ExpandConstant('{userappdata}\tecwindow\albayan'), mbConfirmation, MB_YESNO) = IDYES;
112-
end;
113-
114-
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
115-
begin
116-
if CurUninstallStep = usUninstall then
108+
if MsgBox(ExpandConstant('{cm:DeleteSettingsPrompt}') + #13#10 +
109+
ExpandConstant('{userappdata}\tecwindow\albayan'),
110+
mbConfirmation, MB_YESNO) = IDYES then
117111
begin
118-
if AskDeleteSettingsFolder() then
119-
begin
120-
DeleteSettingsFolder();
121-
end;
112+
DeleteSettingsFolder();
122113
end;
123114
end;
124-

0 commit comments

Comments
 (0)