diff options
Diffstat (limited to 'omnibus')
-rw-r--r-- | omnibus/resources/chef/msi/source.wxs.erb | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/omnibus/resources/chef/msi/source.wxs.erb b/omnibus/resources/chef/msi/source.wxs.erb index 1db366e352..3aae5fe0a5 100644 --- a/omnibus/resources/chef/msi/source.wxs.erb +++ b/omnibus/resources/chef/msi/source.wxs.erb @@ -69,7 +69,21 @@ <CustomAction Id="CreateChefClientScheduledTask" Directory="TARGETDIR" - ExeCommand=""[SystemFolder]SCHTASKS.EXE" /CREATE /TN "ChefClientSchTask" /SC "MINUTE" /MO "20" /F /TR ""cmd /c "[RubyExecutable] [ChefClientPath]\chef-client -L [ChefClientLog]\chef-client.log -c [CONFIGLOCATION]\client.rb""" /RU "temp_user" /RP "temp_password@123" /RL "HIGHEST" /ST "(Time.now + 60 * 30).strftime('%H:%M')"" + ExeCommand=""[SystemFolder]SCHTASKS.EXE" /CREATE /TN "ChefClientSchTask" /SC "MINUTE" /MO "20" /F /TR "cmd /c \"[RubyExecutable] [ChefClientPath]\chef-client -L [ChefClientLog]\chef-client.log -c [CONFIGLOCATION]\client.rb\"" /RU "NT Authority\System" /RP /RL "HIGHEST" /ST "<% (Time.now + 60 * 30).strftime('%H:%M') -%>"" + Execute="deferred" + Impersonate="no" + Return="check" /> + + <CustomAction Id="RemoveChefClientScheduledTask" + Directory="TARGETDIR" + ExeCommand=""[SystemFolder]SCHTASKS.EXE" /DELETE /TN "ChefClientSchTask" /F" + Execute="deferred" + Impersonate="no" + Return="check" /> + + <CustomAction Id="RemoveChefClientService" + Directory="TARGETDIR" + ExeCommand=""[SystemFolder]SC.EXE" DELETE "chef-client"" Execute="deferred" Impersonate="no" Return="check" /> @@ -78,7 +92,21 @@ <Custom Action="FastUnzip" After="InstallFiles">NOT Installed</Custom> <Custom Action="Cleanup" After="RemoveFiles">REMOVE~="ALL"</Custom> <Custom Action="CreateChefClientScheduledTask" After="InstallFiles"> - <![CDATA[&ChefSchTaskFeature=3]]> + <Condition> + <![CDATA[(NOT Installed) AND &ChefSchTaskFeature=3]]> + </Condition> + </Custom> + + <Custom Action="RemoveChefClientScheduledTask" Before="RemoveFiles"> + <Condition> + <![CDATA[Installed AND (&None=3 OR &ChefServiceFeature=3)]]> + </Condition> + </Custom> + + <Custom Action="RemoveChefClientService" Before="RemoveFiles"> + <Condition> + <![CDATA[Installed AND (&None=3 OR &ChefSchTaskFeature=3)]]> + </Condition> </Custom> </InstallExecuteSequence> @@ -161,7 +189,7 @@ <ComponentRef Id="ChefPSModulePath" /> </Feature> - <Feature Id="ChefServiceOptions"> + <Feature Id="ChefServiceOptions" Title="Chef Service Options" Level="1000" AllowAdvertise="no"> <Feature Id="ChefSchTaskFeature" Title="!(loc.FeatureSchTaskName)" Level="1000" AllowAdvertise="no"> <!--CustomAction will get executed and scheduled task for chef-client will get created--> </Feature> |