|
31 | 31 | <WixVariable Id="WixUIInfoIco" Value="assets\WixUIInfoIco.bmp" />
|
32 | 32 | <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open $(env.ProductName)" />
|
33 | 33 | <!-- Default value of Checkbox of starting PowerShell after installation -->
|
34 |
| - <Property Id="WixShellExecTarget" Value="[$(var.ProductVersionWithName)]PowerShell.exe"/> |
| 34 | + <Property Id="WixShellExecTarget" Value="[$(var.ProductVersionWithName)]pwsh.exe"/> |
35 | 35 | <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
|
36 | 36 | <UI>
|
37 | 37 | <Dialog Id="MyExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
|
|
73 | 73 | <ComponentGroupRef Id="$(var.ProductVersionWithName)"/>
|
74 | 74 | <ComponentRef Id="ProductVersionFolder"/>
|
75 | 75 | <ComponentRef Id="ApplicationProgramsMenuShortcut"/>
|
| 76 | + <ComponentRef Id="RegistryEntries"/> |
| 77 | + <ComponentRef Id="SetPath"/> |
76 | 78 | </Feature>
|
77 | 79 | <!-- We need to show EULA, and provide option to customize download location -->
|
78 | 80 | <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
|
103 | 105 | <Component Id="ProductVersionFolder" Guid="{e1a7f05e-0cd6-4227-80a8-e4fb311f045c}">
|
104 | 106 | <CreateFolder/>
|
105 | 107 | </Component>
|
| 108 | + <!-- register ourselves in application registry so can be started using just Win+R `pwsh.exe` --> |
| 109 | + <Component Id="RegistryEntries" Guid="{402e52f7-baf8-489d-af21-f756a6ca3530}"> |
| 110 | + <RegistryKey Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\pwsh.exe" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> |
| 111 | + <RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe"/> |
| 112 | + </RegistryKey> |
| 113 | + </Component> |
| 114 | + <!-- add ourselvs to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe --> |
| 115 | + <Component Id="SetPath" Guid="{9dbb7763-7baf-48e7-b025-3bdedcb0632f}"> |
| 116 | + <Environment Id="PATH" Action="set" Name="PATH" Part="last" Permanent="yes" System="yes" Value="[$(var.ProductVersionWithName)]"/> |
| 117 | + </Component> |
106 | 118 | </Directory>
|
107 | 119 | </Directory>
|
108 | 120 | </Directory>
|
109 | 121 | <Directory Id="ProgramMenuFolder">
|
110 | 122 | <Directory Id="ApplicationProgramsFolder" Name="$(var.ProductSemanticVersionWithName)">
|
111 | 123 | <Component Id="ApplicationProgramsMenuShortcut" Guid="{A77507A7-F970-4618-AC30-20AFE36EE2EB}">
|
112 |
| - <Shortcut Id="PowerShell_ProgramsMenuShortcut" Name="$(var.ProductSemanticVersionWithName)" Description="$(var.ProductSemanticVersionWithName)" Target="[$(var.ProductVersionWithName)]PowerShell.exe" WorkingDirectory="$(var.ProductVersionWithName)" |
| 124 | + <Shortcut Id="PowerShell_ProgramsMenuShortcut" Name="$(var.ProductSemanticVersionWithName)" Description="$(var.ProductSemanticVersionWithName)" Target="[$(var.ProductVersionWithName)]pwsh.exe" WorkingDirectory="$(var.ProductVersionWithName)" |
113 | 125 | Icon = "PowerShellExe.ico" />
|
114 | 126 | <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
115 | 127 | <RegistryValue Root="HKCU" Key="Software\Microsoft\$(var.ProductSemanticVersionWithName)\ProgramsMenuShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
|
|
0 commit comments