2016-05-24 23:23:38 +02:00
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
2016-11-15 18:17:15 +01:00
<!-- MSI installs on Win7 and above -->
<?define MinOSVersionSupported = "VersionNT >= 601" ?>
2016-05-24 23:23:38 +02:00
<!-- The URL for add/remove programs -->
<!-- TBD:Point to the actual release -->
<?define InfoURL="https://github.com/PowerShell/PowerShell" ?>
<?define ProductName = "$(env.ProductName)" ?>
<?define ProductGuid = "$(env.ProductGuid)" ?>
<?define ProductVersion = "$(env.ProductVersion)" ?>
2017-03-29 22:36:44 +02:00
<?define ProductSemanticVersion = "$(env.ProductSemanticVersion)" ?>
2016-05-24 23:23:38 +02:00
<?define ProductVersionWithName = "$(var.ProductName)_$(var.ProductVersion)"?>
2017-03-29 22:36:44 +02:00
<?define ProductSemanticVersionWithName = "$(var.ProductName)-$(env.ProductSemanticVersion)"?>
2016-11-16 19:32:21 +01:00
<?define ProductTargetArchitecture = "$(env.ProductTargetArchitecture)"?>
<?define ProductProgFilesDir = "$(env.ProductProgFilesDir)" ?>
2016-05-24 23:23:38 +02:00
<!-- Generate Your Own GUID for both ID and UpgradeCode attributes. -->
<!-- Note: UpgradeCode GUID MUST REMAIN SAME THROUGHOUT ALL VERSIONS -->
2016-11-15 18:17:15 +01:00
<!-- Otherwise, updates won't occur -->
2017-03-29 22:36:44 +02:00
<Product Id="$(var.ProductGuid)" Name="$(var.ProductSemanticVersionWithName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="{f7ba3e58-0be8-443b-ac91-f99dd1e7bd3b}">
2016-05-24 23:23:38 +02:00
<!-- Properties About The Package -->
2016-11-16 19:32:21 +01:00
<Package Id="*" Keywords="Installer" Platform="$(var.ProductTargetArchitecture)" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Description="PowerShell package" Comments="PowerShell for every system" />
2016-06-27 20:39:49 +02:00
<!-- Add PowerShell icon for executable -->
2017-10-03 19:35:32 +02:00
<Icon Id="PowerShellExe.ico" SourceFile="assets\Powershell_black.ico" />
2016-06-27 20:39:49 +02:00
<!-- Add PowerShell icon in Add/Remove Programs -->
<Property Id="ARPPRODUCTICON" Value="PowerShellExe.ico" />
2016-05-24 23:23:38 +02:00
<!-- Set properties for add/remove programs -->
<Property Id="ARPHELPLINK" Value="$(var.InfoURL)" />
2017-10-03 19:35:32 +02:00
<!-- custom images -->
<WixVariable Id="WixUIBannerBmp" Value="assets\WixUIBannerBmp.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="assets\WixUIDialogBmp.bmp" />
<WixVariable Id="WixUIExclamationIco" Value="assets\WixUIInfoIco.bmp" />
<WixVariable Id="WixUIInfoIco" Value="assets\WixUIInfoIco.bmp" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open $(env.ProductName)" />
<!-- Default value of Checkbox of starting PowerShell after installation -->
2017-10-18 02:25:11 +02:00
<Property Id="WixShellExecTarget" Value="[$(var.ProductVersionWithName)]pwsh.exe"/>
2017-10-03 19:35:32 +02:00
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI>
<Dialog Id="MyExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
<!-- Checkbox to allow starting PowerShell after the installation (in UI mode only) -->
<Control Id="LaunchCheckBox" Type="CheckBox" X="10" Y="243" Width="170" Height="17" Property="LAUNCHAPPONEXIT" Hidden="yes" CheckBoxValue="1" Text="Launch PowerShell">
<Condition Action="show">NOT Installed</Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="MyExitDialog" OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="MyExitDialog" OnExit="success" />
</AdminUISequence>
<Publish Dialog="MyExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
</UI>
<UI>
<Publish Dialog="MyExitDialog" Control="Finish" Order="1" Event="DoAction" Value="LaunchApplication">LAUNCHAPPONEXIT</Publish>
</UI>
2016-05-24 23:23:38 +02:00
<!-- Prerequisites -->
2017-10-11 01:40:07 +02:00
<Condition Message="Supported only on Windows 7 and above">
2017-10-03 19:35:32 +02:00
<![CDATA[ Installed OR $(var.MinOSVersionSupported) ]]>
</Condition>
2016-05-24 23:23:38 +02:00
<!-- Information About When Older Versions Are Trying To Be Installed-->
2017-07-17 20:12:36 +02:00
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of $(env.ProductName) is already installed." />
2016-05-24 23:23:38 +02:00
<!-- Embed Cabinet Files in Product-->
<MediaTemplate EmbedCab="yes" />
2017-10-03 19:35:32 +02:00
<!-- In Your Wix Setup Project, Add A Reference To WixUIExtension.dll -->
2016-06-28 01:04:57 +02:00
<UIRef Id="WixUI_InstallDir" />
2016-05-24 23:23:38 +02:00
<!-- Features are mandatory. Need At Least One. -->
2016-06-27 20:39:49 +02:00
<Feature Id="ProductFeature" Title="PowerShell" Level="1">
2016-05-24 23:23:38 +02:00
<ComponentGroupRef Id="$(var.ProductVersionWithName)"/>
<ComponentRef Id="ProductVersionFolder"/>
<ComponentRef Id="ApplicationProgramsMenuShortcut"/>
2017-10-18 02:25:11 +02:00
<ComponentRef Id="RegistryEntries"/>
<ComponentRef Id="SetPath"/>
2016-05-24 23:23:38 +02:00
</Feature>
2017-10-11 01:40:07 +02:00
<!-- We need to show EULA, and provide option to customize download location -->
2016-06-28 01:04:57 +02:00
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
2017-09-15 03:42:36 +02:00
<!-- Prerequisite check for Windows Universal C runtime -->
<Property Id="UNIVERSAL_C_RUNTIME_INSTALLED" Secure="yes">
<DirectorySearch Id="WindowsDirectory" Path="[WindowsFolder]">
<DirectorySearch Id="System32" Path="System32">
<FileSearch Id="ucrtbase" Name="ucrtbase.dll"/>
</DirectorySearch>
2017-08-18 21:47:43 +02:00
</DirectorySearch>
2017-10-03 19:35:32 +02:00
</Property>
2017-10-11 01:40:07 +02:00
<Condition Message="$(env.ProductName) requires the Universal C Runtime to be installed to enable remoting over WinRM. You can find a download link to it here: https://aka.ms/pscore6-prereq">
2017-09-15 03:42:36 +02:00
<![CDATA[Installed OR UNIVERSAL_C_RUNTIME_INSTALLED]]>
</Condition>
2017-10-11 01:40:07 +02:00
<!-- Prerequisite check for Windows Management Framework -->
<Property Id="PWRSHPLUGIN_VERSION" Secure="yes">
2017-09-15 03:42:36 +02:00
<DirectorySearchRef Id="System32" Parent="WindowsDirectory" Path="System32">
2017-10-11 01:40:07 +02:00
<FileSearch Id="pwrshplugin" Name="pwrshplugin.dll" MinVersion="6.3.9600.16383"/>
2017-09-15 03:42:36 +02:00
</DirectorySearchRef>
2017-10-03 19:35:32 +02:00
</Property>
2017-10-11 01:40:07 +02:00
<Condition Message="$(env.ProductName) requires the Windows Management Framework 4.0 or newer to be installed to enable remoting over WinRM. You can find download links here: https://aka.ms/pscore6-prereq">
<![CDATA[Installed OR PWRSHPLUGIN_VERSION ]]>
2017-08-18 21:47:43 +02:00
</Condition>
2016-05-24 23:23:38 +02:00
<Directory Id="TARGETDIR" Name="SourceDir">
2016-11-16 19:32:21 +01:00
<Directory Id="$(var.ProductProgFilesDir)">
2016-06-27 20:39:49 +02:00
<Directory Id="INSTALLFOLDER" Name="PowerShell">
2017-03-29 22:36:44 +02:00
<Directory Id="$(var.ProductVersionWithName)" Name="$(var.ProductSemanticVersion)">
2016-05-24 23:23:38 +02:00
<Component Id="ProductVersionFolder" Guid="{e1a7f05e-0cd6-4227-80a8-e4fb311f045c}">
<CreateFolder/>
</Component>
2017-10-18 02:25:11 +02:00
<!-- register ourselves in application registry so can be started using just Win+R `pwsh.exe` -->
<Component Id="RegistryEntries" Guid="{402e52f7-baf8-489d-af21-f756a6ca3530}">
<RegistryKey Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\pwsh.exe" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
<RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe"/>
</RegistryKey>
</Component>
<!-- add ourselvs to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
<Component Id="SetPath" Guid="{9dbb7763-7baf-48e7-b025-3bdedcb0632f}">
<Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="no" System="yes" Value="[$(var.ProductVersionWithName)]"/>
</Component>
2016-05-24 23:23:38 +02:00
</Directory>
2017-10-03 19:35:32 +02:00
</Directory>
2016-05-24 23:23:38 +02:00
</Directory>
<Directory Id="ProgramMenuFolder">
2017-03-29 22:36:44 +02:00
<Directory Id="ApplicationProgramsFolder" Name="$(var.ProductSemanticVersionWithName)">
2016-05-24 23:23:38 +02:00
<Component Id="ApplicationProgramsMenuShortcut" Guid="{A77507A7-F970-4618-AC30-20AFE36EE2EB}">
2017-10-18 02:25:11 +02:00
<Shortcut Id="PowerShell_ProgramsMenuShortcut" Name="$(var.ProductSemanticVersionWithName)" Description="$(var.ProductSemanticVersionWithName)" Target="[$(var.ProductVersionWithName)]pwsh.exe" WorkingDirectory="$(var.ProductVersionWithName)"
2016-06-27 20:39:49 +02:00
Icon = "PowerShellExe.ico" />
2016-05-24 23:23:38 +02:00
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
2017-10-03 19:35:32 +02:00
<RegistryValue Root="HKCU" Key="Software\Microsoft\$(var.ProductSemanticVersionWithName)\ProgramsMenuShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
2016-05-24 23:23:38 +02:00
</Component>
</Directory>
</Directory>
</Directory>
</Product>
2016-11-15 18:17:15 +01:00
</Wix>