Skip to content

Commit

Permalink
Merge pull request uniconproject#474 from Jafaral/win-iss-fix
Browse files Browse the repository at this point in the history
config: fix windows installer
  • Loading branch information
Don-Ward authored Sep 15, 2024
2 parents 3123b52 + 7e15ded commit 998fba2
Showing 1 changed file with 89 additions and 89 deletions.
178 changes: 89 additions & 89 deletions config/win32/gcc/unicon.iss
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,20 @@ Source: "uni\3d\viewer\Makefile"; DestDir: "{app}\uni\3d\viewer"; Flags: ignorev
Source: "uni\3d\models\*.*"; DestDir: "{app}\uni\3d\models"; Flags: ignoreversion

; tests
Source: "tests\Makefile"; DestDir: "{app}\tests"; Flags: ignoreversion
Source: "tests\Makefile.test"; DestDir: "{app}\tests"; Flags: ignoreversion
Source: "tests\Makefile"; DestDir: "{app}\tests"; Flags: ignoreversion
Source: "tests\Makefile.test"; DestDir: "{app}\tests"; Flags: ignoreversion

; general tests
Source: "tests\general\*.icn"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\foo.baz"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\stand\*.std"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\README"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\Makefile"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\*.icn"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\foo.baz"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\stand\*.std"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\README"; DestDir: "{app}\tests\general"; Flags: ignoreversion
Source: "tests\general\Makefile"; DestDir: "{app}\tests\general"; Flags: ignoreversion

; posix tests
Source: "tests\posix\*.icn"; DestDir: "{app}\tests\posix"; Flags: ignoreversion
Source: "tests\posix\stand\*.std"; DestDir: "{app}\tests\posix"; Flags: ignoreversion
Source: "tests\posix\Makefile"; DestDir: "{app}\tests\posix"; Flags: ignoreversion
Source: "tests\posix\*.icn"; DestDir: "{app}\tests\posix"; Flags: ignoreversion
Source: "tests\posix\stand\*.std"; DestDir: "{app}\tests\posix"; Flags: ignoreversion
Source: "tests\posix\Makefile"; DestDir: "{app}\tests\posix"; Flags: ignoreversion


; Thread tests
Expand All @@ -213,7 +213,7 @@ Source: "tests\thread\Makefile"; DestDir: "{app}\tests\thread"; Flags: ignorever

; Bench
Source: "tests\bench\*.icn"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Source: "tests\bench\*.dat"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Source: "tests\bench\*.data"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Source: "tests\bench\*.c"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Source: "tests\bench\*.test"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Source: "tests\bench\README"; DestDir: "{app}\tests\bench"; Flags: ignoreversion
Expand Down Expand Up @@ -323,82 +323,82 @@ begin
Result := 0;
end;
function PostInstall( ): Integer;
var
FindRec: TFindRec;
iconx: string;
begin
// initialize result to 0 processed files
Result := 0;
// expand the path to patchstr
// check if the patchstr exists; if not then exit...
if not FileExists(ExpandConstant('{app}\bin\patchstr.exe')) then
begin
MsgBox('patchstr.exe not found!' + #13#10, mbError, MB_OK);
Exit;
end;
// if we've found a *.exed file in the specified folder, then...
if FindFirst(ExpandConstant('{app}\bin\*.exe'), FindRec) then
try
// repeat loop for every *.exe file in the specified folder
repeat
// if the iterated item is not a directory named like Dir.exe
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
begin
if (FindRec.Name = 'icont.exe') or (FindRec.Name = 'wicont.exe') then
begin
if FindRec.Name = 'icont.exe' then
iconx := 'iconx.exe'
else
iconx := 'wiconx.exe';
Result := Result + PatchExe(' -DPatchStringHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}\bin\'+ iconx));
Result := Result + PatchExe(' -DPatchUnirotHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}'));
end
else
if FindRec.Name <> 'patchstr.exe' then
begin
Result := Result + PatchExe(' -DPatchStringHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}\bin\'));
Result := Result + PatchExe(' -DPatchUnirotHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}'));
end
end;
until
// when there no next file item, the loop ends
not FindNext(FindRec);
finally
// release the allocated search resources
FindClose(FindRec);
end;
end;
//show a "marquee" (= infinite) progress bar
procedure SetMarqueeProgress(Marquee: Boolean);
begin
if Marquee then
begin
WizardForm.ProgressGauge.Style := npbstMarquee;
end
else
begin
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
SetMarqueeProgress(True)
PostInstall();
SetMarqueeProgress(False)
end;
function PostInstall( ): Integer;
var
FindRec: TFindRec;
iconx: string;
begin
// initialize result to 0 processed files
Result := 0;
// expand the path to patchstr
// check if the patchstr exists; if not then exit...
if not FileExists(ExpandConstant('{app}\bin\patchstr.exe')) then
begin
MsgBox('patchstr.exe not found!' + #13#10, mbError, MB_OK);
Exit;
end;
// if we've found a *.exed file in the specified folder, then...
if FindFirst(ExpandConstant('{app}\bin\*.exe'), FindRec) then
try
// repeat loop for every *.exe file in the specified folder
repeat
// if the iterated item is not a directory named like Dir.exe
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
begin
if (FindRec.Name = 'icont.exe') or (FindRec.Name = 'wicont.exe') then
begin
if FindRec.Name = 'icont.exe' then
iconx := 'iconx.exe'
else
iconx := 'wiconx.exe';
Result := Result + PatchExe(' -DPatchStringHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}\bin\'+ iconx));
Result := Result + PatchExe(' -DPatchUnirotHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}'));
end
else
if FindRec.Name <> 'patchstr.exe' then
begin
Result := Result + PatchExe(' -DPatchStringHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}\bin\'));
Result := Result + PatchExe(' -DPatchUnirotHere ' + FindRec.Name + ' ' +
ExpandConstant('{app}'));
end
end;
until
// when there no next file item, the loop ends
not FindNext(FindRec);
finally
// release the allocated search resources
FindClose(FindRec);
end;
end;
//show a "marquee" (= infinite) progress bar
procedure SetMarqueeProgress(Marquee: Boolean);
begin
if Marquee then
begin
WizardForm.ProgressGauge.Style := npbstMarquee;
end
else
begin
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
Log('Post install');
SetMarqueeProgress(True)
PostInstall();
SetMarqueeProgress(False)
end;
end;

0 comments on commit 998fba2

Please sign in to comment.