Update Qt for Windows

Update Qt for Windows

#define MainApp '../../build/Track-o-Bot.exe'
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(MainApp, Major, Minor, Rev, Build)
#define Version Str(Major)+"."+Str(Minor)+"."+Str(Rev)

[Setup]
AppName=Track-o-Bot
AppVersion={#Version}
AppPublisher=spidy.ch
AppPublisherURL=http://spidy.ch
DefaultDirName={pf}\Track-o-Bot
DefaultGroupName=Track-o-Bot
UninstallDisplayIcon={app}\Track-o-Bot.exe
OutputBaseFilename=Track-o-Bot_{#Version}

[InstallDelete]
Type: Files; Name: "{app}/msvcp100.dll"
Type: Files; Name: "{app}/msvcr100.dll"
Type: Files; Name: "{app}/QtCore4.dll"
Type: Files; Name: "{app}/QtGui4.dll"
Type: Files; Name: "{app}/QtNetwork4.dll"
Type: Files; Name: "{app}/QtSvg4.dll"
Type: Files; Name: "{app}/imageformats/qgif4.dll"
Type: Files; Name: "{app}/imageformats/qico4.dll"
Type: Files; Name: "{app}/imageformats/qjpeg4.dll"
Type: Files; Name: "{app}/imageformats/qmng4.dll"
Type: Files; Name: "{app}/imageformats/qsvg4.dll"
Type: Files; Name: "{app}/imageformats/qtga4.dll"
Type: Files; Name: "{app}/imageformats/qtiff4.dll"

[Files]
Source: "../../build/Track-o-Bot.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "../../../WinSparkle/Release/WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion

; Required for QtNetworkManager to work with HTTPS
Source: "../../../OpenSSL-Win32/bin/libeay32.dll"; DestDir: "{app}"
Source: "../../../OpenSSL-Win32/bin/ssleay32.dll"; DestDir: "{app}"

; Qt
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/bin/Qt5Core.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/bin/Qt5Widgets.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/bin/Qt5WinExtras.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/bin/Qt5Gui.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/bin/Qt5Network.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/*.dll"; Excludes: "*d.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/Qt5.5.1/5.5/msvc2012/plugins/platforms/*.dll"; Excludes: "*d.dll"; DestDir: "{app}/platforms"

; C/C++ Runtime
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 11.0/VC/redist/x86/Microsoft.VC110.CRT/msvcp110.dll"; DestDir: "{app}"
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 11.0/VC/redist/x86/Microsoft.VC110.CRT/msvcr110.dll"; DestDir: "{app}"

[Run]
Filename: "{app}\Track-o-Bot.exe"; Description: "Launch Track-o-Bot"; Flags: postinstall nowait

[Icons]
Name: "{group}\Track-o-Bot"; Filename: "{app}\Track-o-Bot.exe"

; This is temporary workaround for people upgrading from 0.6.0
; 0.6.0 is affected by QTBUG-35986
; This code can be removed once 0.6.0 is outdated
[Code]
function InitializeSetup(): Boolean;
	var ErrorCode: Integer;
begin
	ShellExec('open', 'taskkill.exe', '/f /im Track-o-Bot.exe', '', SW_HIDE, ewNoWait, ErrorCode);
	result := True;
end;

function InitializeUninstall(): Boolean;
	var ErrorCode: Integer;
begin
	ShellExec('open', 'taskkill.exe', '/f /im Track-o-Bot.exe', '', SW_HIDE, ewNoWait, ErrorCode);
	result := True;
end;

#define MainApp '../../build/Track-o-Bot.exe'
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(MainApp, Major, Minor, Rev, Build)
#define Version Str(Major)+"."+Str(Minor)+"."+Str(Rev)

[Setup]
AppName=Track-o-Bot
AppVersion={#Version}
AppPublisher=spidy.ch
AppPublisherURL=http://spidy.ch
DefaultDirName={pf}\Track-o-Bot
DefaultGroupName=Track-o-Bot
UninstallDisplayIcon={app}\Track-o-Bot.exe
OutputBaseFilename=Track-o-Bot_{#Version}

[InstallDelete]
Type: Files; Name: "{app}/msvcp100.dll"
Type: Files; Name: "{app}/msvcr100.dll"
Type: Files; Name: "{app}/QtCore4.dll"
Type: Files; Name: "{app}/QtGui4.dll"
Type: Files; Name: "{app}/QtNetwork4.dll"
Type: Files; Name: "{app}/QtSvg4.dll"
Type: Files; Name: "{app}/imageformats/qgif4.dll"
Type: Files; Name: "{app}/imageformats/qico4.dll"
Type: Files; Name: "{app}/imageformats/qjpeg4.dll"
Type: Files; Name: "{app}/imageformats/qmng4.dll"
Type: Files; Name: "{app}/imageformats/qsvg4.dll"
Type: Files; Name: "{app}/imageformats/qtga4.dll"
Type: Files; Name: "{app}/imageformats/qtiff4.dll"

[Files]
Source: "../../build/Track-o-Bot.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "../../../WinSparkle/Release/WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion

; Required for QtNetworkManager to work with HTTPS
Source: "../../../OpenSSL-Win32/bin/libeay32.dll"; DestDir: "{app}"
Source: "../../../OpenSSL-Win32/bin/ssleay32.dll"; DestDir: "{app}"

; Qt
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/bin/Qt5Core.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/bin/Qt5Widgets.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/bin/Qt5WinExtras.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/bin/Qt5Gui.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/bin/Qt5Network.dll"; DestDir: "{app}"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/plugins/imageformats/*.dll"; Excludes: "*d.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/Qt5.5.0/5.5/msvc2012/plugins/platforms/*.dll"; Excludes: "*d.dll"; DestDir: "{app}/platforms"

; C/C++ Runtime
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 11.0/VC/redist/x86/Microsoft.VC110.CRT/msvcp110.dll"; DestDir: "{app}"
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 11.0/VC/redist/x86/Microsoft.VC110.CRT/msvcr110.dll"; DestDir: "{app}"

[Run]
Filename: "{app}\Track-o-Bot.exe"; Description: "Launch Track-o-Bot"; Flags: postinstall nowait

[Icons]
Name: "{group}\Track-o-Bot"; Filename: "{app}\Track-o-Bot.exe"

; This is temporary workaround for people upgrading from 0.6.0
; 0.6.0 is affected by QTBUG-35986
; This code can be removed once 0.6.0 is outdated
[Code]
function InitializeSetup(): Boolean;
	var ErrorCode: Integer;
begin
	ShellExec('open', 'taskkill.exe', '/f /im Track-o-Bot.exe', '', SW_HIDE, ewNoWait, ErrorCode);
	result := True;
end;

function InitializeUninstall(): Boolean;
	var ErrorCode: Integer;
begin
	ShellExec('open', 'taskkill.exe', '/f /im Track-o-Bot.exe', '', SW_HIDE, ewNoWait, ErrorCode);
	result := True;
end;


windows: add ignoreversion to setup script

#define MainApp '../../build/Track-o-Bot.exe'
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(MainApp, Major, Minor, Rev, Build)
#define Version Str(Major)+"."+Str(Minor)+"."+Str(Rev)

[Setup]
AppName=Track-o-Bot
AppVersion={#Version}
AppPublisher=spidy.ch
AppPublisherURL=http://spidy.ch
DefaultDirName={pf}\Track-o-Bot
DefaultGroupName=Track-o-Bot
UninstallDisplayIcon={app}\Track-o-Bot.exe
OutputBaseFilename=Track-o-Bot_{#Version}

[Files]
Source: "../../build/Track-o-Bot.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "../../../WinSparkle/Release/WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion

; Required for QtNetworkManager to work with HTTPS
Source: "../../../OpenSSL-Win32/bin/libeay32.dll"; DestDir: "{app}"
Source: "../../../OpenSSL-Win32/bin/ssleay32.dll"; DestDir: "{app}"

; Qt
Source: "../../../../Qt/4.8.6/bin/QtCore4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtGui4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtNetwork4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtSvg4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qgif4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qico4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qjpeg4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qmng4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qsvg4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qtga4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qtiff4.dll"; DestDir: "{app}/imageformats"

; C/C++ Runtime
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/x86/Microsoft.VC100.CRT/msvcp100.dll"; DestDir: "{app}"
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"; DestDir: "{app}"

[Run]
Filename: "{app}\Track-o-Bot.exe"; Description: "Launch Track-o-Bot"; Flags: postinstall nowait

[Icons]
Name: "{group}\Track-o-Bot"; Filename: "{app}\Track-o-Bot.exe"

#define MainApp '../../build/Track-o-Bot.exe'
#define Major
#define Minor
#define Rev
#define Build
#expr ParseVersion(MainApp, Major, Minor, Rev, Build)
#define Version Str(Major)+"."+Str(Minor)+"."+Str(Rev)

[Setup]
AppName=Track-o-Bot
AppVersion={#Version}
AppPublisher=spidy.ch
AppPublisherURL=http://spidy.ch
DefaultDirName={pf}\Track-o-Bot
DefaultGroupName=Track-o-Bot
UninstallDisplayIcon={app}\Track-o-Bot.exe
OutputBaseFilename=Track-o-Bot_{#Version}

[Files]
Source: "../../build/Track-o-Bot.exe"; DestDir: "{app}"
Source: "../../../WinSparkle/Release/WinSparkle.dll"; DestDir: "{app}"

; Required for QtNetworkManager to work with HTTPS
Source: "../../../OpenSSL-Win32/bin/libeay32.dll"; DestDir: "{app}"
Source: "../../../OpenSSL-Win32/bin/ssleay32.dll"; DestDir: "{app}"

; Qt
Source: "../../../../Qt/4.8.6/bin/QtCore4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtGui4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtNetwork4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/bin/QtSvg4.dll"; DestDir: "{app}"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qgif4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qico4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qjpeg4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qmng4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qsvg4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qtga4.dll"; DestDir: "{app}/imageformats"
Source: "../../../../Qt/4.8.6/plugins/imageformats/qtiff4.dll"; DestDir: "{app}/imageformats"

; C/C++ Runtime
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/x86/Microsoft.VC100.CRT/msvcp100.dll"; DestDir: "{app}"
Source: "../../../../Program Files (x86)/Microsoft Visual Studio 10.0/VC/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"; DestDir: "{app}"

[Run]
Filename: "{app}\Track-o-Bot.exe"; Description: "Launch Track-o-Bot"; Flags: postinstall nowait

[Icons]
Name: "{group}\Track-o-Bot"; Filename: "{app}\Track-o-Bot.exe"


Added the remaining sections and entries in the installer.

#define MyAppName "Solar Space"
#define MyAppVersion "1.2.0"
#define MyAppPublisher "Victor Semionov"
#define MyAppPublisherShort "vsemionov"
#define MyPublisherURL "http://www.vsemionov.org/"
#define MyAppURL "http://www.vsemionov.org/solar-space/"
#define MyAppExeName "SolSpace.scr"

[Setup]
AppId={{DEA29385-E983-4A44-81AB-F9CA69961459}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=..\LICENSE.txt
InfoAfterFile=..\AUTHORS.txt
OutputDir=..\build
OutputBaseFilename={#MyAppName} {#MyAppVersion}
Compression=lzma
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "setsaver"; Description: "&Set as the current screen saver"

[Files]
Source: "..\Release\{#MyAppExeName}"; DestDir: "{win}"; Flags: ignoreversion
Source: "..\freetype6.dll"; DestDir: "{sys}"; Flags: sharedfile
Source: "..\zlib1.dll"; DestDir: "{sys}"; Flags: sharedfile
Source: "..\Solar Space.d2"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Solar System.d2"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
Source: "..\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\CHANGES.txt"; DestDir: "{app}"; Flags: ignoreversion

[Registry]
Root: HKLM; Subkey: "Software\{#MyAppPublisherShort}\{#MyAppName}"; ValueType: string; ValueName: "Data Directory"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Control Panel\Desktop"; ValueType: string; ValueName: "SCRNSAVE.EXE"; ValueData: "{code:GetShortName|{win}\{#MyAppExeName}}"; Tasks: setsaver

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{win}\{#MyAppExeName}"; Parameters: "-s"
Name: "{group}\{#MyAppName} Options"; Filename: "{win}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{win}\{#MyAppExeName}"; Parameters: "-s"; Tasks: desktopicon

[Run]
Filename: "{win}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Parameters: "-s"; Flags: nowait postinstall skipifsilent

#define MyAppName "Solar Space"
#define MyAppVersion "1.2.0"
#define MyAppPublisher "Victor Semionov"
#define MyPublisherURL "http://www.vsemionov.org/"
#define MyAppURL "http://www.vsemionov.org/solar-space/"
#define MyAppExeName "SolSpace.scr"

[Setup]
AppId={{DEA29385-E983-4A44-81AB-F9CA69961459}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=..\LICENSE.txt
InfoAfterFile=..\AUTHORS.txt
OutputDir=..\build
OutputBaseFilename={#MyAppName} {#MyAppVersion}
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "..\Release\{#MyAppExeName}"; DestDir: "{win}"; Flags: ignoreversion
Source: "..\freetype6.dll"; DestDir: "{sys}"; Flags: sharedfile
Source: "..\zlib1.dll"; DestDir: "{sys}"; Flags: sharedfile
Source: "..\Solar Space.d2"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Solar System.d2"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
Source: "..\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\CHANGES.txt"; DestDir: "{app}"; Flags: ignoreversion

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

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent


Added compression to wininstaller.

Added compression to wininstaller.

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

#define MyAppName "KlustaViewa"
#define MyAppVersion "0.3.0dev"
#define MyAppPublisher "Klusta-Team"
#define MyAppURL "https://klusta-team.github.io"

[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={{E271F842-D4CF-4D8D-8421-EEEFB8347E98}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
SetupIconFile=D:\Git\klustaviewa\klustaviewa\icons\favicon.ico
Compression=zip
WizardImageFile=wizard.bmp
WizardImageStretch=no
WizardSmallImageFile=wizard-small.bmp
WizardImageBackColor=$ffffff
OutputBaseFilename=klustaviewa-setup
OutputDir=.
ChangesAssociations=yes

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

[Files]
Source: "D:\Git\klustaviewa\dev\wininstaller\KlustaViewa\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
; KlustaViewa
Name: "{group}\KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\klustaviewa.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"
Name: "{userdesktop}\KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\klustaviewa.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"

; KwikSkope
;Name: "{group}\KwikSkope"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\kwikskope.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"
;Name: "{userdesktop}\KwikSkope"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\kwikskope.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"

; Update and Uninstall
;Name: "{group}\Update KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\python.exe"; WorkingDir: "{app}"; Parameters: """{app}\tools\update.py""";
;Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\python.exe"; WorkingDir: "{app}"; Parameters: """{app}\tools\update.py"""; Flags: runhidden

[Dirs]
Name: "{app}\"; Permissions: everyone-modify

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts"; Check: NeedsAddPath('{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts')
Root: HKCR; Subkey: ".kwik"; ValueType: string; ValueName: ""; ValueData: "Kwik spike file"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "KlustaViewa"; ValueType: string; ValueName: ""; ValueData: "KlustaViewa"; Flags: uninsdeletekey
Root: HKCR; Subkey: "KlustaViewa\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\favicon.ico"
Root: HKCR; Subkey: "KlustaViewa\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\WinPython-64bit-2.7.5.2\python-2.7.5.amd64\Scripts\klustaviewa.exe"" ""%1"""

[Code]
function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
begin
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon
  // Pos() returns 0 if not found
  Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;

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

#define MyAppName "KlustaViewa"
#define MyAppVersion "0.3.0dev"
#define MyAppPublisher "Klusta-Team"
#define MyAppURL "https://klusta-team.github.io"

[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={{E271F842-D4CF-4D8D-8421-EEEFB8347E98}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
SetupIconFile=D:\Git\klustaviewa\klustaviewa\icons\favicon.ico
Compression=None
WizardImageFile=wizard.bmp
WizardImageStretch=no
WizardSmallImageFile=wizard-small.bmp
WizardImageBackColor=$ffffff
OutputBaseFilename=klustaviewa-setup
OutputDir=.
ChangesAssociations=yes

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

[Files]
Source: "D:\Git\klustaviewa\dev\wininstaller\KlustaViewa\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
; KlustaViewa
Name: "{group}\KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\klustaviewa.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"
Name: "{userdesktop}\KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\klustaviewa.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"

; KwikSkope
;Name: "{group}\KwikSkope"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\kwikskope.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"
;Name: "{userdesktop}\KwikSkope"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts\kwikskope.exe"; WorkingDir: "{userdocs}"; IconFilename: "{app}\favicon.ico"

; Update and Uninstall
;Name: "{group}\Update KlustaViewa"; Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\python.exe"; WorkingDir: "{app}"; Parameters: """{app}\tools\update.py""";
;Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\python.exe"; WorkingDir: "{app}"; Parameters: """{app}\tools\update.py"""; Flags: runhidden

[Dirs]
Name: "{app}\"; Permissions: everyone-modify

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts"; Check: NeedsAddPath('{app}\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Scripts')
Root: HKCR; Subkey: ".kwik"; ValueType: string; ValueName: ""; ValueData: "Kwik spike file"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "KlustaViewa"; ValueType: string; ValueName: ""; ValueData: "KlustaViewa"; Flags: uninsdeletekey
Root: HKCR; Subkey: "KlustaViewa\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\favicon.ico"
Root: HKCR; Subkey: "KlustaViewa\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\WinPython-64bit-2.7.5.2\python-2.7.5.amd64\Scripts\klustaviewa.exe"" ""%1"""

[Code]
function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
begin
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon
  // Pos() returns 0 if not found
  Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;