[Setup]
#ifdef WIN64
ArchitecturesInstallIn64BitMode=x64
#endif
AppName=TigerVNC
AppVerName=TigerVNC @VERSION@ (@BUILD@)
AppVersion=@VERSION@
AppPublisher=TigerVNC project
AppPublisherURL=https://tigervnc.org
DefaultDirName={pf}\TigerVNC
DefaultGroupName=TigerVNC
LicenseFile=@CMAKE_SOURCE_DIR@\LICENCE.TXT

[Files]
Source: "@CMAKE_BINARY_DIR@\vncviewer\vncviewer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 
Source: "@CMAKE_SOURCE_DIR@\README.rst"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\LICENCE.TXT"; DestDir: "{app}"; Flags: ignoreversion

#define LINGUAS
#define Lang
#sub AddLanguage
  #define Lang = FileRead(LINGUAS)
  Source: "@CMAKE_BINARY_DIR@\po\{#Lang}.mo"; DestDir: "{app}\locale\{#Lang}\LC_MESSAGES"; DestName: "tigervnc.mo"; Flags: ignoreversion
#endsub
#for {LINGUAS = FileOpen("@CMAKE_SOURCE_DIR@\po\LINGUAS"); !FileEof(LINGUAS); ""} AddLanguage

[Icons]
Name: "{group}\TigerVNC Viewer"; FileName: "{app}\vncviewer.exe";
Name: "{group}\Listening TigerVNC Viewer"; FileName: "{app}\vncviewer.exe"; Parameters: "-listen";

Name: "{group}\License"; FileName: "write.exe"; Parameters: "LICENCE.TXT"; WorkingDir: "{app}"; Flags: "useapppaths"
Name: "{group}\Read Me"; FileName: "write.exe"; Parameters: "README.rst"; WorkingDir: "{app}"; Flags: "useapppaths"
Name: "{group}\Uninstall TigerVNC"; FileName: "{uninstallexe}"; WorkingDir: "{app}";
