Skip to content

Commit

Permalink
Merge pull request #671 from chef/windows_at_boot
Browse files Browse the repository at this point in the history
Enable the Workstation App to run at boot on Windows
  • Loading branch information
Salim Afiune authored Feb 5, 2020
2 parents f988087 + 03592a6 commit 683c4c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<String Id="FeatureChefWSDesktopPSShortcut">Desktop PowerShell Shortcut</String>
<String Id="FeatureChefWSDesktopPSShortcutDesc">Install a <%= friendly_name %> PowerShell shortcut to your Desktop.</String>

<String Id="LaunchChefWSApp">Launch the <%= friendly_name %> App</String>

<String Id="FeatureChefWSApp"><%= friendly_name %> App</String>
<String Id="FeatureChefWSAppDesc">Install the <%= friendly_name %> App</String>

Expand Down
16 changes: 13 additions & 3 deletions omnibus/resources/chef-workstation/msi/source.wxs.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@

<Property Id="WixQuietExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /T /F /IM "Chef Workstation App*"' />

<Property Id="WixShellExecTarget" Value="[WSAPPDIR]\Chef Workstation App.exe" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />

<CustomAction Id="TaskKill"
BinaryKey="WixCA"
DllEntry="WixQuietExec"
Expand Down Expand Up @@ -211,7 +217,7 @@
[x] Desktop Shortcut
[ ] Environment Customizations
[x] Chef Workstation App
[ ] Start at login
[x] Start at login
-->
<Feature Id="ChefWSFeature" Title="!(loc.FeatureMainName)"
Description="!(loc.FeatureMainDesc)"
Expand Down Expand Up @@ -240,7 +246,7 @@
Level="1" AllowAdvertise="no">
<ComponentRef Id="ChefWSAppStartMenuShortcut" />
<Feature Id="ChefWSAppAutostartFeature" Title="!(loc.FeatureChefWSAppAutostart)"
Description="!(loc.FeatureChefWSAppAutostartDesc)" Level="1000" AllowAdvertise="no" >
Description="!(loc.FeatureChefWSAppAutostartDesc)" Level="1" AllowAdvertise="no" >
<ComponentRef Id="ChefWSAppAutostartShortcut" />
</Feature>
</Feature>
Expand All @@ -255,6 +261,8 @@
<Property Id="ARPPRODUCTICON" Value="cws16.ico" />
<Property Id="ARPHELPLINK" Value="https://chef.sh/" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchChefWSApp)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>

<!-- Use our custom UI sequence which is based on WixUI_FeatureTree - the default WIX installer UI that includes a feature tree
The fragment containing ChefWS_FeatureTree is at the bottom of this file; omnibus does not currently support
Expand Down Expand Up @@ -313,7 +321,9 @@
<DialogRef Id="UserExit" />
<DialogRef Id="DlgDKInstalled" />

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return">1</Publish>

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

<!-- WelcomeDlg buttons -->
Expand Down

0 comments on commit 683c4c5

Please sign in to comment.