; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Non-commercial use only

; Preprocessor variables - must be provided via command line with /D
#ifndef Version
  #error "Version must be defined. Use /DVersion=x.y.z when invoking ISCC."
#endif
#ifndef SourceDir
  #define SourceDir "."
#endif
#define BundleName "USDB_Syncer-" + Version + "-Windows-install"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{1432AE50-D2C8-412A-A9C5-CE8E8907C4C2}
AppName=USDB Syncer
AppVersion={#Version}
;AppVerName=USDB Syncer {#Version}
AppPublisher=The USDB Syncer Developers
AppPublisherURL=https://github.com/bohning/usdb_syncer
AppSupportURL=https://github.com/bohning/usdb_syncer
AppUpdatesURL=https://github.com/bohning/usdb_syncer/releases
DefaultDirName={autopf}\usdb_syncer
UninstallDisplayIcon={app}\{#BundleName}.exe
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
; on anything but x64 and Windows 11 on Arm.
ArchitecturesAllowed=x64compatible
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
; meaning it should use the native 64-bit Program Files directory and
; the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64compatible
DisableProgramGroupPage=yes
LicenseFile={#SourceDir}\LICENSE
InfoBeforeFile={#SourceDir}\NOTICE.txt
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputBaseFilename=USDB_Syncer-{#Version}-Windows-Setup
SolidCompression=yes
WizardStyle=modern dynamic

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "{#SourceDir}\dist\{#BundleName}\{#BundleName}.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#SourceDir}\dist\{#BundleName}\_internal\*"; DestDir: "{app}\_internal"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#SourceDir}\licenses\*"; DestDir: "{app}\licenses"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\USDB Syncer"; Filename: "{app}\{#BundleName}.exe"
Name: "{autodesktop}\USDB Syncer"; Filename: "{app}\{#BundleName}.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\{#BundleName}.exe"; Description: "{cm:LaunchProgram,USDB Syncer}"; Flags: nowait postinstall skipifsilent

[InstallDelete]
Type: filesandordirs; Name: "{app}\_internal"
Type: files; Name: "{app}\USDB_Syncer-*-Windows-install.exe"
