Skip to content

Commit

Permalink
Optional desktop shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGalla committed Jun 6, 2020
1 parent e9169e3 commit 47fcbbf
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 8 deletions.
8 changes: 8 additions & 0 deletions AutoStartConfirm.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Debug|x64.ActiveCfg = Debug|x64
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Debug|x64.Build.0 = Debug|x64
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Debug|x86.ActiveCfg = Debug|x64
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Release|x64.ActiveCfg = Release|x64
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Release|x64.Build.0 = Release|x64
{BC458D72-75B1-4DBD-8532-7D6D0E58FC21}.Release|x86.ActiveCfg = Release|x64
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Debug|x64.ActiveCfg = Debug|x86
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Debug|x86.ActiveCfg = Debug|x86
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Debug|x86.Build.0 = Debug|x86
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Release|x64.ActiveCfg = Release|x64
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Release|x86.ActiveCfg = Release|x86
{C044A8D0-32F9-48CD-B9C8-3D47E58E14DE}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
104 changes: 96 additions & 8 deletions AutoStartConfirmSetup/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Auto Start Confirm" Language="1033" Version="0.1.0.0" Manufacturer="Christian Galla" UpgradeCode="9795b8c4-0f77-4094-a3e4-43a914b674c2">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Description="Auto Start Confirm Installer" Manufacturer="Christian Galla" Platform="x64" />
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" Description="Auto Start Confirm Installer" Manufacturer="Christian Galla" Platform="x64" />

<UIRef Id="WixUI_InstallDir" />
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="setup.cab" EmbedCab="yes" />

<Feature Id="Complete" Title="Auto Start Confirm" Description='The complete package.' Level="1" Display='expand' ConfigurableDirectory='APPLICATIONFOLDER'>
<Feature Id='MainProgram' Title='Program' Description='The main executable.' Level='1'>
<Feature Id='MainProgram' Title='Program' Description='The main executable. Required.' Level='1' Absent='disallow'>
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ProductAssetComponents" />
<ComponentRef Id="ApplicationStartMenuShortcut" />
<ComponentRef Id="ApplicationDesktopShortcut" />
<ComponentRef Id="ApplicationStartMenuShortcut" />
</Feature>
</Feature>

<Icon Id="icon.ico" SourceFile="$(var.AutoStartConfirm.ProjectDir)Assets\Icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />

<Property Id="INSTALLSHORTCUT" Value="0" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
Expand All @@ -34,6 +35,11 @@
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>



<UIRef Id="CustomUI" />
<UIRef Id="WixUI_Common" />
</Product>

<Fragment>
Expand Down Expand Up @@ -78,7 +84,7 @@
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Auto Start Confirm"
Target="[#MainExecutable]"
WorkingDirectory="APPLICATIONROOTDIRECTORY">
WorkingDirectory="APPLICATIONFOLDER">
<!--AUMID-->
<ShortcutProperty Key="System.AppUserModel.ID" Value="ChristianGalla.AutoStartConfirm"/>
<!--COM CLSID-->
Expand All @@ -88,13 +94,14 @@
<RegistryValue Root="HKCU" Key="Software\Christian Galla\Auto Start Confirm" Name="StartMenuShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationDesktopShortcut" Guid="{84E64D2C-AC8D-4B67-9DA0-8E3E2EFCE352}">
<Condition>INSTALLSHORTCUT</Condition>
<Shortcut Id="ApplicationDesktopShortcut"
Name="Auto Start Confirm"
Target="[#MainExecutable]"
WorkingDirectory="APPLICATIONROOTDIRECTORY">
WorkingDirectory="APPLICATIONFOLDER">
<!--AUMID-->
<ShortcutProperty Key="System.AppUserModel.ID" Value="ChristianGalla.AutoStartConfirm"/>
<!--COM CLSID-->
Expand All @@ -103,5 +110,86 @@
<RegistryValue Root="HKCU" Key="Software\Christian Galla\Auto Start Confirm" Name="DesktopShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
</Fragment>
</Fragment>

<Fragment>
<UI Id="CustomUI">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />

<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />

<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>

<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="DesktopShortcutDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="DesktopShortcutDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg">1</Publish>
<Publish Dialog="DesktopShortcutDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="DesktopShortcutDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>

<Property Id="ARPNOMODIFY" Value="1" />
</UI>

<UI>
<Dialog Id="DesktopShortcutDlg" Width="370" Height="270" Title="[ProductName] Setup">

<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Configure if a desktop shourtcut should be created." />
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Additional settings" />

<Control Id="InstallShortcutCheckbox" Type="CheckBox"
X="20" Y="140" Width="200" Height="17"
Property="INSTALLSHORTCUT" CheckBoxValue="1"
Text="Create desktop shortcut for all users" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>


</Dialog>
</UI>

</Fragment>

</Wix>

0 comments on commit 47fcbbf

Please sign in to comment.