Add Windows Terminal profile and icon in Windows control panel (#5812)

* Show icon in Windows 'Add/Remove Programs' control panel

* Add install option for Windows Terminal profile

* Re-create icon because the icon was not shwon in Windows Terminal

Procedure: opened the original file with GIMP and simply overwrited it
This commit is contained in:
wolimst 2022-06-17 01:46:33 +09:00 committed by GitHub
parent 30c8dabeb4
commit 28c07a5072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -76,6 +76,15 @@
KeyPath='yes'/>
</Component>
<Component Id='icon0' Guid='*' Win64='$(var.Win64)'>
<File
Id='icon0'
Name='nu.ico'
DiskId='1'
Source='assets/nu_logo.ico'
KeyPath='yes'/>
</Component>
<Directory Id='Bin' Name='bin'>
<Component Id='Path' Guid='285921EA-6DC0-4632-B12C-D7D737F30686' Win64='$(var.Win64)' KeyPath='yes'>
<Environment
@ -275,6 +284,25 @@
</Directory>
</Directory>
</Directory>
<Directory Id='CommonAppDataFolder'>
<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='*' Win64='$(var.Win64)'>
<File
Id='WindowsTerminalProfileFile'
Name='nu.json'
DiskId='1'
Source='wix\windows-terminal-profile.json'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature
@ -292,6 +320,8 @@
-->
<ComponentRef Id='License'/>
<ComponentRef Id='icon0'/>
<ComponentRef Id='binary0'/>
<!-- <ComponentRef Id='binary1'/> -->
<ComponentRef Id='binary2'/>
@ -324,22 +354,43 @@
Absent='allow'>
<ComponentRef Id='Path'/>
</Feature>
<Feature
Id='WindowsTerminalProfile'
Title='Windows Terminal Profile'
Description='Add [ProductName] profile to Windows Terminal.'
Level='1'
Absent='allow'>
<ComponentRef Id='WindowsTerminalProfile'/>
</Feature>
</Feature>
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
<!--
Uncomment the following `Icon` and `Property` tags to change the product icon.
The product icon is the graphic that appears in the Add/Remove
Programs control panel for the application.
-->
<!--<Icon Id='ProductICO' SourceFile='wix\Product.ico'/>-->
<!--<Property Id='ARPPRODUCTICON' Value='ProductICO' />-->
<Icon Id='ProductICO' SourceFile='assets/nu_logo.ico'/>
<Property Id='ARPPRODUCTICON' Value='ProductICO' />
<Property Id='ARPHELPLINK' Value='https://www.nushell.sh/book/'/>
<SetProperty
Id="ReplacePathsInWindowsTerminalProfile"
Sequence="execute"
Value="&quot;[#exe0]&quot; -c &quot;open '[#WindowsTerminalProfileFile]' | update profiles.commandline '[#exe0]' | update profiles.icon '[#icon0]' | save '[#WindowsTerminalProfileFile]'&quot;"
After='CostFinalize'/>
<CustomAction
Id="ReplacePathsInWindowsTerminalProfile"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="deferred"
Return="check"
Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action='ReplacePathsInWindowsTerminalProfile' Before='InstallFinalize'>
<!-- Run the custom action if the feature is enabled -->
<![CDATA[&WindowsTerminalProfile=3 OR (!WindowsTerminalProfile=3 AND REINSTALL<>"")]]>
</Custom>
</InstallExecuteSequence>
<UI>
<UIRef Id='WixUI_FeatureTree'/>
<!--

View File

@ -0,0 +1,11 @@
{
"profiles": [
{
"guid": "{aab79973-318f-43b6-a9bc-b4096493753f}",
"name": "Nushell",
"commandline": "nu.exe",
"icon": "nu.ico",
"startingDirectory": "%USERPROFILE%"
}
]
}