Fix proposal

Fix proposal

; Cosmos Registry key
; Install assemblies
; Delete old user kit installer and task asm

[Setup]
AppName=Cosmos User Kit
AppVerName=Cosmos User Kit 1.1
AppCopyright=Copyright  2007-2008 The Cosmos Project
AppPublisher=Cosmos Project
AppPublisherURL=http://www.gocosmos.org/
AppSupportURL=http://www.gocosmos.org/
AppUpdatesURL=http://www.gocosmos.org/
DefaultDirName={userappdata}\Cosmos User Kit
DefaultGroupName=Cosmos User Kit
OutputDir=.\Output
OutputBaseFilename=CosmosUserKit
Compression=lzma/ultra64
SolidCompression=yes
SourceDir=..\build
;Left Image should be 164x314
WizardImageFile=..\setup\images\cosmos.bmp
;Small Image should be 55x55
WizardSmallImageFile=..\setup\images\cosmos_small.bmp

; If you want all languages to be listed in the "Select Setup Language"
; dialog, even those that can't be displayed in the active code page,
; uncomment the following two lines.
[LangOptions]
LanguageCodePage=0

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: eu; MessagesFile: "..\setup\Languages\Basque-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ca; MessagesFile: "..\setup\Languages\Catalan-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: cs; MessagesFile: "..\setup\Languages\Czech-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: da; MessagesFile: "..\setup\Languages\Danish-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: nl; MessagesFile: "..\setup\Languages\Dutch-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: fi; MessagesFile: "..\setup\Languages\Finnish-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: fr; MessagesFile: "..\setup\Languages\French-15-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: de; MessagesFile: "..\setup\Languages\German-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: hu; MessagesFile: "..\setup\Languages\Hungarian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: it; MessagesFile: "..\setup\Languages\Italian-14-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: no; MessagesFile: "..\setup\Languages\Norwegian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: pl; MessagesFile: "..\setup\Languages\Polish-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: pt; MessagesFile: "..\setup\Languages\PortugueseStd-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ru; MessagesFile: "..\setup\Languages\Russian-19-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sk; MessagesFile: "..\setup\Languages\Slovak-6-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sl; MessagesFile: "..\setup\Languages\Slovenian-3-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
;InOffical:
Name: bg; MessagesFile: "..\setup\Languages\InOfficial\Bulgarian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: el; MessagesFile: "..\setup\Languages\InOfficial\Greek-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: is; MessagesFile: "..\setup\Languages\InOfficial\Icelandic-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: id; MessagesFile: "..\setup\Languages\InOfficial\Indonesian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ja; MessagesFile: "..\setup\Languages\InOfficial\Japanese-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ko; MessagesFile: "..\setup\Languages\InOfficial\Korean-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ms; MessagesFile: "..\setup\Languages\InOfficial\Malaysian-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: es; MessagesFile: "..\setup\Languages\InOfficial\SpanishStd-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sv; MessagesFile: "..\setup\Languages\InOfficial\Swedish-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: tr; MessagesFile: "..\setup\Languages\InOfficial\Turkish-3-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: uk; MessagesFile: "..\setup\Languages\InOfficial\Ukrainian-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: cn; MessagesFile: "..\setup\Languages\InOfficial\ChineseSimp-11-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: tw; MessagesFile: "..\setup\Languages\InOfficial\ChineseTrad-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"

[Messages]
en.BeveledLabel=English
eu.BeveledLabel=Basque
ca.BeveledLabel=Catalan
cs.BeveledLabel=Czech
da.BeveledLabel=Danish
nl.BeveledLabel=Dutch
fi.BeveledLabel=Finnish
fr.BeveledLabel=French
de.BeveledLabel=German
hu.BeveledLabel=Hungarian
it.BeveledLabel=Italian
no.BeveledLabel=Norwegian
pl.BeveledLabel=Polish
pt.BeveledLabel=Portuguese
ru.BeveledLabel=Russian
sk.BeveledLabel=Slovak
sl.BeveledLabel=Slovenian
;InOffical:
bg.BeveledLabel=Bulgarian
el.BeveledLabel=Greek
is.BeveledLabel=Icelandic
id.BeveledLabel=Indonesian
ja.BeveledLabel=Japanese
ko.BeveledLabel=Korean
ms.BeveledLabel=Malaysian
es.BeveledLabel=Spanish
sv.BeveledLabel=Swedish
tr.BeveledLabel=Turkish
uk.BeveledLabel=Ukrainian
cn.BeveledLabel=Chinese Simplified
tw.BeveledLabel=Chinese Traditional

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,Cosmos}"; Filename: "http://www.gocosmos.org/"
Name: "{group}\{cm:UninstallProgram,Uninstall}"; Filename: "{uninstallexe}"

[Files]
Source: "..\setup\Cosmos.vsi"; DestDir: "{app}";
Source: "Tools\*"; DestDir: "{app}\Tools"; Excludes: "*.log;*.asm;output.bin"; Flags: recursesubdirs;
Source: "..\source\Cosmos\Cosmos.Shell.Console\bin\Debug\*.dll"; DestDir: "{app}\Tools\GAC";
Source: "..\setup\RegGac.exe"; DestDir: "{app}";
Source: "..\Build\ISO\*.*"; DestDir: "{app}\ISO"; Excludes: "output.bin";

[Registry]
Root: HKCU; Subkey: "Software\Cosmos"; ValueType: string; ValueName: "Build Path"; ValueData: "{app}";
Root: HKLM; Subkey: "Software\Microsoft\.NETFramework\AssemblyFolders\Cosmos"; ValueType: string; ValueName: ""; ValueData: "{app}\Tools\GAC\";

[Run]
Filename: "{app}\Cosmos.vsi"; Verb: "open"; Flags: shellexec runascurrentuser;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Build.Windows.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Hardware.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Hardware.PC.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Kernel.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install IL2CPU.exe gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Plugs.dll gac"; Flags: runhidden;
Filename: "{sys}\cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del temp*.bat"; Flags: runhidden;

[UninstallRun]
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Build.Windows.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Hardware.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Hardware.PC.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Kernel.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall IL2CPU.exe gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Plugs.dll gac"; Flags: runhidden;

; Cosmos Registry key
; Install assemblies
; Delete old user kit installer and task asm

[Setup]
AppName=Cosmos User Kit
AppVerName=Cosmos User Kit 1.1
AppCopyright=Copyright  2007-2008 The Cosmos Project
AppPublisher=Cosmos Project
AppPublisherURL=http://www.gocosmos.org/
AppSupportURL=http://www.gocosmos.org/
AppUpdatesURL=http://www.gocosmos.org/
DefaultDirName={pf}\Cosmos User Kit
DefaultGroupName=Cosmos User Kit
OutputDir=.\Output
OutputBaseFilename=CosmosUserKit
Compression=lzma/ultra64
SolidCompression=yes
SourceDir=..\build
;Left Image should be 164x314
WizardImageFile=..\setup\images\cosmos.bmp
;Small Image should be 55x55
WizardSmallImageFile=..\setup\images\cosmos_small.bmp

; If you want all languages to be listed in the "Select Setup Language"
; dialog, even those that can't be displayed in the active code page,
; uncomment the following two lines.
[LangOptions]
LanguageCodePage=0

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: eu; MessagesFile: "..\setup\Languages\Basque-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ca; MessagesFile: "..\setup\Languages\Catalan-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: cs; MessagesFile: "..\setup\Languages\Czech-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: da; MessagesFile: "..\setup\Languages\Danish-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: nl; MessagesFile: "..\setup\Languages\Dutch-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: fi; MessagesFile: "..\setup\Languages\Finnish-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: fr; MessagesFile: "..\setup\Languages\French-15-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: de; MessagesFile: "..\setup\Languages\German-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: hu; MessagesFile: "..\setup\Languages\Hungarian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: it; MessagesFile: "..\setup\Languages\Italian-14-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: no; MessagesFile: "..\setup\Languages\Norwegian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: pl; MessagesFile: "..\setup\Languages\Polish-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: pt; MessagesFile: "..\setup\Languages\PortugueseStd-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ru; MessagesFile: "..\setup\Languages\Russian-19-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sk; MessagesFile: "..\setup\Languages\Slovak-6-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sl; MessagesFile: "..\setup\Languages\Slovenian-3-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
;InOffical:
Name: bg; MessagesFile: "..\setup\Languages\InOfficial\Bulgarian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: el; MessagesFile: "..\setup\Languages\InOfficial\Greek-4-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: is; MessagesFile: "..\setup\Languages\InOfficial\Icelandic-1-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: id; MessagesFile: "..\setup\Languages\InOfficial\Indonesian-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ja; MessagesFile: "..\setup\Languages\InOfficial\Japanese-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ko; MessagesFile: "..\setup\Languages\InOfficial\Korean-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: ms; MessagesFile: "..\setup\Languages\InOfficial\Malaysian-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: es; MessagesFile: "..\setup\Languages\InOfficial\SpanishStd-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: sv; MessagesFile: "..\setup\Languages\InOfficial\Swedish-8-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: tr; MessagesFile: "..\setup\Languages\InOfficial\Turkish-3-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: uk; MessagesFile: "..\setup\Languages\InOfficial\Ukrainian-5-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: cn; MessagesFile: "..\setup\Languages\InOfficial\ChineseSimp-11-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"
Name: tw; MessagesFile: "..\setup\Languages\InOfficial\ChineseTrad-2-5.1.0.isl"; InfoBeforeFile: "..\setup\Readme.txt"

[Messages]
en.BeveledLabel=English
eu.BeveledLabel=Basque
ca.BeveledLabel=Catalan
cs.BeveledLabel=Czech
da.BeveledLabel=Danish
nl.BeveledLabel=Dutch
fi.BeveledLabel=Finnish
fr.BeveledLabel=French
de.BeveledLabel=German
hu.BeveledLabel=Hungarian
it.BeveledLabel=Italian
no.BeveledLabel=Norwegian
pl.BeveledLabel=Polish
pt.BeveledLabel=Portuguese
ru.BeveledLabel=Russian
sk.BeveledLabel=Slovak
sl.BeveledLabel=Slovenian
;InOffical:
bg.BeveledLabel=Bulgarian
el.BeveledLabel=Greek
is.BeveledLabel=Icelandic
id.BeveledLabel=Indonesian
ja.BeveledLabel=Japanese
ko.BeveledLabel=Korean
ms.BeveledLabel=Malaysian
es.BeveledLabel=Spanish
sv.BeveledLabel=Swedish
tr.BeveledLabel=Turkish
uk.BeveledLabel=Ukrainian
cn.BeveledLabel=Chinese Simplified
tw.BeveledLabel=Chinese Traditional

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,Cosmos}"; Filename: "http://www.gocosmos.org/"
Name: "{group}\{cm:UninstallProgram,Uninstall}"; Filename: "{uninstallexe}"

[Files]
Source: "..\setup\Cosmos.vsi"; DestDir: "{app}";
Source: "Tools\*"; DestDir: "{app}\Tools"; Excludes: "*.log;*.asm;output.bin"; Flags: recursesubdirs;
Source: "..\source\Cosmos\Cosmos.Shell.Console\bin\Debug\*.dll"; DestDir: "{app}\Tools\GAC";
Source: "..\source\IL2CPU\bin\Debug\IL2CPU.exe"; DestDir: "{app}\Tools\GAC";
Source: "..\setup\RegGac.exe"; DestDir: "{app}";
Source: "..\Build\ISO\*.*"; DestDir: "{userappdata}\Cosmos User Kit\ISO"; Excludes: "output.bin";

[Registry]
Root: HKCU; Subkey: "Software\Cosmos"; ValueType: string; ValueName: "Build Path"; ValueData: "{app}";
Root: HKLM; Subkey: "Software\Microsoft\.NETFramework\AssemblyFolders\Cosmos"; ValueType: string; ValueName: ""; ValueData: "{app}\Tools\GAC\";

[Run]
Filename: "{app}\Cosmos.vsi"; Verb: "open"; Flags: shellexec runascurrentuser;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Build.Windows.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Hardware.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Hardware.PC.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Cosmos.Kernel.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install IL2CPU.exe gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Assembler.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.IL.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "install Indy.IL2CPU.Plugs.dll gac"; Flags: runhidden;
Filename: "{sys}\cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del temp*.bat"; Flags: runhidden;

[UninstallRun]
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Build.Windows.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Hardware.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Hardware.PC.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Cosmos.Kernel.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall IL2CPU.exe gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Assembler.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.Native.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.IL.X86.Win32.dll gac"; Flags: runhidden;
Filename: "{app}\RegGac.exe"; WorkingDir: "{app}\Tools\GAC"; Parameters: "uninstall Indy.IL2CPU.Plugs.dll gac"; Flags: runhidden;


That's the form complete?

That's the form complete?

#define Arch "x64"
#define AppId "{c004dcef-b848-46a5-9c30-4dbf736396fa}"

// #include "../common.iss"

#define AppExeName "SyncTrayzor.exe"
#define AppRoot "..\.."
#define AppSrc AppRoot + "\src\SyncTrayzor"
#define AppBin AppRoot +"\bin\" + Arch + "\Release"
#define AppExe AppBin + "\SyncTrayzor.exe"
#define AppName GetStringFileInfo(AppExe, "ProductName")
#define AppVersion GetFileVersion(AppExe)
#define AppPublisher "SyncTrayzor"
#define AppURL "https://github.com/canton7/SyncTrayzor"
#define AppDataFolder "SyncTrayzor"
#define RunRegKey "Software\Microsoft\Windows\CurrentVersion\Run"
#define DotNetInstallerExe "dotNet451Setup.exe"
#define DonateUrl = "https://synctrayzor.antonymale.co.uk/donate"

[Setup]
AppId={{#AppId}
AppName={#AppName} ({#Arch})
AppVersion={#AppVersion}
VersionInfoVersion={#AppVersion}
;AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
AllowNoIcons=yes
LicenseFile={#AppRoot}\LICENSE.txt
OutputDir="."
OutputBaseFilename={#AppName}Setup-{#Arch}
SetupIconFile={#AppSrc}\Icons\default.ico
WizardSmallImageFile=..\icon.bmp
;Compression=lzma2/max
Compression=None
SolidCompression=yes
PrivilegesRequired=admin
CloseApplications=yes
RestartApplications=no
; If we try and close CefSharp.BrowserSubprocess.exe we'll fail - it doesn't respond well
; However if we close *just* SyncTrayzor, that will take care of shutting down CefSharp and syncthing
CloseApplicationsFilter=SyncTrayzor.exe
TouchDate=current
#if "x64" == Arch
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
#endif

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

[CustomMessages]
InstallingDotNetFramework=Installing .NET Framework. This might take a few minutes...
DotNetFrameworkFailedToLaunch=Failed to launch .NET Framework Installer with error "%1". Please fix the error then run this installer again.
DotNetFrameworkFailed1602=.NET Framework installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Framework installation is completed successfully.
DotNetFrameworkFailed1603=A fatal error occurred while installing the .NET Framework. Please fix the error, then run the installer again.
DotNetFrameworkFailed5100=Your computer does not meet the requirements of the .NET Framework. Please consult the documentation.
DotNetFrameworkFailedOther=The .NET Framework installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

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

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"

[Files]
; Near the beginning, as it's extracted first and this makes it cheaper
Source: "..\{#DotNetInstallerExe}"; DestDir: {tmp}; Flags: dontcopy nocompression noencryption

Source: "{#AppBin}\*"; DestDir: "{app}"; Excludes: "*.xml,*.vshost.*,*.config,*.log,FluentValidation.resources.dll,System.Windows.Interactivity.resources.dll,syncthing.exe,data,logs,ffmpegsumo.dll,d3dcompiler_43.dll,d3dcompiler_47.dll,libEGL.dll,libGLESv2.dll,pdf.dll"; Flags: ignoreversion recursesubdirs
Source: "{#AppBin}\SyncTrayzor.exe.Installer.config"; DestDir: "{app}"; DestName: "SyncTrayzor.exe.config"; Flags: ignoreversion
Source: "{#AppSrc}\Icons\default.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "syncthing.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Flags: ignoreversion

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall; Parameters: {code:SyncTrayzorStartFlags}; Check: ShouldStartSyncTrayzor

[Code]
var
  GlobalRestartRequired: boolean;
  UninstallPollPage: TNewNotebookPage;
  UninstallNextButton: TNewButton;

function DotNetIsMissing(): Boolean;
var
  Exists: Boolean;
  Release: Cardinal;
begin
  Exists := RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release);
  Result := not Exists or (Release < 378758);
end;

// Adapted from https://blogs.msdn.microsoft.com/davidrickard/2015/07/17/installing-net-framework-4-5-automatically-with-inno-setup/
function InstallDotNet(): String;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetFramework');
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    ExtractTemporaryFile('{#DotNetInstallerExe}');
    if not Exec(ExpandConstant('{tmp}\{#DotNetInstallerExe}'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
      Result := FmtMessage(CustomMessage('DotNetFrameworkFailedToLaunch'), [SysErrorMessage(ResultCode)]);
    end
    else
    begin
      // See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
      case resultCode of
        0: begin
          // Successful
        end;
        1602 : begin
          MsgBox(CustomMessage('DotNetFrameworkFailed1602'), mbInformation, MB_OK);
        end;
        1603: begin
          Result := CustomMessage('DotNetFrameworkFailed1603');
        end;
        1641: begin
          GlobalRestartRequired := True;
        end;
        3010: begin
          GlobalRestartRequired := True;
        end;
        5100: begin
          Result := CustomMessage('DotNetFrameworkFailed5100');
        end;
        else begin
          MsgBox(FmtMessage(CustomMessage('DotNetFrameworkFailedOther'), [IntToStr(ResultCode)]), mbError, MB_OK);
        end;
      end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;

procedure BumpInstallCount;
var
  FileContents: AnsiString;
  InstallCount: integer;
begin
  { Increment the install count in InstallCount.txt if it exists, or create it with the contents '1' if it doesn't }
  if LoadStringFromFile(ExpandConstant('{app}\InstallCount.txt'), FileContents) then
  begin
    InstallCount := StrTointDef(Trim(string(FileContents)), 0) + 1;
  end
  else
  begin
    InstallCount := 1;
  end;

  SaveStringToFile(ExpandConstant('{app}\InstallCount.txt'), IntToStr(InstallCount), False);
end;

procedure URLLabelOnClick(Sender: TObject);
var
	ErrorCode: Integer;
begin
	ShellExec('open', '{#DonateUrl}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard;
var
  URLLabel: TNewStaticText;
begin
  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'Donate';
  URLLabel.Cursor := crHand;
  URLLabel.Parent := WizardForm;
  URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
	URLLabel.Font.Color := clBlue;
	URLLabel.Top := WizardForm.ClientHeight - URLLabel.Height - 15;
  URLLabel.Left := ScaleX(10)
  URLLabel.OnClick := @URLLabelOnClick;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  FindRec: TFindRec;
  FolderPath: String;
  FilePath: String;
begin
  if CurStep = ssInstall then
  begin
    BumpInstallCount();

    { We might be being run from ProcessRunner.exe, *and* we might be trying to update it. Funsies. Let's rename it (which Windows lets us do) }
    DeleteFile(ExpandConstant('{app}\ProcessRunner.exe.old'));
    RenameFile(ExpandConstant('{app}\ProcessRunner.exe'), ExpandConstant('{app}\ProcessRunner.exe.old'));

    Log(ExpandConstant('Looking for resource files in {app}\*'));
    { Remove resource files. This means that out-of-date languages will be removed, which (as a last-ditch resore) will alert maintainers that something's wrong }
    if FindFirst(ExpandConstant('{app}\*'), FindRec) then
    begin
      try
        repeat
          if (FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0) and (FindRec.Name <> '.') and (FindRec.Name <> '..') then
          begin
            FolderPath :=  ExpandConstant('{app}\') + FindRec.Name;
            FilePath := FolderPath + '\SyncTrayzor.resources.dll';
            if DeleteFile(FilePath) then
            begin
              Log('Deleted ' + FilePath);
              if DelTree(FolderPath, True, False, False) then
                Log('Deleted ' + FolderPath);
            end;
          end;
        until not FindNext(FindRec);
      finally
        FindClose(FindRec);
      end;
    end;
  end
end;

procedure CurPageChanged(CurPageID: Integer);
begin

end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  // 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
  // If the installers indicate that they want a restart, this should be done at the end of installation.
  // Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

  if DotNetIsMissing() then
  begin
    Result := InstallDotNet();
  end;
end;

function NeedRestart(): Boolean;
begin
  Result := GlobalRestartRequired;
end;

function ShouldStartSyncTrayzor(): Boolean;
var
  flagPassed: Boolean;
  i: Integer;
begin
  // Can't use {param}, as it doesn't match flags with no value
  flagPassed := False;
  for i := 0 to ParamCount do begin
    if ParamStr(i) = '/StartSyncTrayzor' then begin
      flagPassed := True;
      break;
    end;
  end;
  Result := (not WizardSilent()) or flagPassed;
end;

function SyncTrayzorStartFlags(param: String): String;
begin
   if WizardSilent() then begin
      Result := '-minimized'
   end else begin
      Result := ''
   end;
end;

// See https://stackoverflow.com/a/42550055/1086121

procedure UpdateUninstallWizard;
begin
  if UninstallProgressForm.InnerNotebook.ActivePage = UninstallPollPage then
  begin
    UninstallProgressForm.PageNameLabel.Caption := 'Please Tell Us Why You''re Leaving';
    UninstallProgressForm.PageDescriptionLabel.Caption := '';
  end;

  UninstallNextButton.Caption := 'Uninstall';
  // Make the "Uninstall" button break the ShowModal loop
  UninstallNextButton.ModalResult := mrOK;
end;

procedure InitializeUninstallProgressForm();
var
  PageText: TNewStaticText;
  PageNameLabel: string;
  PageDescriptionLabel: string;
  CancelButtonEnabled: Boolean;
  CancelButtonModalResult: Integer;
  Checklist: TNewCheckListBox;
  CommentsText: TNewStaticText;
  CommentsBox: TNewMemo;
begin
  if not UninstallSilent then
  begin
    // Create the poll page and make it active
    UninstallPollPage := TNewNotebookPage.Create(UninstallProgressForm);
    UninstallPollPage.Notebook := UninstallProgressForm.InnerNotebook;
    UninstallPollPage.Parent := UninstallProgressForm.InnerNotebook;
    UninstallPollPage.Align := alClient;

    PageText := TNewStaticText.Create(UninstallProgressForm);
    PageText.Parent := UninstallPollPage;
    PageText.AutoSize := True;
    PageText.WordWrap := True;
    PageText.SetBounds(UninstallProgressForm.StatusLabel.Left, UninstallProgressForm.StatusLabel.Top, UninstallProgressForm.StatusLabel.Width, UninstallProgressForm.StatusLabel.Height);
    PageText.ShowAccelChar := False;
    PageText.Caption := 'Please tell us why you don''t like Syncthing / SyncTrayzor so we can improve things.' + #13#10 +
    'No personal data will be sent. You can skip this step if you want.';

    Checklist := TNewCheckListBox.Create(UninstallProgressForm);
    Checklist.Parent := UninstallPollPage;
    Checklist.SetBounds(PageText.Left, PageText.Top + PageText.Height + ScaleY(10), PageText.Width, ScaleY(20) * 5);
    Checklist.BorderStyle := bsNone;
    Checklist.Color := clBtnFace;
    Checklist.WantTabs := True;
    Checklist.MinItemHeight := ScaleY(20);

    Checklist.AddCheckBox('I couldn''t get Syncthing to work', '', 0, False, True, False, False, nil);
    Checklist.AddCheckBox('Syncthing doesn''t do what I need', '', 0, False, True, False, False, nil);
    Checklist.AddCheckBox('I prefer Resilio Sync', '', 0, False, True, False, False, nil);
    Checklist.AddCheckBox('I don''t like SyncTrayzor - going to use another wrapper', '', 0, False, True, False, False, nil);
    Checklist.AddCheckBox('Other (please expand below)', '', 0, False, True, False, False, nil);

    CommentsText := TNewStaticText.Create(UninstallProgressForm);
    CommentsText.Parent := UninstallPollPage;
    CommentsText.AutoSize := True;
    CommentsText.WordWrap := True;
    CommentsText.SetBounds(PageText.Left, Checklist.Top + Checklist.Height + ScaleY(10), PageText.Width, ScaleY(15));
    CommentsText.AutoSize := False;
    CommentsText.ShowAccelChar := False;
    CommentsText.Caption := 'Anything else?';

    CommentsBox := TNewMemo.Create(UninstallProgressForm);
    CommentsBox.Parent := UninstallPollPage;
    CommentsBox.SetBounds(PageText.Left, CommentsText.Top + CommentsText.Height + ScaleY(5), PageText.Width, ScaleY(60));
    CommentsBox.ScrollBars := ssVertical;

    UninstallProgressForm.InnerNotebook.ActivePage := UninstallPollPage;

    PageNameLabel := UninstallProgressForm.PageNameLabel.Caption;
    PageDescriptionLabel := UninstallProgressForm.PageDescriptionLabel.Caption;

    UninstallNextButton := TNewButton.Create(UninstallProgressForm);
    UninstallNextButton.Parent := UninstallProgressForm;
    UninstallNextButton.Left := UninstallProgressForm.CancelButton.Left - UninstallProgressForm.CancelButton.Width - ScaleX(10);
    UninstallNextButton.Top := UninstallProgressForm.CancelButton.Top;
    UninstallNextButton.Width := UninstallProgressForm.CancelButton.Width;
    UninstallNextButton.Height := UninstallProgressForm.CancelButton.Height;

    UninstallProgressForm.CancelButton.TabOrder := UninstallNextButton.TabOrder + 1;

    // Run our wizard pages
    UpdateUninstallWizard;
    CancelButtonEnabled := UninstallProgressForm.CancelButton.Enabled
    UninstallProgressForm.CancelButton.Enabled := True;
    CancelButtonModalResult := UninstallProgressForm.CancelButton.ModalResult;
    UninstallProgressForm.CancelButton.ModalResult := mrCancel;

    if UninstallProgressForm.ShowModal = mrCancel then Abort;

    // Restore the standard page payout
    UninstallProgressForm.CancelButton.Enabled := CancelButtonEnabled;
    UninstallProgressForm.CancelButton.ModalResult := CancelButtonModalResult;

    UninstallProgressForm.PageNameLabel.Caption := PageNameLabel;
    UninstallProgressForm.PageDescriptionLabel.Caption := PageDescriptionLabel;

    UninstallProgressForm.InnerNotebook.ActivePage := UninstallProgressForm.InstallingPage;
  end;
end;

[UninstallDelete]
Type: files; Name: "{app}\ProcessRunner.exe.old"
Type: files; Name: "{app}\InstallCount.txt"
Type: filesandordirs; Name: "{userappdata}\{#AppDataFolder}"
Type: filesandordirs; Name: "{localappdata}\{#AppDataFolder}"

#define Arch "x64"
#define AppId "{c004dcef-b848-46a5-9c30-4dbf736396fa}"

// #include "../common.iss"

#define AppExeName "SyncTrayzor.exe"
#define AppRoot "..\.."
#define AppSrc AppRoot + "\src\SyncTrayzor"
#define AppBin AppRoot +"\bin\" + Arch + "\Release"
#define AppExe AppBin + "\SyncTrayzor.exe"
#define AppName GetStringFileInfo(AppExe, "ProductName")
#define AppVersion GetFileVersion(AppExe)
#define AppPublisher "SyncTrayzor"
#define AppURL "https://github.com/canton7/SyncTrayzor"
#define AppDataFolder "SyncTrayzor"
#define RunRegKey "Software\Microsoft\Windows\CurrentVersion\Run"
#define DotNetInstallerExe "dotNet451Setup.exe"
#define DonateUrl = "https://synctrayzor.antonymale.co.uk/donate"

[Setup]
AppId={{#AppId}
AppName={#AppName} ({#Arch})
AppVersion={#AppVersion}
VersionInfoVersion={#AppVersion}
;AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
AllowNoIcons=yes
LicenseFile={#AppRoot}\LICENSE.txt
OutputDir="."
OutputBaseFilename={#AppName}Setup-{#Arch}
SetupIconFile={#AppSrc}\Icons\default.ico
WizardSmallImageFile=..\icon.bmp
;Compression=lzma2/max
Compression=None
SolidCompression=yes
PrivilegesRequired=admin
CloseApplications=yes
RestartApplications=no
; If we try and close CefSharp.BrowserSubprocess.exe we'll fail - it doesn't respond well
; However if we close *just* SyncTrayzor, that will take care of shutting down CefSharp and syncthing
CloseApplicationsFilter=SyncTrayzor.exe
TouchDate=current
#if "x64" == Arch
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
#endif

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

[CustomMessages]
InstallingDotNetFramework=Installing .NET Framework. This might take a few minutes...
DotNetFrameworkFailedToLaunch=Failed to launch .NET Framework Installer with error "%1". Please fix the error then run this installer again.
DotNetFrameworkFailed1602=.NET Framework installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Framework installation is completed successfully.
DotNetFrameworkFailed1603=A fatal error occurred while installing the .NET Framework. Please fix the error, then run the installer again.
DotNetFrameworkFailed5100=Your computer does not meet the requirements of the .NET Framework. Please consult the documentation.
DotNetFrameworkFailedOther=The .NET Framework installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

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

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"

[Files]
; Near the beginning, as it's extracted first and this makes it cheaper
Source: "..\{#DotNetInstallerExe}"; DestDir: {tmp}; Flags: dontcopy nocompression noencryption

Source: "{#AppBin}\*"; DestDir: "{app}"; Excludes: "*.xml,*.vshost.*,*.config,*.log,FluentValidation.resources.dll,System.Windows.Interactivity.resources.dll,syncthing.exe,data,logs,ffmpegsumo.dll,d3dcompiler_43.dll,d3dcompiler_47.dll,libEGL.dll,libGLESv2.dll,pdf.dll"; Flags: ignoreversion recursesubdirs
Source: "{#AppBin}\SyncTrayzor.exe.Installer.config"; DestDir: "{app}"; DestName: "SyncTrayzor.exe.config"; Flags: ignoreversion
Source: "{#AppSrc}\Icons\default.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "syncthing.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Flags: ignoreversion

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall; Parameters: {code:SyncTrayzorStartFlags}; Check: ShouldStartSyncTrayzor

[Code]
var
  GlobalRestartRequired: boolean;
  UninstallPollPage: TNewNotebookPage;
  UninstallNextButton: TNewButton;

function DotNetIsMissing(): Boolean;
var
  Exists: Boolean;
  Release: Cardinal;
begin
  Exists := RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Release);
  Result := not Exists or (Release < 378758);
end;

// Adapted from https://blogs.msdn.microsoft.com/davidrickard/2015/07/17/installing-net-framework-4-5-automatically-with-inno-setup/
function InstallDotNet(): String;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetFramework');
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    ExtractTemporaryFile('{#DotNetInstallerExe}');
    if not Exec(ExpandConstant('{tmp}\{#DotNetInstallerExe}'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
      Result := FmtMessage(CustomMessage('DotNetFrameworkFailedToLaunch'), [SysErrorMessage(ResultCode)]);
    end
    else
    begin
      // See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
      case resultCode of
        0: begin
          // Successful
        end;
        1602 : begin
          MsgBox(CustomMessage('DotNetFrameworkFailed1602'), mbInformation, MB_OK);
        end;
        1603: begin
          Result := CustomMessage('DotNetFrameworkFailed1603');
        end;
        1641: begin
          GlobalRestartRequired := True;
        end;
        3010: begin
          GlobalRestartRequired := True;
        end;
        5100: begin
          Result := CustomMessage('DotNetFrameworkFailed5100');
        end;
        else begin
          MsgBox(FmtMessage(CustomMessage('DotNetFrameworkFailedOther'), [IntToStr(ResultCode)]), mbError, MB_OK);
        end;
      end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;

procedure BumpInstallCount;
var
  FileContents: AnsiString;
  InstallCount: integer;
begin
  { Increment the install count in InstallCount.txt if it exists, or create it with the contents '1' if it doesn't }
  if LoadStringFromFile(ExpandConstant('{app}\InstallCount.txt'), FileContents) then
  begin
    InstallCount := StrTointDef(Trim(string(FileContents)), 0) + 1;
  end
  else
  begin
    InstallCount := 1;
  end;

  SaveStringToFile(ExpandConstant('{app}\InstallCount.txt'), IntToStr(InstallCount), False);
end;

procedure URLLabelOnClick(Sender: TObject);
var
	ErrorCode: Integer;
begin
	ShellExec('open', '{#DonateUrl}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard;
var
  URLLabel: TNewStaticText;
begin
  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'Donate';
  URLLabel.Cursor := crHand;
  URLLabel.Parent := WizardForm;
  URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
	URLLabel.Font.Color := clBlue;
	URLLabel.Top := WizardForm.ClientHeight - URLLabel.Height - 15;
  URLLabel.Left := ScaleX(10)
  URLLabel.OnClick := @URLLabelOnClick;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  FindRec: TFindRec;
  FolderPath: String;
  FilePath: String;
begin
  if CurStep = ssInstall then
  begin
    BumpInstallCount();

    { We might be being run from ProcessRunner.exe, *and* we might be trying to update it. Funsies. Let's rename it (which Windows lets us do) }
    DeleteFile(ExpandConstant('{app}\ProcessRunner.exe.old'));
    RenameFile(ExpandConstant('{app}\ProcessRunner.exe'), ExpandConstant('{app}\ProcessRunner.exe.old'));

    Log(ExpandConstant('Looking for resource files in {app}\*'));
    { Remove resource files. This means that out-of-date languages will be removed, which (as a last-ditch resore) will alert maintainers that something's wrong }
    if FindFirst(ExpandConstant('{app}\*'), FindRec) then
    begin
      try
        repeat
          if (FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0) and (FindRec.Name <> '.') and (FindRec.Name <> '..') then
          begin
            FolderPath :=  ExpandConstant('{app}\') + FindRec.Name;
            FilePath := FolderPath + '\SyncTrayzor.resources.dll';
            if DeleteFile(FilePath) then
            begin
              Log('Deleted ' + FilePath);
              if DelTree(FolderPath, True, False, False) then
                Log('Deleted ' + FolderPath);
            end;
          end;
        until not FindNext(FindRec);
      finally
        FindClose(FindRec);
      end;
    end;
  end
end;

procedure CurPageChanged(CurPageID: Integer);
begin

end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  // 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
  // If the installers indicate that they want a restart, this should be done at the end of installation.
  // Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

  if DotNetIsMissing() then
  begin
    Result := InstallDotNet();
  end;
end;

function NeedRestart(): Boolean;
begin
  Result := GlobalRestartRequired;
end;

function ShouldStartSyncTrayzor(): Boolean;
var
  flagPassed: Boolean;
  i: Integer;
begin
  // Can't use {param}, as it doesn't match flags with no value
  flagPassed := False;
  for i := 0 to ParamCount do begin
    if ParamStr(i) = '/StartSyncTrayzor' then begin
      flagPassed := True;
      break;
    end;
  end;
  Result := (not WizardSilent()) or flagPassed;
end;

function SyncTrayzorStartFlags(param: String): String;
begin
   if WizardSilent() then begin
      Result := '-minimized'
   end else begin
      Result := ''
   end;
end;

// See https://stackoverflow.com/a/42550055/1086121

procedure UpdateUninstallWizard;
begin
  if UninstallProgressForm.InnerNotebook.ActivePage = UninstallPollPage then
  begin
    UninstallProgressForm.PageNameLabel.Caption := 'First uninstall wizard page';
    UninstallProgressForm.PageDescriptionLabel.Caption :=
      'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
  end;

  UninstallNextButton.Caption := 'Uninstall';
  // Make the "Uninstall" button break the ShowModal loop
  UninstallNextButton.ModalResult := mrOK;
end;

procedure InitializeUninstallProgressForm();
var
  PageText: TNewStaticText;
  PageNameLabel: string;
  PageDescriptionLabel: string;
  CancelButtonEnabled: Boolean;
  CancelButtonModalResult: Integer;
  //CouldntMakeItWorkOption: TNewCheckBox;
  //DidntDoWhatIWantedOption: TNewCheckBox;
  Checklist: TNewCheckListBox;
  CommentsBox: TNewMemo;
begin
  if not UninstallSilent then
  begin
    // Create the poll page and make it active
    UninstallPollPage := TNewNotebookPage.Create(UninstallProgressForm);
    UninstallPollPage.Notebook := UninstallProgressForm.InnerNotebook;
    UninstallPollPage.Parent := UninstallProgressForm.InnerNotebook;
    UninstallPollPage.Align := alClient;

    PageText := TNewStaticText.Create(UninstallProgressForm);
    PageText.Parent := UninstallPollPage;
    PageText.Top := UninstallProgressForm.StatusLabel.Top;
    PageText.Left := UninstallProgressForm.StatusLabel.Left;
    PageText.Width := UninstallProgressForm.StatusLabel.Width;
    PageText.Height := UninstallProgressForm.StatusLabel.Height;
    PageText.AutoSize := False;
    PageText.ShowAccelChar := False;
    PageText.Caption := 'Press Uninstall to proceeed with uninstallation.';

    // https://stackoverflow.com/a/44254371/1086121

    {
    CouldntMakeItWorkOption := TNewCheckBox.Create(UninstallProgressForm);
    CouldntMakeItWorkOption.Parent := UninstallPollPage;
    CouldntMakeItWorkOption.Top := PageText.Top + PageText.Height + ScaleX(10);
    CouldntMakeItWorkOption.Left := PageText.Left;
    CouldntMakeItWorkOption.Caption := 'I couldn''t get Syncthing to work';

    DidntDoWhatIWantedOption := TNewCheckBox.Create(UninstallProgressForm);
    DidntDoWhatIWantedOption.Parent := UninstallPollPage;
    DidntDoWhatIWantedOption.Top := CouldntMakeItWorkOption.Top + CouldntMakeItWorkOption.Height + ScaleX(10);
    DidntDoWhatIWantedOption.Left := PageText.Left;
    DidntDoWhatIWantedOption.Caption := 'Syncthing doesn''t do what I wanted';
    }

    Checklist := TNewCheckListBox.Create(UninstallProgressForm);
    Checklist.Parent := UninstallPollPage;
    Checklist.SetBounds(PageText.Left, PageText.Top + PageText.Height + ScaleY(10), PageText.Width, ScaleY(50));
    Checklist.BorderStyle := bsNone;
    Checklist.Color := clBtnFace;
    Checklist.WantTabs := True;
    Checklist.MinItemHeight := ScaleY(20);

    Checklist.AddCheckBox('Test Caption', '', 0, False, True, False, False, nil);
    Checklist.AddCheckBox('Another Test Caption', '', 0, False, True, False, False, nil);

    CommentsBox := TNewMemo.Create(UninstallProgressForm);
    CommentsBox.Parent := UninstallPollPage;
    CommentsBox.SetBounds(PageText.Left, Checklist.Top + Checklist.Height + ScaleY(10), PageText.Width, ScaleY(50));
    CommentsBox.ScrollBars := ssVertical;

    UninstallProgressForm.InnerNotebook.ActivePage := UninstallPollPage;

    PageNameLabel := UninstallProgressForm.PageNameLabel.Caption;
    PageDescriptionLabel := UninstallProgressForm.PageDescriptionLabel.Caption;

    UninstallNextButton := TNewButton.Create(UninstallProgressForm);
    UninstallNextButton.Parent := UninstallProgressForm;
    UninstallNextButton.Left := UninstallProgressForm.CancelButton.Left - UninstallProgressForm.CancelButton.Width - ScaleX(10);
    UninstallNextButton.Top := UninstallProgressForm.CancelButton.Top;
    UninstallNextButton.Width := UninstallProgressForm.CancelButton.Width;
    UninstallNextButton.Height := UninstallProgressForm.CancelButton.Height;

    UninstallProgressForm.CancelButton.TabOrder := UninstallNextButton.TabOrder + 1;

    // Run our wizard pages
    UpdateUninstallWizard;
    CancelButtonEnabled := UninstallProgressForm.CancelButton.Enabled
    UninstallProgressForm.CancelButton.Enabled := True;
    CancelButtonModalResult := UninstallProgressForm.CancelButton.ModalResult;
    UninstallProgressForm.CancelButton.ModalResult := mrCancel;

    if UninstallProgressForm.ShowModal = mrCancel then Abort;

    // Restore the standard page payout
    UninstallProgressForm.CancelButton.Enabled := CancelButtonEnabled;
    UninstallProgressForm.CancelButton.ModalResult := CancelButtonModalResult;

    UninstallProgressForm.PageNameLabel.Caption := PageNameLabel;
    UninstallProgressForm.PageDescriptionLabel.Caption := PageDescriptionLabel;

    UninstallProgressForm.InnerNotebook.ActivePage := UninstallProgressForm.InstallingPage;
  end;
end;

[UninstallDelete]
Type: files; Name: "{app}\ProcessRunner.exe.old"
Type: files; Name: "{app}\InstallCount.txt"
Type: filesandordirs; Name: "{userappdata}\{#AppDataFolder}"
Type: filesandordirs; Name: "{localappdata}\{#AppDataFolder}"


Obvious copyright date fix.

Obvious copyright date fix.

* packages/windows-innosetup/svn.iss: update copyright year to 2006.

[Setup]
;# Version parameters #########################################################
#define svn_cpr "Copyright 2000-2006 CollabNet"

; Version and release info:
#include "svn_version.iss"

;# svn_dynamics.iss ###########################################################
; This file contains all the paths needed by inno for finding the sources to
; compile a Windows Setup for Subversion.
; A template of the file can be found in the Subversion repository:
;     packages\win32-innosetup\tools\templates
; Copy svn_dynamics.iss to the same folder as this file and read the
; documentation inside it.
#include "svn_dynamics.iss"

AppName=Subversion
AppVerName=Subversion-{#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
AppPublisher=CollabNet
AppPublisherURL=http://subversion.tigris.org/
AppSupportURL=http://subversion.tigris.org/project_faq.html
AppUpdatesURL=http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
DefaultDirName={pf}\Subversion
DefaultGroupName=Subversion
LicenseFile={#= path_setup_in}\subversion\SubversionLicense.txt
OutputDir={#= path_setup_out}
OutputBaseFilename=svn-{#= svn_version}-setup
Compression=lzma
InternalCompressLevel=max
SolidCompression=true
AppCopyright={#= svn_cpr}
UninstallDisplayIcon={app}\bin\svn.exe
UninstallDisplayName=Subversion {#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
AlwaysShowDirOnReadyPage=true
AlwaysShowGroupOnReadyPage=true
InfoAfterFile=Post.rtf
InfoBeforeFile=Pre.rtf
DisableStartupPrompt=false
UseSetupLdr=true
AppVersion={#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
VersionInfoVersion={#= svn_version}
VersionInfoDescription=Subversion-{#= svn_version} Windows Setup
WizardImageFile=images\wiz-164x314x24.bmp
WizardSmallImageFile=images\wiz-55x55x24.bmp
RestartIfNeededByRun=false
ShowTasksTreeLines=true
AllowNoIcons=true
ShowLanguageDialog=no
ChangesEnvironment=true

[Tasks]
Name: desktopicon; Description: Create &desktop icon for the Subversion documentation; GroupDescription: Desktop icons:
Name: quicklaunchicon; Description: Create &Quick Launch icon for the Subversion Documentation; GroupDescription: Quick Launch icons:; MinVersion: 4.01.1998,5.00.2195
Name: apachehandler; Description: Install and configure Subversion modules (the Setup will do a stop/uninstall/configure/install/start cycle of the Apache service); GroupDescription: Apache modules:; MinVersion: 0,4.0.1381; Check: ApacheTask

[Files]
; Subversion files --------------------------------------------------------------
Source: in\subversion\Readme.dist; DestDir: {app}; DestName: Readme.txt
Source: W32notes.txt; DestDir: {app}
Source: {#= path_setup_in}\subversion\svn-proxy-template.reg; DestDir: {app}; Flags: ignoreversion
Source: {#= path_svn}\README.txt; DestDir: {app}; DestName: Buildnotes.txt
Source: {#= path_svnclient}\svn.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnsync}\svnsync.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnadmin}\svnadmin.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnlook}\svnlook.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnserve}\svnserve.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnversion}\svnversion.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svndumpfilter}\svndumpfilter.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_brkdb_dll}\{#= libdb_dll}; DestDir: {app}\bin
Source: {#= path_iconv}\*.so; DestDir: {app}\iconv; Flags: ignoreversion
#ifdef inc_locale
Source: {#= path_locale}\*.*; DestDir: {app}\share\locale; Flags: ignoreversion recursesubdirs
#endif
Source: {#= path_setup_in}\berkeley\BerkeleyLicense.txt; DestDir: {app}
Source: {#= path_setup_in}\doc\svn-book.chm; DestDir: {app}\doc

; APR DLLs
Source: {#= path_libapr_dll}\libapr.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_libaprutil_dll}\libaprutil.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_libapriconv_dll}\libapriconv.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_intl_dll}\intl3_svn.dll; DestDir: {app}\bin; Flags: ignoreversion

; VC7 Runtime
#ifdef VC7
Source: {#= path_msvcr70_dll}\msvcr70.dll; DestDir: {app}\bin
#endif

;SSL
Source: {#= path_ssl}\libeay32.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_ssl}\ssleay32.dll; DestDir: {app}\bin; Flags: ignoreversion

; Missing stuff
Source: missing_msvcp60dll.html; DestDir: {app}\doc; Check: VCRuntimeNotFound
Source: missing_shfolderdll.html; DestDir: {app}\doc; Check: ShFolderDllNotFound

; httpd modules
Source: {#= path_davsvn}\mod_dav_svn.so; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_authzsvn}\mod_authz_svn.so; DestDir: {app}\bin; Flags: ignoreversion

;Helpers ---------------------------------------------------------------------
Source: {#= path_svnpath}\svnpath.exe; DestDir: {app}\helpers; Flags: ignoreversion
Source: UninsHs.exe; DestDir: {app}; Flags: restartreplace

; Debug symbols;
#ifdef inc_dbgsyms
Source: {#= path_svnclient_pdb}\svn.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnsync_pdb}\svnsync.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnadmin_pdb}\svnadmin.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnlook_pdb}\svnlook.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnserve_pdb}\svnserve.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnversion_pdb}\svnversion.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svndumpfilter_pdb}\svndumpfilter.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb

Source: {#= path_davsvn_pdb}\mod_dav_svn.pdb; DestDir: {app}\httpd; Flags: ignoreversion; Components: pdb
Source: {#= path_authzsvn_pdb}\mod_authz_svn.pdb; DestDir: {app}\httpd; Flags: ignoreversion; Components: pdb

Source: {#= path_iconv_pdb}\*.pdb; DestDir: {app}\iconv; Flags: ignoreversion; Components: pdb
#endif

; Internet Shortcuts ----------------------------------------------------------
Source: svn.url; DestDir: {app}

[INI]
Filename: {app}\svn.url; Section: InternetShortcut; Key: URL; String: http://subversion.tigris.org/

; Reinstall, repair and uninstall with UninsHS
FileName: {app}\UninsHs.dat; Section: Common; Key: Software; String: Subversion
FileName: {app}\UninsHs.dat; Section: Common; Key: Install; String: {srcexe}

FileName: {app}\UninsHs.dat; Section: Common; Key: Language; String: {language}
FileName: {app}\UninsHs.dat; Section: Common; Key: Remove; String: {uninstallexe}
FileName: {app}\UninsHs.dat; Section: Common; Key: Group; String: {groupname}
FileName: {app}\UninsHs.dat; Section: Common; Key: Components; String: {code:ComponentList|x}

[Icons]
Name: {group}\Subversion on the Web; Filename: {app}\svn.url
Name: {group}\Uninstall Subversion; Filename: {app}\UninsHs.exe
Name: {group}\Licenses\Subversion; Filename: {app}\SubversionLicense.txt
Name: {group}\Licenses\Berkeley DB Licence; Filename: {app}\BerkeleyLicense.txt
Name: {group}\Subversion Documentation; Filename: {app}\doc\svn-book.chm; IconFilename: {app}\bin\svn.exe; Comment: The standard Subversion documentation; IconIndex: 0
Name: {userdesktop}\Subversion Documentation; Filename: {app}\doc\svn-book.chm; IconFilename: {app}\bin\svn.exe; Comment: The standard Subversion documentation; IconIndex: 0; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Subversion Documentation; Filename: {app}\doc\svn-book.chm; Comment: The standard Subversion Documentation; IconFilename: {app}\bin\svn.exe; IconIndex: 0; MinVersion: 4.01.1998,5.00.2195; Tasks: quicklaunchicon
Name: {group}\Read Me; Filename: {app}\Readme.txt
Name: {group}\Download and install msvcp60.dll; Filename: {app}\doc\missing_msvcp60dll.html; Check: VCRuntimeNotFound
Name: {group}\Download and install shfolder.dll; Filename: {app}\doc\missing_shfolderdll.html; Check: ShFolderDllNotFound

[UninstallDelete]
Type: files; Name: {app}\svn.url
Type: filesandordirs; Name: {app}\UninsHs.dat

[Types]
#ifdef inc_dbgsyms
Name: standard; Description: Standard installation - Binaries only
Name: full; Description: Full installation - Binaries and debugging symbols
Name: custom; Description: Custom Installation; Flags: iscustom

[Components]
Name: main; Description: Subversion application files; Types: standard custom full; Flags: disablenouninstallwarning
;or
;Name: main; Description: Subversion application files; Types: standard custom full; flags: fixed

Name: pdb; Description: Debug Symbol Files; Types: full custom; Flags: disablenouninstallwarning

[InstallDelete]

;If the "disablenouninstallwarning" flag is present for the "main" entry in [Components], use these lines:
Type: files; Name: {app}\Readme.txt
Type: files; Name: {app}\W32notes.txt
Type: files; Name: {app}\svn-proxy-template.reg
Type: files; Name: {app}\Buildnotes.txt
Type: files; Name: {app}\Buildnotes.txt
Type: filesandordirs; Name: {app}\bin
Type: filesandordirs; Name: {app}\iconv
#ifdef inc_locale
Type: filesandordirs; Name: {app}\share\locale
#endif
Type: files; Name: {app}\BerkeleyLicense.txt
Type: filesandordirs; Name: {app}\doc
Type: filesandordirs; Name: {app}\helpers
Type: filesandordirs; Name: {app}\httpd

;If add "fixed" flag to "main" in [Components], use these lines:
;Type: files; Name: {app}\svn.pdb
;Type: files; Name: {app}\svnsync.pdb
;Type: files; Name: {app}\svnadmin.pdb
;Type: files; Name: {app}\svnserve.pdb
;Type: files; Name: {app}\svnlook.pdb
;Type: files; Name: {app}\svnversion.pdb
;Type: files; Name: {app}\svndumpfilter.pdb
;Type: filesandordirs; Name: {app}\httpd
;Type: files; Name: {app}\iconv\*.pdb
#endif

[Registry]
Root: HKCU; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueData: {app}\bin\svn.exe; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueName: Path; ValueData: {app}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Version; ValueData: {#= svn_version}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Revision; ValueData: {#= svn_revision}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; Subkey: Environment; ValueType: string; ValueName: APR_ICONV_PATH; ValueData: {app}\iconv; Flags: uninsdeletevalue noerror

Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueData: {app}\bin\svn.exe; Flags: noerror uninsdeletekeyifempty uninsdeletevalue
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueName: Path; ValueData: {app}; Flags: uninsdeletekeyifempty uninsdeletevalue noerror
Root: HKLM; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Version; ValueData: {#= svn_version}; Flags: noerror uninsdeletekey
Root: HKLM; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Revision; ValueData: {#= svn_revision}; Flags: uninsdeletevalue noerror uninsdeletekeyifempty
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: APR_ICONV_PATH; ValueData: {app}\iconv; Flags: uninsdeletevalue noerror

[Run]
Filename: {app}\helpers\svnpath.exe; Parameters: "add ""{app}\bin"""; StatusMsg: Editing the path...
Filename: {app}\UninsHs.exe; Parameters: /r; Flags: runminimized runhidden nowait

[UninstallRun]
Filename: {app}\helpers\svnpath.exe; Parameters: "remove ""{app}\bin"""

[Languages]
Name: en; MessagesFile: compiler:Default.isl

[Code]
#include "is_main.pas"

[Setup]
;# Version parameters #########################################################
#define svn_cpr "Copyright 2000-2005 CollabNet"

; Version and release info:
#include "svn_version.iss"

;# svn_dynamics.iss ###########################################################
; This file contains all the paths needed by inno for finding the sources to
; compile a Windows Setup for Subversion.
; A template of the file can be found in the Subversion repository:
;     packages\win32-innosetup\tools\templates
; Copy svn_dynamics.iss to the same folder as this file and read the
; documentation inside it.
#include "svn_dynamics.iss"

AppName=Subversion
AppVerName=Subversion-{#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
AppPublisher=CollabNet
AppPublisherURL=http://subversion.tigris.org/
AppSupportURL=http://subversion.tigris.org/project_faq.html
AppUpdatesURL=http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
DefaultDirName={pf}\Subversion
DefaultGroupName=Subversion
LicenseFile={#= path_setup_in}\subversion\SubversionLicense.txt
OutputDir={#= path_setup_out}
OutputBaseFilename=svn-{#= svn_version}-setup
Compression=lzma
InternalCompressLevel=max
SolidCompression=true
AppCopyright={#= svn_cpr}
UninstallDisplayIcon={app}\bin\svn.exe
UninstallDisplayName=Subversion {#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
AlwaysShowDirOnReadyPage=true
AlwaysShowGroupOnReadyPage=true
InfoAfterFile=Post.rtf
InfoBeforeFile=Pre.rtf
DisableStartupPrompt=false
UseSetupLdr=true
AppVersion={#= svn_version}{#= svn_pretxtrevision}{#= svn_revision}
VersionInfoVersion={#= svn_version}
VersionInfoDescription=Subversion-{#= svn_version} Windows Setup
WizardImageFile=images\wiz-164x314x24.bmp
WizardSmallImageFile=images\wiz-55x55x24.bmp
RestartIfNeededByRun=false
ShowTasksTreeLines=true
AllowNoIcons=true
ShowLanguageDialog=no
ChangesEnvironment=true

[Tasks]
Name: desktopicon; Description: Create &desktop icon for the Subversion documentation; GroupDescription: Desktop icons:
Name: quicklaunchicon; Description: Create &Quick Launch icon for the Subversion Documentation; GroupDescription: Quick Launch icons:; MinVersion: 4.01.1998,5.00.2195
Name: apachehandler; Description: Install and configure Subversion modules (the Setup will do a stop/uninstall/configure/install/start cycle of the Apache service); GroupDescription: Apache modules:; MinVersion: 0,4.0.1381; Check: ApacheTask

[Files]
; Subversion files --------------------------------------------------------------
Source: in\subversion\Readme.dist; DestDir: {app}; DestName: Readme.txt
Source: W32notes.txt; DestDir: {app}
Source: {#= path_setup_in}\subversion\svn-proxy-template.reg; DestDir: {app}; Flags: ignoreversion
Source: {#= path_svn}\README.txt; DestDir: {app}; DestName: Buildnotes.txt
Source: {#= path_svnclient}\svn.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnsync}\svnsync.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnadmin}\svnadmin.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnlook}\svnlook.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnserve}\svnserve.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svnversion}\svnversion.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_svndumpfilter}\svndumpfilter.exe; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_brkdb_dll}\{#= libdb_dll}; DestDir: {app}\bin
Source: {#= path_iconv}\*.so; DestDir: {app}\iconv; Flags: ignoreversion
#ifdef inc_locale
Source: {#= path_locale}\*.*; DestDir: {app}\share\locale; Flags: ignoreversion recursesubdirs
#endif
Source: {#= path_setup_in}\berkeley\BerkeleyLicense.txt; DestDir: {app}
Source: {#= path_setup_in}\doc\svn-book.chm; DestDir: {app}\doc

; APR DLLs
Source: {#= path_libapr_dll}\libapr.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_libaprutil_dll}\libaprutil.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_libapriconv_dll}\libapriconv.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_intl_dll}\intl3_svn.dll; DestDir: {app}\bin; Flags: ignoreversion

; VC7 Runtime
#ifdef VC7
Source: {#= path_msvcr70_dll}\msvcr70.dll; DestDir: {app}\bin
#endif

;SSL
Source: {#= path_ssl}\libeay32.dll; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_ssl}\ssleay32.dll; DestDir: {app}\bin; Flags: ignoreversion

; Missing stuff
Source: missing_msvcp60dll.html; DestDir: {app}\doc; Check: VCRuntimeNotFound
Source: missing_shfolderdll.html; DestDir: {app}\doc; Check: ShFolderDllNotFound

; httpd modules
Source: {#= path_davsvn}\mod_dav_svn.so; DestDir: {app}\bin; Flags: ignoreversion
Source: {#= path_authzsvn}\mod_authz_svn.so; DestDir: {app}\bin; Flags: ignoreversion

;Helpers ---------------------------------------------------------------------
Source: {#= path_svnpath}\svnpath.exe; DestDir: {app}\helpers; Flags: ignoreversion
Source: UninsHs.exe; DestDir: {app}; Flags: restartreplace

; Debug symbols;
#ifdef inc_dbgsyms
Source: {#= path_svnclient_pdb}\svn.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnsync_pdb}\svnsync.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnadmin_pdb}\svnadmin.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnlook_pdb}\svnlook.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnserve_pdb}\svnserve.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svnversion_pdb}\svnversion.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb
Source: {#= path_svndumpfilter_pdb}\svndumpfilter.pdb; DestDir: {app}\bin; Flags: ignoreversion; Components: pdb

Source: {#= path_davsvn_pdb}\mod_dav_svn.pdb; DestDir: {app}\httpd; Flags: ignoreversion; Components: pdb
Source: {#= path_authzsvn_pdb}\mod_authz_svn.pdb; DestDir: {app}\httpd; Flags: ignoreversion; Components: pdb

Source: {#= path_iconv_pdb}\*.pdb; DestDir: {app}\iconv; Flags: ignoreversion; Components: pdb
#endif

; Internet Shortcuts ----------------------------------------------------------
Source: svn.url; DestDir: {app}

[INI]
Filename: {app}\svn.url; Section: InternetShortcut; Key: URL; String: http://subversion.tigris.org/

; Reinstall, repair and uninstall with UninsHS
FileName: {app}\UninsHs.dat; Section: Common; Key: Software; String: Subversion
FileName: {app}\UninsHs.dat; Section: Common; Key: Install; String: {srcexe}

FileName: {app}\UninsHs.dat; Section: Common; Key: Language; String: {language}
FileName: {app}\UninsHs.dat; Section: Common; Key: Remove; String: {uninstallexe}
FileName: {app}\UninsHs.dat; Section: Common; Key: Group; String: {groupname}
FileName: {app}\UninsHs.dat; Section: Common; Key: Components; String: {code:ComponentList|x}

[Icons]
Name: {group}\Subversion on the Web; Filename: {app}\svn.url
Name: {group}\Uninstall Subversion; Filename: {app}\UninsHs.exe
Name: {group}\Licenses\Subversion; Filename: {app}\SubversionLicense.txt
Name: {group}\Licenses\Berkeley DB Licence; Filename: {app}\BerkeleyLicense.txt
Name: {group}\Subversion Documentation; Filename: {app}\doc\svn-book.chm; IconFilename: {app}\bin\svn.exe; Comment: The standard Subversion documentation; IconIndex: 0
Name: {userdesktop}\Subversion Documentation; Filename: {app}\doc\svn-book.chm; IconFilename: {app}\bin\svn.exe; Comment: The standard Subversion documentation; IconIndex: 0; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Subversion Documentation; Filename: {app}\doc\svn-book.chm; Comment: The standard Subversion Documentation; IconFilename: {app}\bin\svn.exe; IconIndex: 0; MinVersion: 4.01.1998,5.00.2195; Tasks: quicklaunchicon
Name: {group}\Read Me; Filename: {app}\Readme.txt
Name: {group}\Download and install msvcp60.dll; Filename: {app}\doc\missing_msvcp60dll.html; Check: VCRuntimeNotFound
Name: {group}\Download and install shfolder.dll; Filename: {app}\doc\missing_shfolderdll.html; Check: ShFolderDllNotFound

[UninstallDelete]
Type: files; Name: {app}\svn.url
Type: filesandordirs; Name: {app}\UninsHs.dat

[Types]
#ifdef inc_dbgsyms
Name: standard; Description: Standard installation - Binaries only
Name: full; Description: Full installation - Binaries and debugging symbols
Name: custom; Description: Custom Installation; Flags: iscustom

[Components]
Name: main; Description: Subversion application files; Types: standard custom full; Flags: disablenouninstallwarning
;or
;Name: main; Description: Subversion application files; Types: standard custom full; flags: fixed

Name: pdb; Description: Debug Symbol Files; Types: full custom; Flags: disablenouninstallwarning

[InstallDelete]

;If the "disablenouninstallwarning" flag is present for the "main" entry in [Components], use these lines:
Type: files; Name: {app}\Readme.txt
Type: files; Name: {app}\W32notes.txt
Type: files; Name: {app}\svn-proxy-template.reg
Type: files; Name: {app}\Buildnotes.txt
Type: files; Name: {app}\Buildnotes.txt
Type: filesandordirs; Name: {app}\bin
Type: filesandordirs; Name: {app}\iconv
#ifdef inc_locale
Type: filesandordirs; Name: {app}\share\locale
#endif
Type: files; Name: {app}\BerkeleyLicense.txt
Type: filesandordirs; Name: {app}\doc
Type: filesandordirs; Name: {app}\helpers
Type: filesandordirs; Name: {app}\httpd

;If add "fixed" flag to "main" in [Components], use these lines:
;Type: files; Name: {app}\svn.pdb
;Type: files; Name: {app}\svnsync.pdb
;Type: files; Name: {app}\svnadmin.pdb
;Type: files; Name: {app}\svnserve.pdb
;Type: files; Name: {app}\svnlook.pdb
;Type: files; Name: {app}\svnversion.pdb
;Type: files; Name: {app}\svndumpfilter.pdb
;Type: filesandordirs; Name: {app}\httpd
;Type: files; Name: {app}\iconv\*.pdb
#endif

[Registry]
Root: HKCU; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueData: {app}\bin\svn.exe; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueName: Path; ValueData: {app}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Version; ValueData: {#= svn_version}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Revision; ValueData: {#= svn_revision}; Flags: uninsdeletekeyifempty uninsdeletevalue
Root: HKCU; Subkey: Environment; ValueType: string; ValueName: APR_ICONV_PATH; ValueData: {app}\iconv; Flags: uninsdeletevalue noerror

Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueData: {app}\bin\svn.exe; Flags: noerror uninsdeletekeyifempty uninsdeletevalue
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\svn.exe; ValueType: string; ValueName: Path; ValueData: {app}; Flags: uninsdeletekeyifempty uninsdeletevalue noerror
Root: HKLM; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Version; ValueData: {#= svn_version}; Flags: noerror uninsdeletekey
Root: HKLM; SubKey: SOFTWARE\Tigris.org\Subversion; ValueType: string; ValueName: Revision; ValueData: {#= svn_revision}; Flags: uninsdeletevalue noerror uninsdeletekeyifempty
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: APR_ICONV_PATH; ValueData: {app}\iconv; Flags: uninsdeletevalue noerror

[Run]
Filename: {app}\helpers\svnpath.exe; Parameters: "add ""{app}\bin"""; StatusMsg: Editing the path...
Filename: {app}\UninsHs.exe; Parameters: /r; Flags: runminimized runhidden nowait

[UninstallRun]
Filename: {app}\helpers\svnpath.exe; Parameters: "remove ""{app}\bin"""

[Languages]
Name: en; MessagesFile: compiler:Default.isl

[Code]
#include "is_main.pas"


version bump for docker 0.10, b2d.iso 0.8.0, b2d-cli 0.8.0

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

#define MyAppName "Boot2Docker for Windows"
#define MyAppVersion "0.2"
#define MyAppPublisher "Boot2Docker"
#define MyAppURL "http://boot2docker.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={{05BD04E9-4AB5-46AC-891E-60EA8FD57D56}
AppCopyright=Docker Project
AppContact=Sven Dowideit <SvenDowideit@docker.com>
AppComments=http://boot2docker.io/
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName=Boot 2 Docker
InfoBeforeFile=C:\Users\svend_000\windows-installer\LICENSE
OutputBaseFilename=boot2docker-install
Compression=lzma
SolidCompression=yes
WizardImageFile=logo-docker-side.bmp
WizardSmallImageFile=logo-docker-small.bmp

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

[Files]
Source: "C:\Users\svend_000\windows-installer\Boot2Docker\boot2docker.iso"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\Boot2Docker\boot2docker-cli.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "C:\Users\svend_000\windows-installer\Boot2Docker\profile"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\start.sh"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\delete.sh"; DestDir: "{app}"; Flags: ignoreversion

; msys-Git
Source: "C:\Users\svend_000\windows-installer\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; Flags: ignoreversion

;VirtualBox - 64 bit only
;https://forums.virtualbox.org/viewtopic.php?f=3&t=21127
Source: "C:\Users\svend_000\windows-installer\VirtualBox\VirtualBox-4.3.8-r92456-MultiArch_amd64.msi"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\VirtualBox\common.cab"; DestDir: "{app}"; Flags: ignoreversion

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Boot2Docker Shell"; WorkingDir: "{app}"; Filename: "{app}\start.sh"
Name: "{group}\Boot2Docker Delete"; WorkingDir: "{app}"; Filename: "{app}\delete.sh"
Name: "{group}\MSYS Bash"; Filename: "C:\Program Files (x86)\Git\bin\sh.exe"; Parameters: "--login -i"; Flags: dontcloseonexit

[Run]
; http://unattended.sourceforge.net/installers.php
Description: "Install MSYS-git UNIX-like environment (Required)"; Filename: "{app}\Git-1.9.0-preview20140217.exe"; Flags: postinstall
; Parameters: "/sp- /silent /norestart"
Description: "Install VirtualBox virtualisation (Required)"; Filename: "msiexec"; Parameters: "/i ""{app}\VirtualBox-4.3.8-r92456-MultiArch_amd64.msi"""; Flags: postinstall

[UninstallRun]
Filename: "{app}\delete.sh"

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

#define MyAppName "Boot2Docker for Windows"
#define MyAppVersion "0.1"
#define MyAppPublisher "Boot2Docker"
#define MyAppURL "http://boot2docker.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={{05BD04E9-4AB5-46AC-891E-60EA8FD57D56}
AppCopyright=Docker Project
AppContact=Sven Dowideit <SvenDowideit@docker.com>
AppComments=http://boot2docker.io/
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName=Boot 2 Docker
InfoBeforeFile=C:\Users\svend_000\windows-installer\LICENSE
OutputBaseFilename=boot2docker-install
Compression=lzma
SolidCompression=yes
WizardImageFile=logo-docker-side.bmp
WizardSmallImageFile=logo-docker-small.bmp

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

[Files]
Source: "C:\Users\svend_000\windows-installer\Boot2Docker\boot2docker.iso"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\Boot2Docker\boot2docker-cli.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "C:\Users\svend_000\windows-installer\Boot2Docker\profile"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\start.sh"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\delete.sh"; DestDir: "{app}"; Flags: ignoreversion

; msys-Git
Source: "C:\Users\svend_000\windows-installer\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; Flags: ignoreversion

;VirtualBox - 64 bit only
;https://forums.virtualbox.org/viewtopic.php?f=3&t=21127
Source: "C:\Users\svend_000\windows-installer\VirtualBox\VirtualBox-4.3.8-r92456-MultiArch_amd64.msi"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\svend_000\windows-installer\VirtualBox\common.cab"; DestDir: "{app}"; Flags: ignoreversion

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Boot2Docker Shell"; WorkingDir: "{app}"; Filename: "{app}\start.sh"
Name: "{group}\Boot2Docker Delete"; WorkingDir: "{app}"; Filename: "{app}\delete.sh"
Name: "{group}\MSYS Bash"; Filename: "C:\Program Files (x86)\Git\bin\sh.exe"; Parameters: "--login -i"; Flags: dontcloseonexit

[Run]
; http://unattended.sourceforge.net/installers.php
Description: "Install MSYS-git UNIX-like environment (Required)"; Filename: "{app}\Git-1.9.0-preview20140217.exe"; Flags: postinstall
; Parameters: "/sp- /silent /norestart"
Description: "Install VirtualBox virtualisation (Required)"; Filename: "msiexec"; Parameters: "/i ""{app}\VirtualBox-4.3.8-r92456-MultiArch_amd64.msi"""; Flags: postinstall

[UninstallRun]
Filename: "{app}\delete.sh"


innosetup: Add i2pd to PATH

innosetup: Add i2pd to PATH

#define I2Pd_AppName "i2pd"
#define I2Pd_ver "0.2"

[Setup]
AppName={#I2Pd_AppName}
AppVersion={#I2Pd_ver}
DefaultDirName={pf}\I2Pd
DefaultGroupName=I2Pd
UninstallDisplayIcon={app}\I2Pd.exe
Compression=lzma2
SolidCompression=yes
OutputDir=.
LicenseFile=.\..\LICENSE
OutputBaseFilename=setup_{#I2Pd_AppName}_v{#I2Pd_ver}
ArchitecturesInstallIn64BitMode=x64

[Files]
Source: "x64\Release\i2pd.exe"; DestDir: "{app}"; DestName: "i2pd.exe"; Check: Is64BitInstallMode
Source: "Release\i2pd.exe"; DestDir: "{app}"; Check: not Is64BitInstallMode
Source: "..\README.md"; DestDir: "{app}"; DestName: "Readme.txt"; AfterInstall: ConvertLineEndings

[Icons]
Name: "{group}\I2Pd"; Filename: "{app}\i2pd.exe"
Name: "{group}\Readme"; Filename: "{app}\Readme.txt"

[Registry]
Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app};{olddata}"; Check: NotOnPathAlready(); Flags: preservestringtype;

[Code]

var
  DefaultTop,
  DefaultLeft,
  DefaultHeight,
  DefaultBackTop,
  DefaultNextTop,
  DefaultCancelTop,
  DefaultBevelTop,
  DefaultOuterHeight: Integer;

const
  LicenseHeight = 400;
   LF = #10;
   CR = #13;
   CRLF = CR + LF;

procedure ConvertLineEndings();
  var
     FilePath : String;
     FileContents : String;
begin
   FilePath := ExpandConstant(CurrentFileName)
   LoadStringFromFile(FilePath, FileContents);
   StringChangeEx(FileContents, LF, CRLF, False);
   SaveStringToFile(FilePath, FileContents, False);
end;

procedure InitializeWizard();
begin
  DefaultTop := WizardForm.Top;
  DefaultLeft := WizardForm.Left;
  DefaultHeight := WizardForm.Height;
  DefaultBackTop := WizardForm.BackButton.Top;
  DefaultNextTop := WizardForm.NextButton.Top;
  DefaultCancelTop := WizardForm.CancelButton.Top;
  DefaultBevelTop := WizardForm.Bevel.Top;
  DefaultOuterHeight := WizardForm.OuterNotebook.Height;

  WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (LicenseHeight - DefaultHeight);
  WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (LicenseHeight - DefaultHeight);

end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpLicense then
  begin
    WizardForm.Top := DefaultTop - (LicenseHeight - DefaultHeight) div 2;
    WizardForm.Height := LicenseHeight;
    WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (LicenseHeight - DefaultHeight);
    WizardForm.CancelButton.Top := DefaultCancelTop + (LicenseHeight - DefaultHeight);
    WizardForm.NextButton.Top := DefaultNextTop + (LicenseHeight - DefaultHeight);
    WizardForm.BackButton.Top := DefaultBackTop + (LicenseHeight - DefaultHeight);
    WizardForm.Bevel.Top := DefaultBevelTop + (LicenseHeight - DefaultHeight);
  end
  else
  begin
    WizardForm.Top := DefaultTop;
    WizardForm.Left := DefaultLeft;
    WizardForm.Height := DefaultHeight;
    WizardForm.OuterNotebook.Height := DefaultOuterHeight;
    WizardForm.CancelButton.Top := DefaultCancelTop;
    WizardForm.NextButton.Top := DefaultNextTop;
    WizardForm.BackButton.Top := DefaultBackTop;
    WizardForm.Bevel.Top := DefaultBevelTop;
  end;
end;

function NotOnPathAlready(): Boolean;
var
  BinDir, Path: String;
begin
  Log('Checking if i2pd dir is already in the %PATH%');
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Path) then
  begin // Successfully read the value
    Log('HKCUEnvironmentPATH = ' + Path);
    BinDir := ExpandConstant('{app}');
    Log('Looking for i2pd dir in %PATH%: ' + BinDir + ' in ' + Path);
    if Pos(LowerCase(BinDir), Lowercase(Path)) = 0 then
    begin
      Log('Did not find i2pd dir in %PATH% so I will add it');
      Result := True;
    end
    else
    begin
      Log('Found i2pd dir in %PATH% so will not add it again');
      Result := False;
    end
  end
  else // The key probably doesn't exist
  begin
    Log('Could not access HKCUEnvironmentPATH so I assume that it is OK to add it');
    Result := True;
  end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
  BinDir, Path: String;
begin
  if (CurUninstallStep = usPostUninstall)
     and (RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'PATH', Path)) then
  begin
    BinDir := ExpandConstant('{app}');
    if Pos(LowerCase(BinDir) + ';', Lowercase(Path)) <> 0 then
    begin
      StringChange(Path, BinDir + ';', '');
      RegWriteStringValue(HKEY_CURRENT_USER, 'Environment', 'PATH', Path);
    end;
  end;
end;

#define I2Pd_AppName "i2pd"
#define I2Pd_ver "0.2"

[Setup]
AppName={#I2Pd_AppName}
AppVersion={#I2Pd_ver}
DefaultDirName={pf}\I2Pd
DefaultGroupName=I2Pd
UninstallDisplayIcon={app}\I2Pd.exe
Compression=lzma2
SolidCompression=yes
OutputDir=.
LicenseFile=.\..\LICENSE
OutputBaseFilename=setup_{#I2Pd_AppName}_v{#I2Pd_ver}
ArchitecturesInstallIn64BitMode=x64

[Files]
Source: "x64\Release\i2pd.exe"; DestDir: "{app}"; DestName: "i2pd.exe"; Check: Is64BitInstallMode
Source: "Release\i2pd.exe"; DestDir: "{app}"; Check: not Is64BitInstallMode
Source: "..\README.md"; DestDir: "{app}"; DestName: "Readme.txt"; AfterInstall: ConvertLineEndings

[Icons]
Name: "{group}\I2Pd"; Filename: "{app}\i2pd.exe"
Name: "{group}\Readme"; Filename: "{app}\Readme.txt"

[Code]

var
  DefaultTop,
  DefaultLeft,
  DefaultHeight,
  DefaultBackTop,
  DefaultNextTop,
  DefaultCancelTop,
  DefaultBevelTop,
  DefaultOuterHeight: Integer;

const
  LicenseHeight = 400;
   LF = #10;
   CR = #13;
   CRLF = CR + LF;

procedure ConvertLineEndings();
  var
     FilePath : String;
     FileContents : String;
begin
   FilePath := ExpandConstant(CurrentFileName)
   LoadStringFromFile(FilePath, FileContents);
   StringChangeEx(FileContents, LF, CRLF, False);
   SaveStringToFile(FilePath, FileContents, False);
end;

procedure InitializeWizard();
begin
  DefaultTop := WizardForm.Top;
  DefaultLeft := WizardForm.Left;
  DefaultHeight := WizardForm.Height;
  DefaultBackTop := WizardForm.BackButton.Top;
  DefaultNextTop := WizardForm.NextButton.Top;
  DefaultCancelTop := WizardForm.CancelButton.Top;
  DefaultBevelTop := WizardForm.Bevel.Top;
  DefaultOuterHeight := WizardForm.OuterNotebook.Height;

  WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (LicenseHeight - DefaultHeight);
  WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (LicenseHeight - DefaultHeight);
  WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (LicenseHeight - DefaultHeight);

end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpLicense then
  begin
    WizardForm.Top := DefaultTop - (LicenseHeight - DefaultHeight) div 2;
    WizardForm.Height := LicenseHeight;
    WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (LicenseHeight - DefaultHeight);
    WizardForm.CancelButton.Top := DefaultCancelTop + (LicenseHeight - DefaultHeight);
    WizardForm.NextButton.Top := DefaultNextTop + (LicenseHeight - DefaultHeight);
    WizardForm.BackButton.Top := DefaultBackTop + (LicenseHeight - DefaultHeight);
    WizardForm.Bevel.Top := DefaultBevelTop + (LicenseHeight - DefaultHeight);
  end
  else
  begin
    WizardForm.Top := DefaultTop;
    WizardForm.Left := DefaultLeft;
    WizardForm.Height := DefaultHeight;
    WizardForm.OuterNotebook.Height := DefaultOuterHeight;
    WizardForm.CancelButton.Top := DefaultCancelTop;
    WizardForm.NextButton.Top := DefaultNextTop;
    WizardForm.BackButton.Top := DefaultBackTop;
    WizardForm.Bevel.Top := DefaultBevelTop;
  end;
end;