summaryrefslogtreecommitdiff
path: root/omnibus
diff options
context:
space:
mode:
authoraliasgar16 <aliasgar.batterywala@msystechnologies.com>2016-11-16 17:12:18 +0530
committeraliasgar16 <aliasgar.batterywala@msystechnologies.com>2016-12-09 19:40:30 +0530
commit8b356ef7cb3de2b0499e2d1e66b3963ab1f6c51a (patch)
treec5be57dc801a9f8cc5206b0cb2cc83792d6f9933 /omnibus
parentce1a4f7a8a12d56a60321297b66b24f6404dcc64 (diff)
downloadchef-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.erb34
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="&quot;[SystemFolder]SCHTASKS.EXE&quot; /CREATE /TN &quot;ChefClientSchTask&quot; /SC &quot;MINUTE&quot; /MO &quot;20&quot; /F /TR &quot;&quot;cmd /c &quot;[RubyExecutable] [ChefClientPath]\chef-client -L [ChefClientLog]\chef-client.log -c [CONFIGLOCATION]\client.rb&quot;&quot;&quot; /RU &quot;temp_user&quot; /RP &quot;temp_password@123&quot; /RL &quot;HIGHEST&quot; /ST &quot;(Time.now + 60 * 30).strftime('%H:%M')&quot;"
+ ExeCommand="&quot;[SystemFolder]SCHTASKS.EXE&quot; /CREATE /TN &quot;ChefClientSchTask&quot; /SC &quot;MINUTE&quot; /MO &quot;20&quot; /F /TR &quot;cmd /c \&quot;[RubyExecutable] [ChefClientPath]\chef-client -L [ChefClientLog]\chef-client.log -c [CONFIGLOCATION]\client.rb\&quot;&quot; /RU &quot;NT Authority\System&quot; /RP /RL &quot;HIGHEST&quot; /ST &quot;<% (Time.now + 60 * 30).strftime('%H:%M') -%>&quot;"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+
+ <CustomAction Id="RemoveChefClientScheduledTask"
+ Directory="TARGETDIR"
+ ExeCommand="&quot;[SystemFolder]SCHTASKS.EXE&quot; /DELETE /TN &quot;ChefClientSchTask&quot; /F"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+
+ <CustomAction Id="RemoveChefClientService"
+ Directory="TARGETDIR"
+ ExeCommand="&quot;[SystemFolder]SC.EXE&quot; DELETE &quot;chef-client&quot;"
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>