Skip to content

Commit 9f1f477

Browse files
committed
fix(windows): simplify Inno error messages
1 parent 1e2e3d3 commit 9f1f477

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

windows/installer/codex-dream-skin.iss

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,8 @@ end;
110110
111111
function InstallInitializationFailureMessage(const ExitCode: Integer): String;
112112
begin
113-
Result := Format(
114-
'Codex Dream Skin could not be initialized (exit code %d). ' +
115-
'No installed application files were changed.',
116-
[ExitCode]
117-
);
113+
Result := 'Codex Dream Skin could not be initialized (exit code ' +
114+
IntToStr(ExitCode) + '). No installed application files were changed.';
118115
end;
119116
120117
procedure CurStepChanged(CurStep: TSetupStep);
@@ -145,8 +142,8 @@ begin
145142
if not RunBootstrap(ExpandConstant('{app}\setup-bootstrap.ps1'), '-Uninstall', True, ExitCode) then
146143
RaiseException('Codex Dream Skin restoration could not be started. No installed files were removed.');
147144
if ExitCode <> 0 then
148-
RaiseException(Format(
149-
'Codex Dream Skin could not restore Codex (exit code %d). No installed files were removed.',
150-
[ExitCode]
151-
));
145+
RaiseException(
146+
'Codex Dream Skin could not restore Codex (exit code ' +
147+
IntToStr(ExitCode) + '). No installed files were removed.'
148+
);
152149
end;

windows/tests/installer-static.tests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ foreach ($requiredDefinition in @(
7070
'procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);',
7171
'if CurUninstallStep <> usUninstall then',
7272
"RunBootstrap(ExpandConstant('{app}\setup-bootstrap.ps1'), '-Uninstall', True, ExitCode)",
73-
'RaiseException(Format('
73+
"'Codex Dream Skin could not restore Codex (exit code ' +",
74+
"IntToStr(ExitCode) + '). No installed files were removed.'"
7475
)) {
7576
if (-not $definition.Contains($requiredDefinition)) {
7677
throw "Inno Setup definition is missing a release safety contract: $requiredDefinition"
@@ -85,7 +86,10 @@ $runBootstrapIndex = $definition.IndexOf(
8586
"RunBootstrap(ExpandConstant('{app}\setup-bootstrap.ps1'), '-Uninstall', True, ExitCode)",
8687
[System.StringComparison]::Ordinal
8788
)
88-
$uninstallFailureIndex = $definition.LastIndexOf('RaiseException(Format(', [System.StringComparison]::Ordinal)
89+
$uninstallFailureIndex = $definition.LastIndexOf(
90+
"'Codex Dream Skin could not restore Codex (exit code ' +",
91+
[System.StringComparison]::Ordinal
92+
)
8993
if ($uninstallStepIndex -lt 0 -or $runBootstrapIndex -le $uninstallStepIndex -or
9094
$uninstallFailureIndex -le $runBootstrapIndex -or
9195
$definition.Contains('function InitializeUninstall(): Boolean;')) {

0 commit comments

Comments
 (0)