Difference between revisions of "Execute once / always"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
Line 9: Line 9:
  
 
Below, an example for execute="always":
 
Below, an example for execute="always":
 
+
<pre>
     <package<br>
+
     <package
         id="time"<br>
+
         id="time"
         name="Time Synchonization"<br>
+
         name="Time Synchonization"
         execute="always"><br>
+
         execute="always">
         <install cmd="net time \\timeserver /set /yes" /><br>
+
         <install cmd="net time \\timeserver /set /yes" />
 
     </package>
 
     </package>
 +
</pre>
 +
'''Notes'''
 +
 +
* if you use execute once / always, then put your installation instructions as "<install cmd...", not as "<upgrade cmd...".
 +
* similarly, on revision upgrades, "<install cmd..." is used, not "<upgrade cmd..."
 +
* all checks are ignored with execute once / always
  
'''Note'''
 
  
If you use execute once / always, then put your installation instructions as "<install cmd...", not as "<upgrade cmd...".
 
  
  
 
[[category:Documentation]]
 
[[category:Documentation]]

Revision as of 12:41, 8 November 2007

Sometimes, you may want to execute a program or a script each time WPKG runs (for example, to clean up a temp directory, synchronize time etc.).

To do this, use execute="always".


Another approach is when you want to execute a program or a script only once (for example, you want to remove a directory, set up permissions, or you're unable to produce any file or registry check).

To do this, use execute="once".

Below, an example for execute="always":

    <package
        id="time"
        name="Time Synchonization"
        execute="always">
        <install cmd="net time \\timeserver /set /yes" />
    </package>

Notes

  • if you use execute once / always, then put your installation instructions as "<install cmd...", not as "<upgrade cmd...".
  • similarly, on revision upgrades, "<install cmd..." is used, not "<upgrade cmd..."
  • all checks are ignored with execute once / always