Skip to content

Commit

Permalink
Initial installer compile script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexeh committed Mar 13, 2024
1 parent 958d4e4 commit 42498d5
Show file tree
Hide file tree
Showing 5 changed files with 349 additions and 0 deletions.
Binary file added img/logo-small.bmp
Binary file not shown.
Binary file added img/logo-thumb.bmp
Binary file not shown.
20 changes: 20 additions & 0 deletions installer/Default.isl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[LangOptions]
LanguageName=English
LanguageID=$0409
LanguageCodePage=0
DialogFontName=
DialogFontSize=8
WelcomeFontName=Verdana
WelcomeFontSize=12
TitleFontName=Arial
TitleFontSize=29
CopyrightFontName=Arial
CopyrightFontSize=8
RightToLeft=no

[Messages]
ButtonNext=&Lets go!

; *** "Welcome" wizard page
WelcomeLabel1=Thank you for choosing [name]
WelcomeLabel2=Now let's get you setup with [name/ver].%n%nPlease ensure any existing copies of [name] have been closed.
98 changes: 98 additions & 0 deletions installer/config.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[Setup]
AppName=Joystick Diagrams
AppVersion=2.0.8
AppId=JoystickDiagrams
ArchitecturesInstallIn64BitMode=x64
DefaultDirName={autopf}\Joystick Diagrams
DefaultGroupName=Joystick Diagrams
AppCopyright=Robert Cox - joystick-diagrams.com
AppSupportURL=http://www.joystick-diagrams.com
SetupIconFile=D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\img\logo.ico
DisableWelcomePage=no
WizardImageFile=D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\img\logo-small.bmp
WizardSmallImageFile=D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\img\logo-thumb.bmp
WizardImageStretch=no
WizardStyle=classic
OutputBaseFilename=Joystick Diagrams Installer
[Dirs]
Name: "{userappdata}\Joystick Diagrams"

[Files]
Source: "D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\*"; DestDir: "{app}"
Source: "D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\img\*"; DestDir: "{app}\img"
Source: "D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\lib\*"; DestDir: "{app}\lib"; Flags: recursesubdirs

#define ProcessFile(Source, FindResult, FindHandle) \
Local[0] = FindGetFileName(FindHandle), \
Local[1] = Source + "\\" + Local[0], \
Local[2] = FindNext(FindHandle), \
"'" + Local[0] + "'#13#10" + \
(Local[2] ? ProcessFile(Source, Local[2], FindHandle) : "")
#define ProcessFolder(Source) \
Local[0] = FindFirst(Source + "\\*.*", faAnyFile), \
ProcessFile(Source, Local[0], Local[0])
#define DepedenciesToInstall ProcessFolder("D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\lib")
#define DependenciesLog "{app}\dependencies.log"

Source: "D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\templates\*"; DestDir: "{app}\templates"; Flags: recursesubdirs
Source: "D:\Git Repos\joystick-diagrams\build\exe.win-amd64-3.11\theme\*"; DestDir: "{app}\theme"

[UninstallDelete]
Type: files; Name: "{#DependenciesLog}"

[Icons]
Name: "{group}\Joystick Diagrams"; Filename: "{app}\Joystick_Diagrams.exe"; IconFilename: "{app}\Joystick_Diagrams.exe"

[Languages]
Name: "en"; MessagesFile: "D:\Git Repos\joystick-diagrams\installer\Default.isl"; InfoAfterFile: "D:\Git Repos\joystick-diagrams\installer\success.rtf"

[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
AppPath, DependenciesLogPath: string;
Dependencies: TArrayOfString;
Count, I: Integer;
DependencyPath: string;
begin
DependenciesLogPath := ExpandConstant('{#DependenciesLog}');
if CurStep = ssInstall then
begin
if LoadStringsFromFile(DependenciesLogPath, Dependencies) then
begin
Count := GetArrayLength(Dependencies);
Log(Format('Loaded %d dependencies, deleting...', [Count]));
for I := 0 to Count - 1 do
if (Dependencies[I] <> '.') and (Dependencies[I] <> '..') then
begin
DependencyPath := ExpandConstant('{app}\lib\' + Dependencies[I]);
Log(Format('Deleting %s', [DependencyPath]));
if DirExists(DependencyPath) then
begin
DelTree(DependencyPath,True,True,True);
end;
if FileExists(DependencyPath) then
begin
DeleteFile(DependencyPath);
end;
end;
end;
end
else
if CurStep = ssPostInstall then
begin
// Now that the app folder already exists,
// save dependencies log (to be processed by future upgrade)
if SaveStringToFile(DependenciesLogPath, {#DepedenciesToInstall}, False) then
begin
Log('Created dependencies log');
end
else
begin
Log('Failed to create dependencies log');
end;
end;
end;
Loading

0 comments on commit 42498d5

Please sign in to comment.