Skip to content

Commit 49480d3

Browse files
committed
feat: add Inno Setup configuration and build script to package the application as an installer
1 parent b616877 commit 49480d3

4 files changed

Lines changed: 169 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
## [1.5.9]
66
- **Library**: Improved tree line color assignment — no parent-child or sibling conflicts.
7+
- **Build**: Added Inno Setup configuration and batch compilation script to package the application as a setup.exe installer.
78

89
## [1.5.8]
910
- **Library**: Fixed folder sorting to use natural order (`1, 2, 3... 9, 10, 11` instead of `1, 10, 11, 2`).

_build_/__build_installer.bat

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@echo off
2+
setlocal ENABLEDELAYEDEXPANSION
3+
cd /d "%~dp0"
4+
5+
echo ==================================================
6+
echo SPVideoCoursesPlayer - BUILD INSTALLER
7+
echo ==================================================
8+
9+
set "DIST_DIR=dist\SP Video Courses Player"
10+
set "VERSION_FILE=dist\SP Video Courses Player\_internal\resources\version.txt"
11+
if not exist "%VERSION_FILE%" set "VERSION_FILE=..\resources\version.txt"
12+
set "SPEC_FILE=installer.iss"
13+
set "INNO_EXE=C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
14+
15+
REM --- Check dist folder exists ---
16+
if not exist "!DIST_DIR!" (
17+
echo [ERROR] Distribution directory not found: !DIST_DIR!
18+
echo Run __build.bat first to build the application.
19+
pause
20+
exit /b 1
21+
)
22+
23+
REM --- Check installer.iss exists ---
24+
if not exist "!SPEC_FILE!" (
25+
echo [ERROR] Inno Setup script not found: !SPEC_FILE!
26+
echo Create installer.iss first.
27+
pause
28+
exit /b 1
29+
)
30+
31+
REM --- Check Inno Setup is installed ---
32+
if not exist "!INNO_EXE!" (
33+
echo [ERROR] Inno Setup not found at: !INNO_EXE!
34+
echo Download from: https://jrsoftware.org/isinfo.php
35+
pause
36+
exit /b 1
37+
)
38+
39+
REM --- Get version from version.txt ---
40+
if exist "%VERSION_FILE%" (
41+
for /f "usebackq tokens=*" %%i in ("%VERSION_FILE%") do set "VERSION=%%i"
42+
) else (
43+
set "VERSION=unknown"
44+
)
45+
46+
echo.
47+
echo Version : !VERSION!
48+
echo Source : !DIST_DIR!
49+
echo Script : !SPEC_FILE!
50+
echo.
51+
52+
REM --- Run Inno Setup compiler ---
53+
echo Compiling installer...
54+
echo.
55+
"!INNO_EXE!" "!SPEC_FILE!" /DAppVersion=!VERSION! /O.
56+
57+
if errorlevel 1 (
58+
echo.
59+
echo [ERROR] Inno Setup compilation failed.
60+
pause
61+
exit /b 1
62+
)
63+
64+
echo.
65+
echo ==========================================
66+
echo INSTALLER CREATED SUCCESSFULLY
67+
echo Version: !VERSION!
68+
echo ==========================================
69+
echo.
70+
71+
REM --- Open output folder ---
72+
explorer .

_build_/installer.iss

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
; ============================================================
2+
; Inno Setup Script — SPVideoCoursesPlayer
3+
; ============================================================
4+
5+
#define AppName "SP Video Courses Player"
6+
#ifndef AppVersion
7+
#define AppVersion "1.0.0" ; This will be overridden by the command line (/DAppVersion=X.X.X)
8+
#endif
9+
#define AppPublisher "SPluzh"
10+
#define AppExeName "SP Video Courses Player.exe"
11+
#define SourceDir "dist\SP Video Courses Player"
12+
13+
[Setup]
14+
; -- Application Metadata --
15+
AppName={#AppName}
16+
AppVersion={#AppVersion}
17+
AppPublisher={#AppPublisher}
18+
AppId={{D1A2E3C4-F5B6-4A7B-8C9D-0E1F2A3B4C5D}
19+
VersionInfoVersion={#AppVersion}
20+
VersionInfoDescription={#AppName} Setup
21+
22+
; -- Installation Directory --
23+
DefaultDirName={autopf}\{#AppName}
24+
DefaultGroupName={#AppName}
25+
DisableProgramGroupPage=yes
26+
AllowNoIcons=yes
27+
28+
; -- Output Directory and Filename --
29+
OutputDir=.
30+
OutputBaseFilename=SP_Video_Courses_Player_Setup_v{#AppVersion}
31+
32+
; -- Compression Settings --
33+
Compression=lzma2/ultra64
34+
SolidCompression=yes
35+
InternalCompressLevel=ultra64
36+
37+
; -- Installation Privilege Level --
38+
; lowest: User-level installation (does not require administrator rights)
39+
PrivilegesRequired=lowest
40+
PrivilegesRequiredOverridesAllowed=dialog
41+
42+
; -- Architecture Support --
43+
ArchitecturesInstallIn64BitMode=x64compatible
44+
45+
; -- Modern Wizard Style --
46+
WizardStyle=modern
47+
48+
[Languages]
49+
Name: "english"; MessagesFile: "compiler:Default.isl"
50+
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
51+
Name: "arabic"; MessagesFile: "compiler:Languages\Arabic.isl"
52+
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
53+
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
54+
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
55+
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
56+
Name: "korean"; MessagesFile: "compiler:Languages\Korean.isl"
57+
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
58+
Name: "thai"; MessagesFile: "compiler:Languages\Thai.isl"
59+
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
60+
61+
[Tasks]
62+
; -- Desktop Shortcut Task --
63+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
64+
65+
; -- Start Menu Shortcut Task --
66+
Name: "startmenuicon"; Description: "{cm:CreateStartMenuIcon}"; GroupDescription: "{cm:AdditionalIcons}"
67+
68+
[Files]
69+
; -- Main Application Directory and Internal Dependencies --
70+
; We exclude settings.ini, internal executable files, and data directories just like in the zip release.
71+
Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "settings.ini,data,data\*,_internal\data,_internal\data\*"
72+
73+
[Icons]
74+
; -- Start Menu Shortcuts --
75+
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: startmenuicon
76+
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"; Tasks: startmenuicon
77+
78+
; -- Desktop Shortcut --
79+
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
80+
81+
[Run]
82+
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#AppName}}"; Flags: nowait postinstall skipifsilent
83+
84+
[CustomMessages]
85+
english.CreateStartMenuIcon=Create a Start Menu shortcut
86+
russian.CreateStartMenuIcon=Создать ярлык в меню Пуск
87+
arabic.CreateStartMenuIcon=إنشاء اختصار في قائمة ابدأ
88+
german.CreateStartMenuIcon=Verknüpfung im Startmenü erstellen
89+
spanish.CreateStartMenuIcon=Crear un acceso directo en el menú Inicio
90+
french.CreateStartMenuIcon=Créer un raccourci dans le menu Démarrer
91+
japanese.CreateStartMenuIcon=スタートメニューにショートカットを作成する
92+
korean.CreateStartMenuIcon=시작 메뉴에 바로 가기 만들기
93+
portuguese.CreateStartMenuIcon=Criar um atalho no menu Iniciar
94+
thai.CreateStartMenuIcon=สร้างทางลัดในเมนูเริ่ม
95+
turkish.CreateStartMenuIcon=Başlat menüsünde bir kısayol oluştur

resources/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.8
1+
1.5.9

0 commit comments

Comments
 (0)