Skip to content

Commit

Permalink
Set Command in TaskConfig.xml using util:XmlFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
rinrab committed Dec 26, 2023
1 parent cb0d21b commit 4d58c92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Installer/Package.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<Feature Id="Main">
<Component Directory="INSTALLFOLDER">
<File Source="$(AOVpnManager.TargetPath)" />
<File Source="$(AOVpnManager.TargetPath)" Id="AOVpnManager.exe" />
</Component>

<Component Directory="INSTALLFOLDER">
Expand All @@ -31,11 +31,14 @@

<Component Directory="INSTALLFOLDER">
<File Source="TaskConfig.xml" />

<util:XmlFile File="[INSTALLFOLDER]TaskConfig.xml" Action="setValue"
ElementPath="//Task/Actions/Exec/Command" Value='"[#AOVpnManager.exe]"' />
</Component>

<Component Directory="INSTALLFOLDER">
<File Id="etwManifest.dll"
Source="$(var.AOVpnManager.TargetDir)\AOVpnManager.AOVpnManager.etwManifest.dll"/>
Source="$(var.AOVpnManager.TargetDir)\AOVpnManager.AOVpnManager.etwManifest.dll" />
</Component>

<Component Directory="INSTALLFOLDER">
Expand All @@ -46,7 +49,6 @@
</Component>
</Feature>


<CustomAction Id="CreateTask" Execute="deferred" Impersonate="no" Return="check" Directory="INSTALLFOLDER"
ExeCommand='schtasks.exe /Create /TN "AOVpn Manager Group Policy Update" /XML "[INSTALLFOLDER]TaskConfig.xml" /F' />

Expand All @@ -55,7 +57,7 @@
ExeCommand='schtasks.exe /Delete /TN "AOVpn Manager Group Policy Update" /F' />

<InstallExecuteSequence>
<Custom Action="CreateTask" After="InstallFiles" Condition='NOT REMOVE'></Custom>
<Custom Action="CreateTask" After="PublishFeatures" Condition='NOT REMOVE'></Custom>
<Custom Action="DeleteTask" Before="RemoveFiles" Condition="REMOVE"></Custom>
</InstallExecuteSequence>

Expand Down
Binary file modified Installer/TaskConfig.xml
Binary file not shown.

0 comments on commit 4d58c92

Please sign in to comment.