[Setup]
AppName=@CMAKE_PROJECT_NAME@

; Set version number below
#define version "@PROJECT_VERSION@-@GIT_RECORD_IDENTIFIER@"
AppVersion={#version}

#define buildtype "@CMAKE_BUILD_TYPE@"

#define arch "ucrt64"
#define platform "win10"
#define buildsystem "MSYS"

#define homeDir "C:/msys64/home/polipo"

;;;;; Oddly enough the syntax below does not work
;;;;; #define sourceDir "{#homeDir}/devel/@LOWCASE_PROJECT_NAME_NO_VER@/development"
#define sourceDir homeDir + "/devel/@LOWCASE_PROJECT_NAME_NO_VER@/development"

#define buildDir homeDir + "/devel/@LOWCASE_PROJECT_NAME_NO_VER@/build-area/win10"

;;;;; When a documentation set (PDF, HTML) has been successfully built, that set
;;;;; is copied to this directory for winpackage target consumption.
;;;;; On the MS Windows Virtualbox image, W:
;;;;; is the host system's /home/rusconi/devel/msxpertsuite-store
;;;;; read/write directory.
#define localDocStore "W:/docs/@LOWCASE_PROJECT_NAME_NO_VER@"

#define dllSetForPackagesDir homeDir + "/devel/dll-set-for-packages"


; Set version number below
AppVerName=@CMAKE_PROJECT_NAME@ version {#version}
DefaultDirName={commonpf}\@CMAKE_PROJECT_NAME@
DefaultGroupName=@CMAKE_PROJECT_NAME@
OutputDir="{#sourceDir}\winInstaller"

OutputBaseFilename=@CMAKE_PROJECT_NAME@-{#platform}-{#buildsystem}-{#arch}-v{#version}-{#buildtype}-setup

OutputManifestFile=@CMAKE_PROJECT_NAME@-{#platform}-{#buildsystem}-{#arch}-v{#version}-{#buildtype}-setup-manifest.txt
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64

LicenseFile="{#sourceDir}\LICENSE"
AppCopyright="Copyright (C) 2016-2025 Filippo Rusconi"

SetupIconFile={#sourceDir}/images/icons/@CMAKE_PROJECT_NAME@.ico

AllowNoIcons=yes
AlwaysShowComponentsList=yes
AllowRootDirectory=no
AllowCancelDuringInstall=yes
AppComments="@CMAKE_PROJECT_NAME@, by Filippo Rusconi"
AppContact="Filippo Rusconi, PhD, Research scientist at CNRS, France"
CloseApplications=yes
CreateUninstallRegKey=yes
DirExistsWarning=yes
WindowResizable=yes
WizardImageFile="{#sourceDir}\images\splashscreen.png"
WizardImageStretch=yes

[Dirs]
Name: "{app}\doc"

[Files]
Source: "{#dllSetForPackagesDir}/*"; DestDir: {app}; Flags: ignoreversion recursesubdirs;

Source: "{#sourceDir}/doc/history.html"; DestDir: {app}\doc;

Source: "{#buildDir}/src/@CMAKE_PROJECT_NAME@.exe"; DestDir: {app};

;; The icon (multi-resolution icon file)
Source: {#sourceDir}/images/icons/@CMAKE_PROJECT_NAME@.ico; DestDir: {app}

Source: "{#localDocStore}/@CMAKE_PROJECT_NAME@-doc.pdf"; DestDir: {app}\doc;
Source: "{#localDocStore}/html/user-manual/*"; Flags: recursesubdirs; DestDir: {app}\doc\html;

[Icons]
Name: "{group}\@CMAKE_PROJECT_NAME@"; Filename: "{app}\@CMAKE_PROJECT_NAME@.exe"; WorkingDir: "{app}"
Name: "{group}\Uninstall @CMAKE_PROJECT_NAME@"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\@CMAKE_PROJECT_NAME@.exe"; Description: "Launch @CMAKE_PROJECT_NAME@"; Flags: postinstall nowait unchecked
