Final installer tweaks for 0.2.1.

Final installer tweaks for 0.2.1.

; Copyright (c) 2009 SlimDX Group
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.

[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={{72513408-FD69-404F-9FDB-2DB6A7DCDE84}
AppName=SlimTune Profiler
AppVerName=SlimTune Profiler v0.2.1
AppPublisher=SlimDX Group
AppPublisherURL=http://www.slimtune.com/
AppSupportURL=http://www.slimtune.com/
AppUpdatesURL=http://www.slimtune.com/
DefaultDirName={pf}\SlimTune Profiler
DefaultGroupName=SlimTune Profiler
LicenseFile=..\ExtraFiles\License.rtf
OutputDir=.
OutputBaseFilename=SlimTune-0.2.1
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=yes
MinVersion=0,5.01
VersionInfoVersion=0.2.1.0
VersionInfoCompany=SlimDX Group
VersionInfoCopyright=Copyright  SlimDX Group 2010
VersionInfoProductName=SlimTune Profiler v0.2.1

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

[Files]
Source: "..\ExtraFiles\x86\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion; AfterInstall: InstallVCRedist('x86')
Source: "..\ExtraFiles\x64\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion; Check: IsWin64; AfterInstall: InstallVCRedist('x64')

Source: "..\publish\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\publish\Backends\x86\SlimTuneCLR.dll"; DestDir: "{app}\Backends\x86"; Flags: 32bit regserver ignoreversion
Source: "..\publish\Backends\x64\SlimTuneCLR.dll"; DestDir: "{app}\Backends\x64"; Check: IsWin64; Flags: 64bit regserver ignoreversion

Source: "..\publish\Backends\*"; DestDir: "{app}\Backends"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\publish\Plugins\*"; DestDir: "{app}\Plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\publish\Api\*"; DestDir: "{app}\Api"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "..\ExtraFiles\x86\SSCERuntime-ENU-x86.msi"; DestDir: "{tmp}"; Flags: ignoreversion

[Registry]
Root: HKLM; Subkey: "Software\SlimDX Group"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; ValueType: string; ValueName: "PluginsPath"; ValueData: "{app}\Plugins"

[Icons]
Name: "{group}\SlimTune Profiler"; Filename: "{app}\SlimTuneUI.exe"
Name: "{group}\SlimTune Help"; Filename: "{app}\SlimTune.chm"
Name: "{group}\{cm:UninstallProgram,SlimTune Profiler}"; Filename: "{uninstallexe}"

[Tasks]
Name: Firewall; Description: "Open TCP subnet ports 3000 - 3001 in Windows Firewall"; GroupDescription: "Firewall:"; MinVersion: 0,5.01.2600sp2;

[Run]
Filename: "msiexec.exe"; Parameters: "/passive /i ""{tmp}\SSCERuntime-ENU-x86.msi"""; StatusMsg: "Installing SQL Server Compact Edition"
Filename: "{sys}\netsh.exe"; Parameters: "firewall add portopening TCP 3000 ""SlimTune Profiler (3000)"" ENABLE SUBNET"; Flags: runhidden; Tasks: Firewall;
Filename: "{sys}\netsh.exe"; Parameters: "firewall add portopening TCP 3001 ""SlimTune Profiler (3001)"" ENABLE SUBNET"; Flags: runhidden; Tasks: Firewall;

Filename: "{app}\SlimTuneUI.exe"; Description: "{cm:LaunchProgram,SlimTune Profiler}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete portopening TCP 3000"; Flags: runhidden; MinVersion:0,5.01.2600sp2; Tasks: Firewall;
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete portopening TCP 3001"; Flags: runhidden; MinVersion:0,5.01.2600sp2; Tasks: Firewall;

[Code]
function IsX64: Boolean;
begin
  Result := IsWin64 and (ProcessorArchitecture = paX64);
end;

function InitializeSetup(): Boolean;
var
  NetFrameWorkInstalled : Boolean;
begin
  NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
  if NetFrameWorkInstalled then
  begin
    Result := true;
  end else
  begin
    MsgBox('This setup requires the .NET Framework 2.0 or later. Please download and install the .NET Framework and run this setup again.',
      mbConfirmation, MB_OK);
    Result:=false;
  end;
end;

procedure InstallVCRedist(arch: String);
var
  TempDir:      String;
  RedistPath:   String;
  ReturnCode:   Integer;
begin
  TempDir := ExpandConstant('{tmp}');
  RedistPath := TempDir + '\vcredist_' + arch + '.exe';

  Exec(RedistPath, '/qb!', TempDir, SW_SHOW, ewWaitUntilTerminated, ReturnCode)
end;

; Copyright (c) 2009 SlimDX Group
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
; THE SOFTWARE.

[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={72513408-FD69-404F-9FDB-2DB6A7DCDE84}
AppName=SlimTune Profiler
AppVerName=SlimTune Profiler v0.2.1
AppPublisher=SlimDX Group
AppPublisherURL=http://www.slimtune.com/
AppSupportURL=http://www.slimtune.com/
AppUpdatesURL=http://www.slimtune.com/
DefaultDirName={pf}\SlimTune Profiler
DefaultGroupName=SlimTune Profiler
LicenseFile=..\ExtraFiles\License.rtf
OutputDir=.
OutputBaseFilename=SlimTune-0.2.1
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=yes
MinVersion=0,5.01
VersionInfoVersion=0.2.1.0
VersionInfoCompany=SlimDX Group
VersionInfoCopyright=Copyright  SlimDX Group 2010
VersionInfoProductName=SlimTune Profiler v0.2.1

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

[Files]
Source: "..\ExtraFiles\x86\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion; AfterInstall: InstallVCRedist('x86')
Source: "..\ExtraFiles\x64\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion; Check: IsWin64; AfterInstall: InstallVCRedist('x64')

Source: "..\publish\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\publish\Backends\x86\SlimTuneCLR.dll"; DestDir: "{app}\Backends\x86"; Flags: 32bit regserver ignoreversion
Source: "..\publish\Backends\x64\SlimTuneCLR.dll"; DestDir: "{app}\Backends\x64"; Check: IsWin64; Flags: 64bit regserver ignoreversion

Source: "..\publish\Backends\*"; DestDir: "{app}\Backends"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\publish\Plugins\*"; DestDir: "{app}\Plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\publish\Api\*"; DestDir: "{app}\Api"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "..\ExtraFiles\x86\SSCERuntime-ENU-x86.msi"; DestDir: "{tmp}"; Flags: ignoreversion

[Registry]
Root: HKLM; Subkey: "Software\SlimDX Group"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
Root: HKLM; Subkey: "Software\SlimDX Group\SlimTune"; ValueType: string; ValueName: "PluginsPath"; ValueData: "{app}\Plugins"

[Icons]
Name: "{group}\SlimTune Profiler"; Filename: "{app}\SlimTuneUI.exe"
Name: "{group}\{cm:UninstallProgram,SlimTune Profiler}"; Filename: "{uninstallexe}"

[Tasks]
Name: Firewall; Description: "Open TCP subnet ports 3000 - 3001 in Windows Firewall"; GroupDescription: "Firewall:"; MinVersion: 0,5.01.2600sp2;

[Run]
Filename: "msiexec.exe"; Parameters: "/passive /i ""{tmp}\SSCERuntime-ENU-x86.msi"""; StatusMsg: "Installing SQL Server Compact Edition"
Filename: "{sys}\netsh.exe"; Parameters: "firewall add portopening TCP 3000 ""SlimTune Profiler (3000)"" ENABLE SUBNET"; Flags: runhidden; Tasks: Firewall;
Filename: "{sys}\netsh.exe"; Parameters: "firewall add portopening TCP 3001 ""SlimTune Profiler (3001)"" ENABLE SUBNET"; Flags: runhidden; Tasks: Firewall;

Filename: "{app}\SlimTuneUI.exe"; Description: "{cm:LaunchProgram,SlimTune Profiler}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete portopening TCP 3000"; Flags: runhidden; MinVersion:0,5.01.2600sp2; Tasks: Firewall;
Filename: "{sys}\netsh.exe"; Parameters: "firewall delete portopening TCP 3001"; Flags: runhidden; MinVersion:0,5.01.2600sp2; Tasks: Firewall;

[Code]
function IsX64: Boolean;
begin
  Result := IsWin64 and (ProcessorArchitecture = paX64);
end;

function InitializeSetup(): Boolean;
var
  NetFrameWorkInstalled : Boolean;
begin
  NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
  if NetFrameWorkInstalled then
  begin
    Result := true;
  end else
  begin
    MsgBox('This setup requires the .NET Framework 2.0 or later. Please download and install the .NET Framework and run this setup again.',
      mbConfirmation, MB_OK);
    Result:=false;
  end;
end;

procedure InstallVCRedist(arch: String);
var
  TempDir:      String;
  RedistPath:   String;
  ReturnCode:   Integer;
begin
  TempDir := ExpandConstant('{tmp}');
  RedistPath := TempDir + '\vcredist_' + arch + '.exe';

  Exec(RedistPath, '/qb!', TempDir, SW_SHOW, ewWaitUntilTerminated, ReturnCode)
end;


Update setup

Update setup

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

[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={{C3666F4B-F306-4727-AEF6-539A1CD08300}
AppName=Parakeet
AppVersion=0.0.2
AppPublisher=Harpie
AppPublisherURL=https://github.com/Serasvatie/Parakeet
AppSupportURL=https://github.com/Serasvatie/Parakeet
AppUpdatesURL=https://github.com/Serasvatie/Parakeet
DefaultDirName={pf}\Parakeet
DisableProgramGroupPage=yes
OutputBaseFilename=ParakeetSetup
Compression=lzma
SolidCompression=yes

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

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

[Dirs]
Name: "{app}\en"
Name: "{app}\fr"

[Files]
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\net5.0-windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
;Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\FFManager.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\Manager.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\SManager.dll"; DestDir: "{app}"; Flags: ignoreversion
;Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\en\Parakeet.resources.dll"; DestDir: "{app}\en"; Flags: ignoreversion
;Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\fr\Parakeet.resources.dll"; DestDir: "{app}\fr"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\Parakeet"; Filename: "{app}\Parakeet.exe"
Name: "{commondesktop}\Parakeet"; Filename: "{app}\Parakeet.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\Parakeet.exe"; Description: "{cm:LaunchProgram,Parakeet}"; Flags: nowait postinstall skipifsilent

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

[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={{C3666F4B-F306-4727-AEF6-539A1CD08300}
AppName=Parakeet
AppVersion=0.0.2
AppPublisher=Harpie
AppPublisherURL=https://github.com/Serasvatie/Parakeet
AppSupportURL=https://github.com/Serasvatie/Parakeet
AppUpdatesURL=https://github.com/Serasvatie/Parakeet
DefaultDirName={pf}\Parakeet
DisableProgramGroupPage=yes
OutputBaseFilename=ParakeetSetup
Compression=lzma
SolidCompression=yes

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

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

[Dirs]
Name: "{app}\en"
Name: "{app}\fr"

[Files]
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\Parakeet.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\FFManager.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\Manager.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\SManager.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\en\Parakeet.resources.dll"; DestDir: "{app}\en"; Flags: ignoreversion
Source: "D:\Code\Parakeet\Parakeet\Parakeet\bin\Release\fr\Parakeet.resources.dll"; DestDir: "{app}\fr"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\Parakeet"; Filename: "{app}\Parakeet.exe"
Name: "{commondesktop}\Parakeet"; Filename: "{app}\Parakeet.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\Parakeet.exe"; Description: "{cm:LaunchProgram,Parakeet}"; Flags: nowait postinstall skipifsilent


Fixed merge conflicts

Fixed merge conflicts

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

[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={{DE3A8FE7-5918-471A-BF59-84C2C3328CCF}
AppName=AutoTest.Net
AppVersion=1.3.1
AppVerName=AutoTest.Net 1.3.1
AppPublisher=AutoTest.Net
DefaultDirName={pf}\AutoTest.Net
DefaultGroupName=AutoTest.Net
LicenseFile=..\ReleaseBinaries\AutoTest.License.txt
OutputDir=..\ReleaseBinaries\Installer
OutputBaseFilename=AutoTest.Net-v1.3.1
Compression=lzma
SolidCompression=yes
Uninstallable=yes

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

[Files]
Source: "..\ReleaseBinaries\AutoTest.Messages.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.UI.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.Console.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.License.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.WinForms.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\README"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\AutoTest.VS.Util.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2008.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2010.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2011.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\VSMenuKiller.exe"; DestDir: "{app}"; Flags: ignoreversion;

Source: "..\ReleaseBinaries\Icons\circleFAIL.png"; DestDir: "{app}\Icons"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Icons\circleWAIL.png"; DestDir: "{app}\Icons"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Icons\circleWIN.png"; DestDir: "{app}\Icons"; Flags: ignoreversion

Source: "..\ReleaseBinaries\AutoTest.TestRunner.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.v4.0.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.v4.0.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.v4.0.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.v4.0.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunners.Shared.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\NUnit\AutoTest.TestRunners.NUnit.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.core.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.core.interfaces.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.util.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\XUnit\AutoTest.TestRunners.XUnit.dll"; DestDir: "{app}\TestRunners\XUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\XUnit\xunit.runner.utility.dll"; DestDir: "{app}\TestRunners\XUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSTest\AutoTest.TestRunners.MSTest.dll"; DestDir: "{app}\TestRunners\MSTest"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSTest\celer.Core.dll"; DestDir: "{app}\TestRunners\MSTest"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSpec\AutoTest.TestRunners.MSpec.dll"; DestDir: "{app}\TestRunners\MSpec"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSpec\Machine.Specifications.dll"; DestDir: "{app}\TestRunners\MSpec"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSpec4\AutoTest.TestRunners.MSpec4.dll"; DestDir: "{app}\TestRunners\MSpec4"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSpec4\Machine.Specifications.dll"; DestDir: "{app}\TestRunners\MSpec4"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MbUnit\AutoTest.TestRunners.MbUnit.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\Gallio.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\Gallio.XmlSerializers.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\mbunit.config"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\Castle.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.Facilities.Logging.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.Windsor.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Mono.Cecil.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\src\AutoTest.Core\AutoTest.config.template.VS"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\progress.gif"; DestDir: "{app}"; Flags: ignoreversion

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

[Icons]
Name: "{group}\{cm:UninstallProgram,AutoTest.Net}"; Filename: "{uninstallexe}"

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue

[Run]
Filename:"{dotnet20}\RegAsm.exe"; Parameters: /codebase AutoTest.VSAddin.dll;WorkingDir: {app}; StatusMsg: "Registering Controls ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.11.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Installing 2011 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.10.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Installing 2010 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.9.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Installing 2008 addin ..."; Flags: runhidden;

[UninstallRun]
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.11.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2011 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.10.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2010 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.9.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2008 addin ..."; Flags: runhidden;
Filename:"{dotnet20}\RegAsm.exe"; Parameters: /unregister AutoTest.VSAddin.dll; WorkingDir: {app}; StatusMsg: "Unregistering Controls ..."; Flags: runhidden;

[Code]

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

[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={{DE3A8FE7-5918-471A-BF59-84C2C3328CCF}
AppName=AutoTest.Net
AppVersion=1.3.1
AppVerName=AutoTest.Net 1.3.1
AppPublisher=AutoTest.Net
DefaultDirName={pf}\AutoTest.Net
DefaultGroupName=AutoTest.Net
LicenseFile=..\ReleaseBinaries\AutoTest.License.txt
OutputDir=..\ReleaseBinaries\Installer
OutputBaseFilename=AutoTest.Net-v1.3.1
Compression=lzma
SolidCompression=yes
Uninstallable=yes

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

[Files]
Source: "..\ReleaseBinaries\AutoTest.Messages.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.UI.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.Console.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.License.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.WinForms.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\README"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\AutoTest.VS.Util.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2008.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2010.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\AutoTest.VSAddin2011.Addin"; DestDir: "{app}"; Flags: ignoreversion;
Source: "..\ReleaseBinaries\VSMenuKiller.exe"; DestDir: "{app}"; Flags: ignoreversion;

Source: "..\ReleaseBinaries\Icons\circleFAIL.png"; DestDir: "{app}\Icons"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Icons\circleWAIL.png"; DestDir: "{app}\Icons"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Icons\circleWIN.png"; DestDir: "{app}\Icons"; Flags: ignoreversion

Source: "..\ReleaseBinaries\AutoTest.TestRunner.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.v4.0.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.v4.0.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.v4.0.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunner.x86.v4.0.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\AutoTest.TestRunners.Shared.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\NUnit\AutoTest.TestRunners.NUnit.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.core.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.core.interfaces.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\NUnit\nunit.util.dll"; DestDir: "{app}\TestRunners\NUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\XUnit\AutoTest.TestRunners.XUnit.dll"; DestDir: "{app}\TestRunners\XUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\XUnit\xunit.runner.utility.dll"; DestDir: "{app}\TestRunners\XUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSTest\AutoTest.TestRunners.MSTest.dll"; DestDir: "{app}\TestRunners\MSTest"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSTest\celer.Core.dll"; DestDir: "{app}\TestRunners\MSTest"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSpec\AutoTest.TestRunners.MSpec.dll"; DestDir: "{app}\TestRunners\MSpec"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSpec\Machine.Specifications.dll"; DestDir: "{app}\TestRunners\MSpec"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MSpec4\AutoTest.TestRunners.MSpec4.dll"; DestDir: "{app}\TestRunners\MSpec4"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MSpec4\Machine.Specifications.dll"; DestDir: "{app}\TestRunners\MSpec4"; Flags: ignoreversion

Source: "..\ReleaseBinaries\TestRunners\MbUnit\AutoTest.TestRunners.MbUnit.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\Gallio.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\Gallio.XmlSerializers.dll"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion
Source: "..\ReleaseBinaries\TestRunners\MbUnit\mbunit.config"; DestDir: "{app}\TestRunners\MbUnit"; Flags: ignoreversion

Source: "..\ReleaseBinaries\Castle.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.Facilities.Logging.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.license.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Castle.Windsor.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\ReleaseBinaries\Mono.Cecil.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\src\AutoTest.Core\AutoTest.config.template.VS"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\ReleaseBinaries\progress.gif"; DestDir: "{app}"; Flags: ignoreversion

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

[Icons]
Name: "{group}\{cm:UninstallProgram,AutoTest.Net}"; Filename: "{uninstallexe}"

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\11.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\10.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0"; ValueType: string; ValueName: ""; ValueData: "AutomationOptions";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions"; ValueType: string; ValueName: ""; ValueData: "LookInFolders";
Root: HKLM; Subkey: "SOFTWARE\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders"; ValueType: string; ValueName: "{app}"; ValueData: ""; Flags: uninsdeletevalue

[Run]
Filename:"{dotnet20}\RegAsm.exe"; Parameters: /codebase AutoTest.VSAddin.dll;WorkingDir: {app}; StatusMsg: "Registering Controls ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.11.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2011 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.10.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2010 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.9.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2008 addin ..."; Flags: runhidden;

[UninstallRun]
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.11.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2011 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.10.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2010 addin ..."; Flags: runhidden;
Filename:"{app}\VSMenuKiller.exe"; Parameters: VisualStudio.DTE.9.0 MenuBar AutoTest.Net;WorkingDir: {app}; StatusMsg: "Removing 2008 addin ..."; Flags: runhidden;
Filename:"{dotnet20}\RegAsm.exe"; Parameters: /unregister AutoTest.VSAddin.dll; WorkingDir: {app}; StatusMsg: "Unregistering Controls ..."; Flags: runhidden;

[Code]


Added debug files to setup.

Added debug files to setup.

#define AppName        GetStringFileInfo('..\Binaries\VhdAttach.exe', 'ProductName')
#define AppVersion     GetStringFileInfo('..\Binaries\VhdAttach.exe', 'ProductVersion')
#define AppFileVersion GetStringFileInfo('..\Binaries\VhdAttach.exe', 'FileVersion')
#define AppCompany     GetStringFileInfo('..\Binaries\VhdAttach.exe', 'CompanyName')
#define AppCopyright   GetStringFileInfo('..\Binaries\VhdAttach.exe', 'LegalCopyright')
#define AppBase        LowerCase(StringChange(AppName, ' ', ''))
#define AppSetupFile   AppBase + StringChange(AppVersion, '.', '')

#define AppVersionEx   StringChange(AppVersion, '0.00', '')
#if "" != HgNode
#  define AppVersionEx AppVersionEx + " (" + HgNode + ")"
#endif

[Setup]
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppCompany}
AppPublisherURL=http://jmedved.com/{#AppBase}/
AppCopyright={#AppCopyright}
VersionInfoProductVersion={#AppVersion}
VersionInfoProductTextVersion={#AppVersionEx}
VersionInfoVersion={#AppFileVersion}
DefaultDirName={pf}\{#AppCompany}\{#AppName}
OutputBaseFilename={#AppSetupFile}
OutputDir=..\Releases
SourceDir=..\Binaries
AppId=JosipMedved_VhdAttach
CloseApplications="yes"
RestartApplications="no"
UninstallDisplayIcon={app}\VhdAttach.exe
AlwaysShowComponentsList=no
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
MergeDuplicateFiles=yes
MinVersion=0,6.01.7200
PrivilegesRequired=admin
ShowLanguageDialog=no
SolidCompression=yes
ChangesAssociations=yes
DisableWelcomePage=yes
LicenseFile=..\Setup\License.rtf

[Messages]
SetupAppTitle=Setup {#AppName} {#AppVersionEx}
SetupWindowTitle=Setup {#AppName} {#AppVersionEx}
BeveledLabel=jmedved.com

[Files]
Source: "VhdAttach.exe";                DestDir: "{app}";                      Flags: ignoreversion;
Source: "VhdAttach.pdb";                DestDir: "{app}";                      Flags: ignoreversion;
Source: "VhdAttachService.exe";         DestDir: "{app}";                      Flags: ignoreversion;
Source: "VhdAttachService.pdb";         DestDir: "{app}";                      Flags: ignoreversion;
Source: "ReadMe.txt";                   DestDir: "{app}";  Attribs: readonly;  Flags: overwritereadonly uninsremovereadonly;

[Tasks]
Name: context_open;                GroupDescription: "Context menu items:";      Description: "Open";                                 OnlyBelowVersion: 6.2;
Name: context_attach;              GroupDescription: "Context menu items:";      Description: "Attach";                               OnlyBelowVersion: 6.2;
Name: context_attachreadonly;      GroupDescription: "Context menu items:";      Description: "Attach read-only";  Flags: unchecked;  OnlyBelowVersion: 6.2;
Name: context_detach;              GroupDescription: "Context menu items:";      Description: "Detach";                               OnlyBelowVersion: 6.2;
Name: context_detachdrive;         GroupDescription: "Context menu items:";      Description: "Detach drive";      Flags: unchecked;  OnlyBelowVersion: 6.2;

Name: context_vhd_open;            GroupDescription: "VHD context menu items:";  Description: "Open";                                 MinVersion: 6.2;
Name: context_vhd_attach;          GroupDescription: "VHD context menu items:";  Description: "Attach";                               MinVersion: 6.2;
Name: context_vhd_attachreadonly;  GroupDescription: "VHD context menu items:";  Description: "Attach read-only";  Flags: unchecked;  MinVersion: 6.2;
Name: context_vhd_detach;          GroupDescription: "VHD context menu items:";  Description: "Detach";                               MinVersion: 6.2;
Name: context_iso_open;            GroupDescription: "ISO context menu items:";  Description: "Open";                                 MinVersion: 6.2;
Name: context_iso_attachreadonly;  GroupDescription: "ISO context menu items:";  Description: "Attach";                               MinVersion: 6.2;
Name: context_iso_detach;          GroupDescription: "ISO context menu items:";  Description: "Detach";                               MinVersion: 6.2;

[Icons]
Name: "{userstartmenu}\VHD Attach";  Filename: "{app}\VhdAttach.exe"

[Registry]
Root: HKCU;  Subkey: "Software\Josip Medved";                                   ValueType: none;    Flags: uninsdeletekeyifempty;
Root: HKCU;  Subkey: "Software\Josip Medved\VhdAttach";                         ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCU;  Subkey: "Software\Josip Medved\VHD Attach";                        ValueType: none;    ValueName: "Installed";                                      Flags: deletevalue uninsdeletevalue;
Root: HKLM;  Subkey: "Software\Josip Medved\VHD Attach";                        ValueType: dword;   ValueName: "Installed";         ValueData: "1";              Flags: uninsdeletekey;

Root: HKCR;  Subkey: ".vhd";                                                    ValueType: none;    ValueName: "";                  Flags: deletevalue;                                                      Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;
Root: HKCR;  Subkey: ".vhd\OpenWithProgids";                                    ValueType: string;  ValueName: "Windows.VhdFile";   ValueData: "";                                                           Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\DefaultIcon";                             ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe""";  Flags: createvalueifdoesntexist;  Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;

Root: HKCR;  Subkey: "VhdAttachFile";                                           ValueType: none;    Flags: deletekey;

Root: HKCR;  Subkey: "Windows.VhdFile\shell";                                   ValueType: string;  ValueName: "";                  ValueData: "VhdAttach-Open";                                    Tasks: context_open context_vhd_open;

Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "";                  ValueData: "Open with VHD Attach";                              Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open\command";            ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" ""%1""";                    Tasks: context_open context_vhd_open;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Attach";                              ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "";                  ValueData: "Attach";                                            Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /attach ""%1""";            Tasks: context_attach context_vhd_attach;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Attach read-only";                    ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "";                  ValueData: "Attach (read-only)";                                Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly\command";  ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /readonly /attach ""%1""";  Tasks: context_attachreadonly context_vhd_attachreadonly;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Detach";                              ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "";                  ValueData: "Detach";                                            Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detach ""%1""";            Tasks: context_detach context_vhd_detach;

Root: HKCR;  Subkey: "Drive\shell\Detach";                                      ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Drive\shell\Detach drive";                                ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "";                  ValueData: "Detach drive";                                      Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Single";                                            Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive\command";               ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detachdrive ""%1""";       Tasks: context_detachdrive;

Root: HKCR;  Subkey: ".iso";                                                    ValueType: none;    ValueName: "";                  Flags: deletevalue;                                                      Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;
Root: HKCR;  Subkey: ".iso\OpenWithProgids";                                    ValueType: string;  ValueName: "Windows.IsoFile";   ValueData: "";                                                           Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\DefaultIcon";                             ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe""";  Flags: createvalueifdoesntexist;  Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;

Root: HKCR;  Subkey: "Windows.IsoFile\shell";                                   ValueType: string;  ValueName: "";                  ValueData: "VhdAttach-Open";                                    Tasks: context_iso_open;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "";                  ValueData: "Open with VHD Attach";                              Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open\command";            ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" ""%1""";                    Tasks: context_iso_open;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "";                  ValueData: "Attach";                                            Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly\command";  ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /readonly /attach ""%1""";  Tasks: context_iso_attachreadonly;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "";                  ValueData: "Detach";                                            Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detach ""%1""";            Tasks: context_iso_detach;

[Run]
Filename: "{app}\VhdAttachService.exe";  Parameters: "/Install";  Flags: runascurrentuser waituntilterminated;
Filename: "{app}\ReadMe.txt";                                     Flags: postinstall runasoriginaluser shellexec nowait skipifsilent unchecked;  Description: "View ReadMe.txt";
Filename: "{app}\VhdAttach.exe";                                  Flags: postinstall nowait skipifsilent runasoriginaluser unchecked;            Description: "Launch application now";

[UninstallRun]
Filename: "{app}\VhdAttachService.exe";  Parameters: "/Uninstall";  Flags: runascurrentuser waituntilterminated

[Code]

procedure InitializeWizard;
begin
  WizardForm.LicenseAcceptedRadio.Checked := True;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
var
    ResultCode: Integer;
begin
    Exec(ExpandConstant('{app}\VhdAttachService.exe'), '/Uninstall', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
    Result := Result;
end;

#define AppName        GetStringFileInfo('..\Binaries\VhdAttach.exe', 'ProductName')
#define AppVersion     GetStringFileInfo('..\Binaries\VhdAttach.exe', 'ProductVersion')
#define AppFileVersion GetStringFileInfo('..\Binaries\VhdAttach.exe', 'FileVersion')
#define AppCompany     GetStringFileInfo('..\Binaries\VhdAttach.exe', 'CompanyName')
#define AppCopyright   GetStringFileInfo('..\Binaries\VhdAttach.exe', 'LegalCopyright')
#define AppBase        LowerCase(StringChange(AppName, ' ', ''))
#define AppSetupFile   AppBase + StringChange(AppVersion, '.', '')

#define AppVersionEx   StringChange(AppVersion, '0.00', '')
#if "" != HgNode
#  define AppVersionEx AppVersionEx + " (" + HgNode + ")"
#endif

[Setup]
AppName={#AppName}
AppVersion={#AppVersion}
AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppCompany}
AppPublisherURL=http://jmedved.com/{#AppBase}/
AppCopyright={#AppCopyright}
VersionInfoProductVersion={#AppVersion}
VersionInfoProductTextVersion={#AppVersionEx}
VersionInfoVersion={#AppFileVersion}
DefaultDirName={pf}\{#AppCompany}\{#AppName}
OutputBaseFilename={#AppSetupFile}
OutputDir=..\Releases
SourceDir=..\Binaries
AppId=JosipMedved_VhdAttach
CloseApplications="yes"
RestartApplications="no"
UninstallDisplayIcon={app}\VhdAttach.exe
AlwaysShowComponentsList=no
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=yes
MergeDuplicateFiles=yes
MinVersion=0,6.01.7200
PrivilegesRequired=admin
ShowLanguageDialog=no
SolidCompression=yes
ChangesAssociations=yes
DisableWelcomePage=yes
LicenseFile=..\Setup\License.rtf

[Messages]
SetupAppTitle=Setup {#AppName} {#AppVersionEx}
SetupWindowTitle=Setup {#AppName} {#AppVersionEx}
BeveledLabel=jmedved.com

[Files]
Source: "VhdAttach.exe";                DestDir: "{app}";                      Flags: ignoreversion;
Source: "VhdAttachService.exe";         DestDir: "{app}";                      Flags: ignoreversion;
Source: "ReadMe.txt";                   DestDir: "{app}";  Attribs: readonly;  Flags: overwritereadonly uninsremovereadonly;

[Tasks]
Name: context_open;                GroupDescription: "Context menu items:";      Description: "Open";                                 OnlyBelowVersion: 6.2;
Name: context_attach;              GroupDescription: "Context menu items:";      Description: "Attach";                               OnlyBelowVersion: 6.2;
Name: context_attachreadonly;      GroupDescription: "Context menu items:";      Description: "Attach read-only";  Flags: unchecked;  OnlyBelowVersion: 6.2;
Name: context_detach;              GroupDescription: "Context menu items:";      Description: "Detach";                               OnlyBelowVersion: 6.2;
Name: context_detachdrive;         GroupDescription: "Context menu items:";      Description: "Detach drive";      Flags: unchecked;  OnlyBelowVersion: 6.2;

Name: context_vhd_open;            GroupDescription: "VHD context menu items:";  Description: "Open";                                 MinVersion: 6.2;
Name: context_vhd_attach;          GroupDescription: "VHD context menu items:";  Description: "Attach";                               MinVersion: 6.2;
Name: context_vhd_attachreadonly;  GroupDescription: "VHD context menu items:";  Description: "Attach read-only";  Flags: unchecked;  MinVersion: 6.2;
Name: context_vhd_detach;          GroupDescription: "VHD context menu items:";  Description: "Detach";                               MinVersion: 6.2;
Name: context_iso_open;            GroupDescription: "ISO context menu items:";  Description: "Open";                                 MinVersion: 6.2;
Name: context_iso_attachreadonly;  GroupDescription: "ISO context menu items:";  Description: "Attach";                               MinVersion: 6.2;
Name: context_iso_detach;          GroupDescription: "ISO context menu items:";  Description: "Detach";                               MinVersion: 6.2;

[Icons]
Name: "{userstartmenu}\VHD Attach";  Filename: "{app}\VhdAttach.exe"

[Registry]
Root: HKCU;  Subkey: "Software\Josip Medved";                                   ValueType: none;    Flags: uninsdeletekeyifempty;
Root: HKCU;  Subkey: "Software\Josip Medved\VhdAttach";                         ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCU;  Subkey: "Software\Josip Medved\VHD Attach";                        ValueType: none;    ValueName: "Installed";                                      Flags: deletevalue uninsdeletevalue;
Root: HKLM;  Subkey: "Software\Josip Medved\VHD Attach";                        ValueType: dword;   ValueName: "Installed";         ValueData: "1";              Flags: uninsdeletekey;

Root: HKCR;  Subkey: ".vhd";                                                    ValueType: none;    ValueName: "";                  Flags: deletevalue;                                                      Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;
Root: HKCR;  Subkey: ".vhd\OpenWithProgids";                                    ValueType: string;  ValueName: "Windows.VhdFile";   ValueData: "";                                                           Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\DefaultIcon";                             ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe""";  Flags: createvalueifdoesntexist;  Tasks: context_open context_attach context_attachreadonly context_detach context_detachdrive context_vhd_open context_vhd_attach context_vhd_attachreadonly context_vhd_detach;

Root: HKCR;  Subkey: "VhdAttachFile";                                           ValueType: none;    Flags: deletekey;

Root: HKCR;  Subkey: "Windows.VhdFile\shell";                                   ValueType: string;  ValueName: "";                  ValueData: "VhdAttach-Open";                                    Tasks: context_open context_vhd_open;

Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "";                  ValueData: "Open with VHD Attach";                              Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_open context_vhd_open;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Open\command";            ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" ""%1""";                    Tasks: context_open context_vhd_open;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Attach";                              ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "";                  ValueData: "Attach";                                            Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_attach context_vhd_attach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Attach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /attach ""%1""";            Tasks: context_attach context_vhd_attach;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Attach read-only";                    ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "";                  ValueData: "Attach (read-only)";                                Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_attachreadonly context_vhd_attachreadonly;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-AttachReadOnly\command";  ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /readonly /attach ""%1""";  Tasks: context_attachreadonly context_vhd_attachreadonly;

Root: HKCR;  Subkey: "VhdAttachFile\shell\Detach";                              ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "";                  ValueData: "Detach";                                            Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_detach context_vhd_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\shell\VhdAttach-Detach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detach ""%1""";            Tasks: context_detach context_vhd_detach;

Root: HKCR;  Subkey: "Drive\shell\Detach";                                      ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Drive\shell\Detach drive";                                ValueType: none;    Flags: deletekey;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "";                  ValueData: "Detach drive";                                      Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive";                       ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Single";                                            Tasks: context_detachdrive;
Root: HKCR;  Subkey: "Drive\shell\VhdAttach-DetachDrive\command";               ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detachdrive ""%1""";       Tasks: context_detachdrive;

Root: HKCR;  Subkey: ".iso";                                                    ValueType: none;    ValueName: "";                  Flags: deletevalue;                                                      Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;
Root: HKCR;  Subkey: ".iso\OpenWithProgids";                                    ValueType: string;  ValueName: "Windows.IsoFile";   ValueData: "";                                                           Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;
Root: HKCR;  Subkey: "Windows.VhdFile\DefaultIcon";                             ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe""";  Flags: createvalueifdoesntexist;  Tasks: context_iso_open context_iso_attachreadonly context_iso_detach;

Root: HKCR;  Subkey: "Windows.IsoFile\shell";                                   ValueType: string;  ValueName: "";                  ValueData: "VhdAttach-Open";                                    Tasks: context_iso_open;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "";                  ValueData: "Open with VHD Attach";                              Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open";                    ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_open;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Open\command";            ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" ""%1""";                    Tasks: context_iso_open;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "";                  ValueData: "Attach";                                            Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly";          ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_attachreadonly;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-AttachReadOnly\command";  ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /readonly /attach ""%1""";  Tasks: context_iso_attachreadonly;

Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: none;    Flags: deletekey uninsdeletekey;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "";                  ValueData: "Detach";                                            Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "Icon";              ValueData: """{app}\VhdAttach.exe""";                           Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach";                  ValueType: string;  ValueName: "MultiSelectModel";  ValueData: "Document";                                          Tasks: context_iso_detach;
Root: HKCR;  Subkey: "Windows.IsoFile\shell\VhdAttach-Detach\command";          ValueType: string;  ValueName: "";                  ValueData: """{app}\VhdAttach.exe"" /detach ""%1""";            Tasks: context_iso_detach;

[Run]
Filename: "{app}\VhdAttachService.exe";  Parameters: "/Install";  Flags: runascurrentuser waituntilterminated;
Filename: "{app}\ReadMe.txt";                                     Flags: postinstall runasoriginaluser shellexec nowait skipifsilent unchecked;  Description: "View ReadMe.txt";
Filename: "{app}\VhdAttach.exe";                                  Flags: postinstall nowait skipifsilent runasoriginaluser unchecked;            Description: "Launch application now";

[UninstallRun]
Filename: "{app}\VhdAttachService.exe";  Parameters: "/Uninstall";  Flags: runascurrentuser waituntilterminated

[Code]

procedure InitializeWizard;
begin
  WizardForm.LicenseAcceptedRadio.Checked := True;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
var
    ResultCode: Integer;
begin
    Exec(ExpandConstant('{app}\VhdAttachService.exe'), '/Uninstall', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
    Result := Result;
end;


Removed Diamond installation from Windows agent.

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "GigaSpaces Technologies"
#define AppURL "http://getcloudify.org/"

[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={{94B9D938-5123-4AC5-AA99-68F07F773DE2}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Cloudify
DisableProgramGroupPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}-b{#AppBuild}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

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

[Files]
Source: "source\python\python.msi"; Flags: dontcopy nocompression
Source: "source\wheels\*.whl"; Flags: dontcopy
Source: "source\pip\*"; Flags: dontcopy
Source: "source\virtualenv\*"; Flags: dontcopy
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{userdesktop}\Cloudify Agent"; Filename: "{cmd}"; Parameters: "/k ""{app}\Scripts\activate.bat"""; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";

[UninstallDelete]
;this is NOT recommended but in our case, no user data here
Type: "filesandordirs"; Name: "{app}"

[Code]
const
  mainPackageName = 'cloudify-agent';
  //Registry key path
  RegPythonPath = 'SOFTWARE\Python\PythonCore\2.7\InstallPath';
  //Error messages
  errPythonMissing = 'Python installation was not found. In order to install {#AppName} you will need Python installed. Procceed to Python 2.7 installation?';
  errPipMissing = 'Pip was not found. Pip is a package management tool that is required to successfully install {#AppName}. Would you like to install it?';
  errVenvMissing = 'Virtualenv was not found. Virtualenv is a python environment managment tool that is required to successfully install {#AppName}. Would you like to install it?';
  errUnexpected = 'Unexpected error. Check install logs';
  infoPythonUninstall = 'Cloudify uninstaller will not remove Python as a safety precaution. Uninstalling Python should be done independently by the user';

function getPythonDir(): String;
var
  InstallPath: String;
begin
  RegQueryStringValue(HKLM, RegPythonPath, '', InstallPath);
  RegQueryStringValue(HKCU, RegPythonPath, '', InstallPath);
  Result := InstallPath;
end;

function isPythonInstalled(): Boolean;
begin
  if getPythonDir <> '' then
      Result := True
  else
      Result := False;
end;

function getPythonPath(): String;
var
  PythonPath: String;
begin
  if isPythonInstalled then begin
    PythonPath := AddBackslash(getPythonDir) + 'python.exe';
    if FileExists(PythonPath) then
      Result := PythonPath
  end;
end;

function runPythonSetup(): Boolean;
var
  PythonArgs: String;
  InstallerPath: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFile('python.msi');
  InstallerPath := Expandconstant('{tmp}\python.msi');
  PythonArgs := 'ADDDEFAULT=pip_feature';
  if WizardSilent then
    PythonArgs := PythonArgs + ' /qn';
  ShellExec('', InstallerPath, PythonArgs, '', SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function getPipPath(): String;
var
  PipPath: String;
begin
  if isPythonInstalled then begin
    PipPath := AddBackslash(getPythonDir) + 'Scripts\pip.exe';
    if FileExists(PipPath) then
      Result := PipPath
  end;
end;

function isPipInstalled(): Boolean;
begin
  if getPipPath <> '' then
      Result := True
  else
      Result := False;
end;

function runPipSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    ExtractTemporaryFile('get-pip.py');
    GetPipArgs := 'get-pip.py --use-wheel --no-index --find-links .';
    ShellExec('', getPythonPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function getVenvPath(): String;
var
  VenvPath: String;
begin
  if isPythonInstalled then begin
    VenvPath := AddBackslash(getPythonDir) + 'Scripts\virtualenv.exe';
    if FileExists(VenvPath) then
      Result := VenvPath
  end;
end;

function isVenvInstalled(): Boolean;
begin
  if getVenvPath <> '' then
      Result := True
  else
      Result := False;
end;

function runVenvSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    GetPipArgs := 'install --use-wheel --no-index --find-links . virtualenv';
    ShellExec('', getPipPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function runVenvInitialization(): Boolean;
var
  ErrorCode: Integer;
begin
  Exec(getVenvPath, Expandconstant('--clear "{app}"'), Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function runWheelsInstall(): Boolean;
var
  PipArgs: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFiles('*.whl');

  if not (isVenvInstalled and runVenvInitialization) then begin
    Result := False;
    Exit;
  end;

  //Main wheels install
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed ' + mainPackageName);
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

//wrap MsgBox to handle silent install case
function getUserResponse(Message: String): Integer;
begin
  if not WizardSilent then
    Result := MsgBox(Message, mbError, MB_OKCANCEL)
  else
    Result := IDOK;
end;

//Pre-Assumptions: Python and pip are installed
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if not runWheelsInstall then
      RaiseException(errUnexpected);
  end;
end;

//Check for pre-requirements (Python, Pip, Virtualenv)
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  UserResponse: Integer;
begin
  if not isPythonInstalled then begin
    UserResponse := getUserResponse(errPythonMissing);
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Python installed';
      Exit;
    end
    else if not runPythonSetup then begin
      Result := 'Python setup failed';
      Exit;
    end;
  end;

  if not isPipInstalled then begin
    UserResponse := getUserResponse(errPipMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Pip installed';
      exit;
    end
    else if not runPipSetup then begin
      Result := 'Pip installation failed';
      Exit;
    end;
  end;

  if not isVenvInstalled then begin
    UserResponse := getUserResponse(errVenvMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Virtualenv installed';
      Exit;
    end
    else if not runVenvSetup then begin
      Result := 'Virtualenv installation failed';
      Exit;
    end;
  end;
end;

//Display info message when install done about Python uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if (CurUninstallStep = usPostUninstall) and (not UninstallSilent) then
    MsgBox(infoPythonUninstall, mbInformation, MB_OK);
end;

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "GigaSpaces Technologies"
#define AppURL "http://getcloudify.org/"

[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={{94B9D938-5123-4AC5-AA99-68F07F773DE2}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Cloudify
DisableProgramGroupPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}-b{#AppBuild}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

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

[Files]
Source: "source\python\python.msi"; Flags: dontcopy nocompression
Source: "source\wheels\*.whl"; Flags: dontcopy
Source: "source\pip\*"; Flags: dontcopy
Source: "source\virtualenv\*"; Flags: dontcopy
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{userdesktop}\Cloudify Agent"; Filename: "{cmd}"; Parameters: "/k ""{app}\Scripts\activate.bat"""; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";

[UninstallDelete]
;this is NOT recommended but in our case, no user data here
Type: "filesandordirs"; Name: "{app}"

[Code]
const
  mainPackageName = 'cloudify-agent';
  //Registry key path
  RegPythonPath = 'SOFTWARE\Python\PythonCore\2.7\InstallPath';
  //Error messages
  errPythonMissing = 'Python installation was not found. In order to install {#AppName} you will need Python installed. Procceed to Python 2.7 installation?';
  errPipMissing = 'Pip was not found. Pip is a package management tool that is required to successfully install {#AppName}. Would you like to install it?';
  errVenvMissing = 'Virtualenv was not found. Virtualenv is a python environment managment tool that is required to successfully install {#AppName}. Would you like to install it?';
  errUnexpected = 'Unexpected error. Check install logs';
  infoPythonUninstall = 'Cloudify uninstaller will not remove Python as a safety precaution. Uninstalling Python should be done independently by the user';

function getPythonDir(): String;
var
  InstallPath: String;
begin
  RegQueryStringValue(HKLM, RegPythonPath, '', InstallPath);
  RegQueryStringValue(HKCU, RegPythonPath, '', InstallPath);
  Result := InstallPath;
end;

function isPythonInstalled(): Boolean;
begin
  if getPythonDir <> '' then
      Result := True
  else
      Result := False;
end;

function getPythonPath(): String;
var
  PythonPath: String;
begin
  if isPythonInstalled then begin
    PythonPath := AddBackslash(getPythonDir) + 'python.exe';
    if FileExists(PythonPath) then
      Result := PythonPath
  end;
end;

function runPythonSetup(): Boolean;
var
  PythonArgs: String;
  InstallerPath: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFile('python.msi');
  InstallerPath := Expandconstant('{tmp}\python.msi');
  PythonArgs := 'ADDDEFAULT=pip_feature';
  if WizardSilent then
    PythonArgs := PythonArgs + ' /qn';
  ShellExec('', InstallerPath, PythonArgs, '', SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function getPipPath(): String;
var
  PipPath: String;
begin
  if isPythonInstalled then begin
    PipPath := AddBackslash(getPythonDir) + 'Scripts\pip.exe';
    if FileExists(PipPath) then
      Result := PipPath
  end;
end;

function isPipInstalled(): Boolean;
begin
  if getPipPath <> '' then
      Result := True
  else
      Result := False;
end;

function runPipSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    ExtractTemporaryFile('get-pip.py');
    GetPipArgs := 'get-pip.py --use-wheel --no-index --find-links .';
    ShellExec('', getPythonPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function getVenvPath(): String;
var
  VenvPath: String;
begin
  if isPythonInstalled then begin
    VenvPath := AddBackslash(getPythonDir) + 'Scripts\virtualenv.exe';
    if FileExists(VenvPath) then
      Result := VenvPath
  end;
end;

function isVenvInstalled(): Boolean;
begin
  if getVenvPath <> '' then
      Result := True
  else
      Result := False;
end;

function runVenvSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    GetPipArgs := 'install --use-wheel --no-index --find-links . virtualenv';
    ShellExec('', getPipPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function runVenvInitialization(): Boolean;
var
  ErrorCode: Integer;
begin
  Exec(getVenvPath, Expandconstant('--clear "{app}"'), Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function runWheelsInstall(): Boolean;
var
  PipArgs: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFiles('*.whl');

  if not (isVenvInstalled and runVenvInitialization) then begin
    Result := False;
    Exit;
  end;

  //Main wheels install
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed ' + mainPackageName);
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  //Install diamond
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed cloudify-diamond-plugin');
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

//wrap MsgBox to handle silent install case
function getUserResponse(Message: String): Integer;
begin
  if not WizardSilent then
    Result := MsgBox(Message, mbError, MB_OKCANCEL)
  else
    Result := IDOK;
end;

//Pre-Assumptions: Python and pip are installed
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if not runWheelsInstall then
      RaiseException(errUnexpected);
  end;
end;

//Check for pre-requirements (Python, Pip, Virtualenv)
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  UserResponse: Integer;
begin
  if not isPythonInstalled then begin
    UserResponse := getUserResponse(errPythonMissing);
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Python installed';
      Exit;
    end
    else if not runPythonSetup then begin
      Result := 'Python setup failed';
      Exit;
    end;
  end;

  if not isPipInstalled then begin
    UserResponse := getUserResponse(errPipMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Pip installed';
      exit;
    end
    else if not runPipSetup then begin
      Result := 'Pip installation failed';
      Exit;
    end;
  end;

  if not isVenvInstalled then begin
    UserResponse := getUserResponse(errVenvMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Virtualenv installed';
      Exit;
    end
    else if not runVenvSetup then begin
      Result := 'Virtualenv installation failed';
      Exit;
    end;
  end;
end;

//Display info message when install done about Python uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if (CurUninstallStep = usPostUninstall) and (not UninstallSilent) then
    MsgBox(infoPythonUninstall, mbInformation, MB_OK);
end;