Skip to content

Commit d8976f9

Browse files
authored
Merge pull request #408 from oneclick/uninst
Remove installed gems and MSYS2 from devkit by the uninstaller
2 parents 0848d9b + 94a2766 commit d8976f9

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

recipes/installer-inno/events.iss

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,23 @@ begin
99
// Run preparing steps before install of files
1010
if CurStep = ssInstall then
1111
begin
12-
if UsingWinNT then
13-
begin
14-
UnInstallOldVersion();
12+
UnInstallOldVersion();
1513

16-
Log(Format('Selected Tasks - Path: %d, Associate: %d', [PathChkBox.State, PathExtChkBox.State]));
14+
Log(Format('Selected Tasks - Path: %d, Associate: %d', [PathChkBox.State, PathExtChkBox.State]));
1715

18-
if IsModifyPath then
19-
ModifyPath([ExpandConstant('{app}') + '\bin']);
16+
if IsModifyPath then
17+
ModifyPath([ExpandConstant('{app}') + '\bin']);
2018

21-
if IsAssociated then
22-
ModifyFileExts(['.rb', '.rbw']);
19+
if IsAssociated then
20+
ModifyFileExts(['.rb', '.rbw']);
2321

2422
#ifdef HaveUtf8ChkBox
25-
if IsUtf8 then
26-
ModifyRubyopt(['-Eutf-8']);
23+
if IsUtf8 then
24+
ModifyRubyopt(['-Eutf-8']);
2725
#endif
2826

29-
if WizardIsComponentSelected('msys2') then
30-
DeleteRubyMsys2Directory();
31-
32-
end else
33-
MsgBox('Looks like you''ve got on older, unsupported Windows version.' #13 +
34-
'Proceeding with a reduced feature set installation.',
35-
mbInformation, MB_OK);
27+
if WizardIsComponentSelected('msys2') then
28+
DeleteRubyMsys2Directory();
3629
end;
3730

3831
// Final steps before installer closes
@@ -76,19 +69,31 @@ procedure CurUninstallStepChanged(const CurUninstallStep: TUninstallStep);
7669
begin
7770
if CurUninstallStep = usUninstall then
7871
begin
79-
if UsingWinNT then
80-
begin
81-
if GetPreviousData('PathModified', 'no') = 'yes' then
82-
ModifyPath([ExpandConstant('{app}') + '\bin']);
72+
if GetPreviousData('PathModified', 'no') = 'yes' then
73+
ModifyPath([ExpandConstant('{app}') + '\bin']);
8374

84-
if GetPreviousData('FilesAssociated', 'no') = 'yes' then
85-
ModifyFileExts(['.rb', '.rbw']);
75+
if GetPreviousData('FilesAssociated', 'no') = 'yes' then
76+
ModifyFileExts(['.rb', '.rbw']);
8677

8778
#ifdef HaveUtf8ChkBox
88-
if GetPreviousData('Utf8', 'no') = 'yes' then
89-
ModifyRubyopt(['-Eutf-8']);
79+
if GetPreviousData('Utf8', 'no') = 'yes' then
80+
ModifyRubyopt(['-Eutf-8']);
9081
#endif
9182

83+
{* Remove SSL junction link *}
84+
DelTree(ExpandConstant('{app}/ssl'), True, False, False);
85+
86+
if ExpandConstant('{param:allfiles|yes}') = 'yes' then
87+
begin
88+
{* Remove possible MSYS2 *}
89+
DelTree(ExpandConstant('{app}/msys32'), True, True, True);
90+
DelTree(ExpandConstant('{app}/msys64'), True, True, True);
91+
{* Remove binstubs of installed gems *}
92+
DelTree(ExpandConstant('{app}/bin/*'), False, True, False);
93+
{* Remove installed gems *}
94+
DelTree(ExpandConstant('{app}/lib/ruby/gems'), True, True, True);
95+
{* Remove config of "ridk use" *}
96+
DelTree(ExpandConstant('{app}/ridk_use/rubies.yml'), False, True, False);
9297
end;
9398
end;
9499
end;

recipes/installer-inno/util.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ begin
244244
// Previous RubyInstaller detected
245245
246246
sUnInstallString := RemoveQuotes(sUnInstallString);
247-
sUninstParams := '/NORESTART /SUPPRESSMSGBOXES';
247+
sUninstParams := '/NORESTART /SUPPRESSMSGBOXES /allfiles=no';
248248
if WizardSilent then sUninstParams := sUninstParams + ' /VERYSILENT'
249249
else sUninstParams := sUninstParams + ' /SILENT';
250250

0 commit comments

Comments
 (0)