diff options
author | aliasgar16 <aliasgar.batterywala@msystechnologies.com> | 2016-11-16 17:12:18 +0530 |
---|---|---|
committer | aliasgar16 <aliasgar.batterywala@msystechnologies.com> | 2016-12-09 19:40:30 +0530 |
commit | 8b356ef7cb3de2b0499e2d1e66b3963ab1f6c51a (patch) | |
tree | c5be57dc801a9f8cc5206b0cb2cc83792d6f9933 /omnibus | |
parent | ce1a4f7a8a12d56a60321297b66b24f6404dcc64 (diff) | |
download | chef-8b356ef7cb3de2b0499e2d1e66b3963ab1f6c51a.tar.gz |
Resolved bugs and added custom actions to remove service and sch_task, and also added code to handle transition scenarios between service, sch_task and none options.
Signed-off-by: aliasgar16 <aliasgar.batterywala@msystechnologies.com>
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> |