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

;#define MinGW
#define MSVC
#define MyAppName "Cute Chess"
;#define MyAppVersion "1.2.0"
#define MyAppExeName "cutechess.exe"
;#define MinGWLibPath "C:\QtSDK\mingw\bin"
;#define MSVCPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
;#define QtLibPath "C:\Qt\5.7\msvc2015_64"
;#define CuteChessPath "C:\cutechess"

[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={{7E0A39B7-4347-4A27-86CF-20E521C86E7C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher=Cute Chess authors
AppPublisherURL=https://github.com/cutechess/cutechess
AppSupportURL=https://github.com/cutechess/cutechess
AppUpdatesURL=https://github.com/cutechess/cutechess
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
PrivilegesRequiredOverridesAllowed=dialog
AllowNoIcons=yes
OutputDir=.
OutputBaseFilename=cutechess-{#MyAppVersion}-win64
SolidCompression=yes
WizardStyle=modern

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

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

[Files]
Source: "{#CuteChessPath}\build\Release\cutechess.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CuteChessPath}\build\Release\cutechess-cli.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "{#CuteChessPath}\translations\cutechess_zh_CN.qm"; DestDir: "{app}\translations"; Flags: ignoreversion
#ifdef MinGW
  Source: "{#MinGWLibPath}\mingwm10.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "{#MinGWLibPath}\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion
#endif
#ifdef MSVC
  Source: "{#MSVCPath}\VC\Redist\MSVC\v143\vc_redist.x64.exe"; DestDir: "{app}"; Flags: ignoreversion
#endif
Source: "{#QtLibPath}\bin\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\bin\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\bin\Qt5Svg.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\bin\Qt5PrintSupport.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\bin\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\bin\Qt5Concurrent.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtLibPath}\plugins\platforms\qwindows.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion
Source: "{#QtLibPath}\plugins\styles\qwindowsvistastyle.dll"; DestDir: "{app}\styles"; Flags: ignoreversion
Source: "{#CuteChessPath}\COPYING"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CuteChessPath}\docs\cutechess-cli.6.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CuteChessPath}\docs\cutechess-cli.6.html"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CuteChessPath}\docs\cutechess-engines.json.5.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CuteChessPath}\docs\cutechess-engines.json.5.html"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: Installing Microsoft C and C++ (MSVC) runtime libraries...
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

