WAU App Installer Shortcut

pull/743/head
Romain 2024-10-18 15:16:49 +02:00
parent 60a9ff33b0
commit b203534676
2 changed files with 24 additions and 0 deletions

View File

@ -368,6 +368,7 @@ else {
if ($Winget) { if ($Winget) {
#Put apps in an array #Put apps in an array
$AppIDsArray = $AppIDs -split "," $AppIDsArray = $AppIDs -split ","
Write-Host ""
#Run install or uninstall for all apps #Run install or uninstall for all apps
foreach ($App_Full in $AppIDsArray) { foreach ($App_Full in $AppIDsArray) {

View File

@ -107,6 +107,10 @@
<Property Id="STARTMENUSHORTCUT_VALUE" Value="#0"> <Property Id="STARTMENUSHORTCUT_VALUE" Value="#0">
<RegistrySearch Id="SearchStartMenuShortcut" Type="raw" Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]" Name="WAU_StartMenuShortcut" /> <RegistrySearch Id="SearchStartMenuShortcut" Type="raw" Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]" Name="WAU_StartMenuShortcut" />
</Property> </Property>
<Property Id="APPINSTALLERSHORTCUT" Secure="yes" />
<Property Id="APPINSTALLERSHORTCUT_VALUE" Value="#0">
<RegistrySearch Id="SearchAppInstallerShortcut" Type="raw" Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]" Name="WAU_AppInstallerShortcut" />
</Property>
<!-- UI Config --> <!-- UI Config -->
<UI Id="WixUI_InstallDir"> <UI Id="WixUI_InstallDir">
@ -163,6 +167,10 @@
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" /> <Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" /> <Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" /> <Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
<Control Id="WAUAppInstallerShortcut" Type="CheckBox" Width="155" Height="17" X="20" Y="160" Text="Install WAU App Installer shortcut" Property="APPINSTALLERSHORTCUT_CHECKED" CheckBoxValue="1">
<Publish Property="APPINSTALLERSHORTCUT" Value="1" Order="1" Condition="APPINSTALLERSHORTCUT_CHECKED" />
<Publish Property="APPINSTALLERSHORTCUT" Value="0" Order="2" Condition="NOT APPINSTALLERSHORTCUT_CHECKED" />
</Control>
<Control Id="WAUDesktopShortcut" Type="CheckBox" Width="155" Height="17" X="20" Y="180" Text="Install Desktop shortcut" Property="DESKTOPSHORTCUT_CHECKED" CheckBoxValue="1"> <Control Id="WAUDesktopShortcut" Type="CheckBox" Width="155" Height="17" X="20" Y="180" Text="Install Desktop shortcut" Property="DESKTOPSHORTCUT_CHECKED" CheckBoxValue="1">
<Publish Property="DESKTOPSHORTCUT" Value="1" Order="1" Condition="DESKTOPSHORTCUT_CHECKED" /> <Publish Property="DESKTOPSHORTCUT" Value="1" Order="1" Condition="DESKTOPSHORTCUT_CHECKED" />
<Publish Property="DESKTOPSHORTCUT" Value="0" Order="2" Condition="NOT DESKTOPSHORTCUT_CHECKED" /> <Publish Property="DESKTOPSHORTCUT" Value="0" Order="2" Condition="NOT DESKTOPSHORTCUT_CHECKED" />
@ -220,6 +228,9 @@
<UIRef Id="WixUI_Common" /> <UIRef Id="WixUI_Common" />
<!-- Set properties --> <!-- Set properties -->
<SetProperty Id="APPINSTALLERSHORTCUT_CHECKED" After="AppSearch" Value="1" Condition="APPINSTALLERSHORTCUT_VALUE = &quot;#1&quot;" />
<SetProperty Action="SetAPPINSTALLERSHORTCUT_0" Id="APPINSTALLERSHORTCUT" After="AppSearch" Value="0" Condition="(NOT APPINSTALLERSHORTCUT) AND (APPINSTALLERSHORTCUT_VALUE &lt;&gt; &quot;#1&quot;)" />
<SetProperty Action="SetAPPINSTALLERSHORTCUTSHORTCUT_1" Id="APPINSTALLERSHORTCUT" After="AppSearch" Value="1" Condition="(NOT APPINSTALLERSHORTCUT) AND (APPINSTALLERSHORTCUT_VALUE = &quot;#1&quot;)" />
<SetProperty Id="DESKTOPSHORTCUT_CHECKED" After="AppSearch" Value="1" Condition="DESKTOPSHORTCUT_VALUE = &quot;#1&quot;" /> <SetProperty Id="DESKTOPSHORTCUT_CHECKED" After="AppSearch" Value="1" Condition="DESKTOPSHORTCUT_VALUE = &quot;#1&quot;" />
<SetProperty Action="SetDESKTOPSHORTCUT_0" Id="DESKTOPSHORTCUT" After="AppSearch" Value="0" Condition="(NOT DESKTOPSHORTCUT) AND (DESKTOPSHORTCUT_VALUE &lt;&gt; &quot;#1&quot;)" /> <SetProperty Action="SetDESKTOPSHORTCUT_0" Id="DESKTOPSHORTCUT" After="AppSearch" Value="0" Condition="(NOT DESKTOPSHORTCUT) AND (DESKTOPSHORTCUT_VALUE &lt;&gt; &quot;#1&quot;)" />
<SetProperty Action="SetDESKTOPSHORTCUT_1" Id="DESKTOPSHORTCUT" After="AppSearch" Value="1" Condition="(NOT DESKTOPSHORTCUT) AND (DESKTOPSHORTCUT_VALUE = &quot;#1&quot;)" /> <SetProperty Action="SetDESKTOPSHORTCUT_1" Id="DESKTOPSHORTCUT" After="AppSearch" Value="1" Condition="(NOT DESKTOPSHORTCUT) AND (DESKTOPSHORTCUT_VALUE = &quot;#1&quot;)" />
@ -268,6 +279,7 @@
<Feature Id="WAU" Title="Winget-AutoUpdate" Level="1"> <Feature Id="WAU" Title="Winget-AutoUpdate" Level="1">
<ComponentGroupRef Id="CompFiles" /> <ComponentGroupRef Id="CompFiles" />
<ComponentRef Id="CompReg" /> <ComponentRef Id="CompReg" />
<ComponentRef Id="AppInstallerShortcut" />
<ComponentRef Id="DesktopShortcut" /> <ComponentRef Id="DesktopShortcut" />
<ComponentRef Id="StartMenuShortcut" /> <ComponentRef Id="StartMenuShortcut" />
</Feature> </Feature>
@ -336,6 +348,9 @@
<RegistryKey Key="AppUserModelId\Windows.SystemToast.WAU.Notification" Root="HKCR"> <RegistryKey Key="AppUserModelId\Windows.SystemToast.WAU.Notification" Root="HKCR">
<RegistryValue Name="IconUri" Type="expandable" Value="%SystemRoot%\system32\@WindowsUpdateToastIcon.png" /> <RegistryValue Name="IconUri" Type="expandable" Value="%SystemRoot%\system32\@WindowsUpdateToastIcon.png" />
</RegistryKey> </RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]">
<RegistryValue Name="WAU_AppInstallerShortcut" Type="integer" Value="[APPINSTALLERSHORTCUT]" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]"> <RegistryKey Root="HKLM" Key="SOFTWARE\[Manufacturer]\[ProductName]">
<RegistryValue Name="WAU_DesktopShortcut" Type="integer" Value="[DESKTOPSHORTCUT]" /> <RegistryValue Name="WAU_DesktopShortcut" Type="integer" Value="[DESKTOPSHORTCUT]" />
</RegistryKey> </RegistryKey>
@ -345,6 +360,14 @@
</Component> </Component>
</Directory> </Directory>
</StandardDirectory> </StandardDirectory>
<StandardDirectory Id="AppInstallerFolder">
<Component Id="AppInstallerShortcut" Condition="APPINSTALLERSHORTCUT = 1">
<RegistryKey Root="HKCU" Key="SOFTWARE\[Manufacturer]\[ProductName]">
<RegistryValue Name="WAU_AppInstallerShortcut" Type="integer" Value="[APPINSTALLERSHORTCUT]" KeyPath="yes" />
</RegistryKey>
<Shortcut Id="AppInstallerShortcut" Name="Run WAU" Target="[System64Folder]conhost.exe" Arguments="--headless powershell.exe -NoProfile -ExecutionPolicy Bypass -File &quot;[INSTALLDIR]WAU-Installer-GUI.ps1&quot;" Icon="icon.ico" />
</Component>
</StandardDirectory>
<StandardDirectory Id="DesktopFolder"> <StandardDirectory Id="DesktopFolder">
<Component Id="DesktopShortcut" Condition="DESKTOPSHORTCUT = 1"> <Component Id="DesktopShortcut" Condition="DESKTOPSHORTCUT = 1">
<RegistryKey Root="HKCU" Key="SOFTWARE\[Manufacturer]\[ProductName]"> <RegistryKey Root="HKCU" Key="SOFTWARE\[Manufacturer]\[ProductName]">