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 />

145 / 193<br />

At the next example (which simply extends the first example) we show how you may delete things from the profile in<br />

the case that this product has been uninstalled. According to what we get from the function getProductMap different<br />

parts of the script will be executed.<br />

[Actions]<br />

requiredWinstVersion >= "4.11.3.2"<br />

Message "Example Profile Patch ...."<br />

if getValue("installationstate", getProductMap) = "installed"<br />

comment "Product is installed"<br />

Files_profile_copy<br />

Registry_currentuser_set<br />

Patches_profile_ini "%userprofiledir%\<strong>opsi</strong>-winst-test.ini"<br />

endif<br />

if getValue("lastactionrequest", getProductMap) = "uninstall"<br />

comment "Product was uninstalled"<br />

Files_profile_del<br />

Registry_currentuser_del<br />

endif<br />

[Files_profile_copy]<br />

copy "%Scriptpath%\profiles\*.*" "%CurrentAppdataDir%\ACME"<br />

[Registry_currentuser_set]<br />

openkey [HKCU\Software\ACME]<br />

set "show_greeting_window" = "no"<br />

[Files_profile_del]<br />

del -s -f "%CurrentAppdataDir%\ACME"<br />

del "%userprofiledir%\<strong>opsi</strong>-winst-test.ini"<br />

[Patches_profile_ini]<br />

add [secdummy] dummy1=add1<br />

[Registry_currentuser_del]<br />

deletekey [HKCU\Software\ACME]<br />

Now a example which shows how standard installation scripts (setup32.ins and delsub32.ins) may used also as user-<br />

LoginScripts to avoid unneeded code doubling.<br />

setup32.ins:<br />

[Actions]<br />

requiredWinstVersion >= "4.11.3.2"<br />

DefVar $MsiId$<br />

DefVar $UninstallProgram$<br />

DefVar $ProductId$<br />

DefVar $InstallDir$<br />

; ----------------------------------------------------------------<br />

; - Please edit the following values -<br />

; ----------------------------------------------------------------<br />

Set $ProductId$ = "ACME"<br />

Set $InstallDir$ = "%ProgramFiles32Dir%\ACME"<br />

; ---------------------------------------------------------------comment<br />

"Show product picture"

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

Saved successfully!

Ooh no, something went wrong!