Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove installed gems and MSYS2 from devkit by the uninstaller #408

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 30 additions & 25 deletions recipes/installer-inno/events.iss
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,23 @@ begin
// Run preparing steps before install of files
if CurStep = ssInstall then
begin
if UsingWinNT then
begin
UnInstallOldVersion();
UnInstallOldVersion();

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

if IsModifyPath then
ModifyPath([ExpandConstant('{app}') + '\bin']);
if IsModifyPath then
ModifyPath([ExpandConstant('{app}') + '\bin']);

if IsAssociated then
ModifyFileExts(['.rb', '.rbw']);
if IsAssociated then
ModifyFileExts(['.rb', '.rbw']);

#ifdef HaveUtf8ChkBox
if IsUtf8 then
ModifyRubyopt(['-Eutf-8']);
if IsUtf8 then
ModifyRubyopt(['-Eutf-8']);
#endif

if WizardIsComponentSelected('msys2') then
DeleteRubyMsys2Directory();

end else
MsgBox('Looks like you''ve got on older, unsupported Windows version.' #13 +
'Proceeding with a reduced feature set installation.',
mbInformation, MB_OK);
if WizardIsComponentSelected('msys2') then
DeleteRubyMsys2Directory();
end;

// Final steps before installer closes
Expand Down Expand Up @@ -76,19 +69,31 @@ procedure CurUninstallStepChanged(const CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
if UsingWinNT then
begin
if GetPreviousData('PathModified', 'no') = 'yes' then
ModifyPath([ExpandConstant('{app}') + '\bin']);
if GetPreviousData('PathModified', 'no') = 'yes' then
ModifyPath([ExpandConstant('{app}') + '\bin']);

if GetPreviousData('FilesAssociated', 'no') = 'yes' then
ModifyFileExts(['.rb', '.rbw']);
if GetPreviousData('FilesAssociated', 'no') = 'yes' then
ModifyFileExts(['.rb', '.rbw']);

#ifdef HaveUtf8ChkBox
if GetPreviousData('Utf8', 'no') = 'yes' then
ModifyRubyopt(['-Eutf-8']);
if GetPreviousData('Utf8', 'no') = 'yes' then
ModifyRubyopt(['-Eutf-8']);
#endif

{* Remove SSL junction link *}
DelTree(ExpandConstant('{app}/ssl'), True, False, False);

if ExpandConstant('{param:allfiles|yes}') = 'yes' then
begin
{* Remove possible MSYS2 *}
DelTree(ExpandConstant('{app}/msys32'), True, True, True);
DelTree(ExpandConstant('{app}/msys64'), True, True, True);
{* Remove binstubs of installed gems *}
DelTree(ExpandConstant('{app}/bin/*'), False, True, False);
{* Remove installed gems *}
DelTree(ExpandConstant('{app}/lib/ruby/gems'), True, True, True);
{* Remove config of "ridk use" *}
DelTree(ExpandConstant('{app}/ridk_use/rubies.yml'), False, True, False);
end;
end;
end;
2 changes: 1 addition & 1 deletion recipes/installer-inno/util.iss
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ begin
// Previous RubyInstaller detected

sUnInstallString := RemoveQuotes(sUnInstallString);
sUninstParams := '/NORESTART /SUPPRESSMSGBOXES';
sUninstParams := '/NORESTART /SUPPRESSMSGBOXES /allfiles=no';
if WizardSilent then sUninstParams := sUninstParams + ' /VERYSILENT'
else sUninstParams := sUninstParams + ' /SILENT';

Expand Down
Loading