mirror of
https://github.com/nushell/nushell.git
synced 2025-06-20 09:58:15 +02:00
Add WindowsTerminalProfile feature for installation
This commit is contained in:
parent
9855085fb7
commit
deacd569ef
@ -29,6 +29,7 @@
|
|||||||
<BindPath Include="." />
|
<BindPath Include="." />
|
||||||
<Content Include="nu.ico" />
|
<Content Include="nu.ico" />
|
||||||
<Content Include="License.rtf" />
|
<Content Include="License.rtf" />
|
||||||
|
<Content Include="windows-terminal-profile.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
121
wix/main.wxs
121
wix/main.wxs
@ -23,7 +23,7 @@
|
|||||||
<MajorUpgrade
|
<MajorUpgrade
|
||||||
MigrateFeatures="yes"
|
MigrateFeatures="yes"
|
||||||
Schedule="afterInstallInitialize"
|
Schedule="afterInstallInitialize"
|
||||||
DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit."/>
|
DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit." />
|
||||||
|
|
||||||
<!-- Embed cab media to MSI file -->
|
<!-- Embed cab media to MSI file -->
|
||||||
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
|
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" />
|
||||||
@ -54,6 +54,31 @@
|
|||||||
<Directory Id="BINDIR_USER" Name="bin" />
|
<Directory Id="BINDIR_USER" Name="bin" />
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
<!-- Windows Terminal Profile Directories -->
|
||||||
|
<Directory Id="AppDataMicrosoftFolder" Name="Microsoft">
|
||||||
|
<Directory Id="AppDataWindowsTerminalFolder" Name="Windows Terminal">
|
||||||
|
<Directory Id="WindowsTerminalProfileFolder" Name="Fragments">
|
||||||
|
<Directory Id="WindowsTerminalProfileAppFolder" Name="nu">
|
||||||
|
<Component Id="WindowsTerminalProfile" Guid="957239F4-7B87-4399-9F91-7DF2ABE5ED8B">
|
||||||
|
<File Id="WindowsTerminalProfileFile"
|
||||||
|
Name="nu.json"
|
||||||
|
Source="$(var.ProjectDir)\windows-terminal-profile.json" />
|
||||||
|
<RegistryValue Root="HKCU"
|
||||||
|
Key="Software\nu"
|
||||||
|
Name="WindowsTerminalProfile"
|
||||||
|
Value="1"
|
||||||
|
Type="integer"
|
||||||
|
KeyPath="yes" />
|
||||||
|
<RemoveFolder Id="RemoveWindowsTerminalProfileFolderA" Directory="WindowsTerminalProfileAppFolder" On="uninstall" />
|
||||||
|
<RemoveFolder Id="RemoveWindowsTerminalProfileFolderB" Directory="WindowsTerminalProfileFolder" On="uninstall" />
|
||||||
|
<RemoveFolder Id="RemoveWindowsTerminalProfileFolderC" Directory="AppDataWindowsTerminalFolder" On="uninstall" />
|
||||||
|
<RemoveFolder Id="RemoveWindowsTerminalProfileFolderD" Directory="AppDataMicrosoftFolder" On="uninstall" />
|
||||||
|
</Component>
|
||||||
|
</Directory>
|
||||||
|
</Directory>
|
||||||
|
</Directory>
|
||||||
|
</Directory>
|
||||||
</StandardDirectory>
|
</StandardDirectory>
|
||||||
|
|
||||||
<ComponentGroup Id="NushellBinaries" Directory="BINDIR">
|
<ComponentGroup Id="NushellBinaries" Directory="BINDIR">
|
||||||
@ -92,35 +117,35 @@
|
|||||||
<!-- Per-user PATH component -->
|
<!-- Per-user PATH component -->
|
||||||
<Component Id="EnvironmentPathUser" Guid="{D6A3A7B2-1F3A-4B6A-8A3B-3A7B2D6A3A7B}" Condition="MSIINSTALLPERUSER=1">
|
<Component Id="EnvironmentPathUser" Guid="{D6A3A7B2-1F3A-4B6A-8A3B-3A7B2D6A3A7B}" Condition="MSIINSTALLPERUSER=1">
|
||||||
<Environment Id="PATHUser"
|
<Environment Id="PATHUser"
|
||||||
Name="PATH"
|
Name="PATH"
|
||||||
Value="[BINDIR]"
|
Value="[BINDIR]"
|
||||||
Permanent="no"
|
Permanent="no"
|
||||||
Part="last"
|
Part="last"
|
||||||
Action="set"
|
Action="set"
|
||||||
System="no"/>
|
System="no" />
|
||||||
<RegistryValue Root="HKCU"
|
<RegistryValue Root="HKCU"
|
||||||
Key="Software\nu"
|
Key="Software\nu"
|
||||||
Name="installed"
|
Name="installed"
|
||||||
Type="integer"
|
Type="integer"
|
||||||
Value="1"
|
Value="1"
|
||||||
KeyPath="yes"/>
|
KeyPath="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<!-- Per-machine PATH component -->
|
<!-- Per-machine PATH component -->
|
||||||
<Component Id="EnvironmentPathMachine" Guid="{47781325-8A2B-4F8D-A058-9A2C4136E25F}" Condition="ALLUSERS=1">
|
<Component Id="EnvironmentPathMachine" Guid="{47781325-8A2B-4F8D-A058-9A2C4136E25F}" Condition="ALLUSERS=1">
|
||||||
<Environment Id="PATHMachine"
|
<Environment Id="PATHMachine"
|
||||||
Name="PATH"
|
Name="PATH"
|
||||||
Value="[BINDIR]"
|
Value="[BINDIR]"
|
||||||
Permanent="no"
|
Permanent="no"
|
||||||
Part="last"
|
Part="last"
|
||||||
Action="set"
|
Action="set"
|
||||||
System="yes"/>
|
System="yes" />
|
||||||
<RegistryValue Root="HKLM"
|
<RegistryValue Root="HKLM"
|
||||||
Key="Software\nu"
|
Key="Software\nu"
|
||||||
Name="installed"
|
Name="installed"
|
||||||
Type="integer"
|
Type="integer"
|
||||||
Value="1"
|
Value="1"
|
||||||
KeyPath="yes"/>
|
KeyPath="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
|
|
||||||
@ -132,6 +157,14 @@
|
|||||||
<ComponentRef Id="EnvironmentPathMachine" />
|
<ComponentRef Id="EnvironmentPathMachine" />
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
|
<!-- Windows Terminal Profile Feature -->
|
||||||
|
<Feature Id="WindowsTerminalProfile"
|
||||||
|
Title="Windows Terminal Profile"
|
||||||
|
Description="Add $(var.ProductName) profile to Windows Terminal."
|
||||||
|
Level="1">
|
||||||
|
<ComponentRef Id="WindowsTerminalProfile" />
|
||||||
|
</Feature>
|
||||||
|
|
||||||
<!-- Load Advanced UI -->
|
<!-- Load Advanced UI -->
|
||||||
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\License.rtf" />
|
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\License.rtf" />
|
||||||
<ui:WixUI Id="WixUI_Advanced" />
|
<ui:WixUI Id="WixUI_Advanced" />
|
||||||
@ -153,26 +186,44 @@
|
|||||||
Value="[INSTALLDIR_USER]"
|
Value="[INSTALLDIR_USER]"
|
||||||
After="AppSearch"
|
After="AppSearch"
|
||||||
Condition="MSIINSTALLPERUSER=1"
|
Condition="MSIINSTALLPERUSER=1"
|
||||||
Sequence="both"/>
|
Sequence="both" />
|
||||||
<SetProperty Id="BINDIR"
|
<SetProperty Id="BINDIR"
|
||||||
Action="SetBINDIR_User"
|
Action="SetBINDIR_User"
|
||||||
Value="[BINDIR_USER]"
|
Value="[BINDIR_USER]"
|
||||||
After="AppSearch"
|
After="AppSearch"
|
||||||
Condition="MSIINSTALLPERUSER=1"
|
Condition="MSIINSTALLPERUSER=1"
|
||||||
Sequence="both"/>
|
Sequence="both" />
|
||||||
|
|
||||||
<!-- If Installed with ALLUSERS=1 set the default Install dir to ProgramFiles64Folder -->
|
<!-- If Installed with ALLUSERS=1 set the default Install dir to ProgramFiles64Folder -->
|
||||||
<SetProperty Id="INSTALLDIR"
|
<SetProperty Id="INSTALLDIR"
|
||||||
Action="SetINSTALLDIR_Machine"
|
Action="SetINSTALLDIR_Machine"
|
||||||
Value="[ProgramFiles64Folder][ApplicationFolderName]"
|
Value="[ProgramFiles64Folder][ApplicationFolderName]"
|
||||||
After="AppSearch"
|
After="AppSearch"
|
||||||
Condition="ALLUSERS=1"
|
Condition="ALLUSERS=1"
|
||||||
Sequence="both"/>
|
Sequence="both" />
|
||||||
<SetProperty Id="BINDIR"
|
<SetProperty Id="BINDIR"
|
||||||
Action="SetBINDIR_Machine"
|
Action="SetBINDIR_Machine"
|
||||||
Value="[ProgramFiles64Folder][ApplicationFolderName]\bin"
|
Value="[ProgramFiles64Folder][ApplicationFolderName]\bin"
|
||||||
After="AppSearch"
|
After="AppSearch"
|
||||||
Condition="ALLUSERS=1"
|
Condition="ALLUSERS=1"
|
||||||
Sequence="both"/>
|
Sequence="both" />
|
||||||
|
|
||||||
|
<!-- Custom Action for Windows Terminal Profile -->
|
||||||
|
<SetProperty Id="ReplacePathsInWindowsTerminalProfile"
|
||||||
|
Sequence="execute"
|
||||||
|
Value=""[#nu.exe]" -c "let doc = (open `[#WindowsTerminalProfileFile]` | update profiles.commandline `[#nu.exe]` | update profiles.icon `[#nu.ico]`); $doc | save -f `[#WindowsTerminalProfileFile]`""
|
||||||
|
After="CostFinalize" />
|
||||||
|
|
||||||
|
<CustomAction Id="ReplacePathsInWindowsTerminalProfile"
|
||||||
|
Return="check"
|
||||||
|
Impersonate="yes"
|
||||||
|
Execute="deferred"
|
||||||
|
DllEntry="WixQuietExec"
|
||||||
|
BinaryRef="Wix4UtilCA_X64" />
|
||||||
|
|
||||||
|
<InstallExecuteSequence>
|
||||||
|
<Custom Action="ReplacePathsInWindowsTerminalProfile" Before="InstallFinalize"
|
||||||
|
Condition="(&WindowsTerminalProfile=3) OR ((!WindowsTerminalProfile=3) AND (REINSTALL<>""))"/>
|
||||||
|
</InstallExecuteSequence>
|
||||||
</Package>
|
</Package>
|
||||||
</Wix>
|
</Wix>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user