05.02.2013 Views

opsi manual opsi version 4.0.2 - opsi Download - uib

opsi manual opsi version 4.0.2 - opsi Download - uib

opsi manual opsi version 4.0.2 - opsi Download - uib

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>opsi</strong> <strong>manual</strong> <strong>opsi</strong> <strong>version</strong> <strong>4.0.2</strong><br />

19.4 New and extended <strong>opsi</strong>-winst functions<br />

143 / 193<br />

• Command line parameter /allloginscripts<br />

If you are calling <strong>opsi</strong>-winst in the <strong>opsi</strong> service context with the additional parameter /allloginscripts this will lead<br />

to the following actions:<br />

– All products which have a userLoginScript will be detected. Only for these products will be the userLoginScripts<br />

executed.<br />

– The logged in user will be identified. All global constants to user specific directories like %CurrentAppdataDir%<br />

will be directed to the directories of the logged-in user. Also the registry operations (Registry sections and<br />

GetRegistryString) which going to HKCU will be executed in a way that they read or write to the current_user<br />

hive of the logged-in user.<br />

• Command line parameter /silent<br />

The command line parameter /silent switches off the <strong>opsi</strong>-winst standard window in order to not disturb the<br />

user.<br />

• Function GetScriptMode<br />

In order to detect if a script runs as userLoginScript or for example as installation script, the function<br />

GetScriptMode gives you two possible values:<br />

– Machine<br />

The script is not executed as userLoginScript (but e.g. as setup or uninstall script).<br />

– Login<br />

The script is executed as userLoginScript.<br />

• New primary section ProfileActions<br />

This section may be used to the place for calling user profile manipulations. Here a syntax may be used, which<br />

make it possible to use this section as a part of a installation script and as a userLoginScript as well. Therefore<br />

this primary section will be interpreted in different ways according to the fact if it is called at Machine mode or at<br />

Login mode (as userLoginScript):<br />

– Login<br />

If a script is running as userLoginScript and there is a section ProfileActions in the script, the script interpretation<br />

will start at the ProfleActions section (and not at the Actions section, which will be ignored).<br />

– Machine<br />

If a script is running as normal istallation script, you may call the section ProfileActions as a sub section.<br />

But in difference to a normal sub section it has some special rules: For every called Registry section the modifier<br />

/AllNtUserDats is implicit set. gesetzt. For every called Files section the modifier /AllNtUserProfiles is implicit<br />

set.<br />

Since Version 4.11.3.2 : For every called Patches section the modifier /AllNtUserProfiles is implicit set.<br />

• Registry sections<br />

– Registry sections which should work on the HKCU or HKEY_CURRENT_USER hive in the openkey command,<br />

will be executed in login script mode (Login) in a way, that all changes will be made in the registry hive of the<br />

logged-in user. The same applies to the functions GetRegistryStringValue*.<br />

– Registry sections which are called at the normal mode (Machine) with the modifier /AllNtUserDats, may now<br />

contain HKCU resp.. HKEY_CURRENT_USER at the openkey command. This gives you the possibility to<br />

use the same registry sections in both modes.<br />

• Avoid unnecessary script execution:<br />

With the new script command saveVersionToProfile you save product name, <strong>version</strong> and package <strong>version</strong> to the<br />

logged-in users profile. These information can be retrieved by the new string function readVersionFromProfile,<br />

so that you may see if this script was executed at this profile before. To make the handling easier there is also a<br />

new Boolean function scriptWasExecutedBefore. This function checks if there is a <strong>version</strong> stamp in the profile

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!