1 | ; Copyright (c) uib gmbh (www.uib.de)
|
---|
2 | ; This sourcecode is owned by uib gmbh
|
---|
3 | ; and published under the Terms of the General Public License.
|
---|
4 | ; credits: http://www.opsi.org/credits/
|
---|
5 |
|
---|
6 | [Actions]
|
---|
7 | requiredWinstVersion >= "4.10.8.6"
|
---|
8 |
|
---|
9 | DefVar $MsiId32$
|
---|
10 | DefVar $UninstallProgram32$
|
---|
11 | DefVar $MsiId64$
|
---|
12 | DefVar $UninstallProgram64$
|
---|
13 | DefVar $LogDir$
|
---|
14 | DefVar $ExitCode$
|
---|
15 | DefVar $ProductId$
|
---|
16 | DefVar $InstallDir32$
|
---|
17 | DefVar $InstallDir64$
|
---|
18 | DefVar $LicenseRequired$
|
---|
19 | DefVar $LicensePool$
|
---|
20 | DefVar $INST_SystemType$
|
---|
21 | DefVar $INST_architecture$
|
---|
22 |
|
---|
23 | Set $INST_SystemType$ = GetSystemType
|
---|
24 | set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
|
---|
25 |
|
---|
26 |
|
---|
27 | Set $LogDir$ = "%SystemDrive%\tmp"
|
---|
28 |
|
---|
29 | ; ----------------------------------------------------------------
|
---|
30 | ; - Please edit the following values -
|
---|
31 | ; ----------------------------------------------------------------
|
---|
32 | Set $ProductId$ = "xenserver-tools"
|
---|
33 | Set $InstallDir32$ = "%ProgramFiles32Dir%\Citrix\XenTools"
|
---|
34 | Set $InstallDir64$ = "%ProgramFiles64Dir%\Citrix\XenTools"
|
---|
35 | Set $LicenseRequired$ = "false"
|
---|
36 | Set $LicensePool$ = "p_" + $ProductId$
|
---|
37 | ; ----------------------------------------------------------------
|
---|
38 |
|
---|
39 |
|
---|
40 | comment "Show product picture"
|
---|
41 | ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
|
---|
42 |
|
---|
43 | Message "Uninstalling " + $ProductId$ + " ..."
|
---|
44 |
|
---|
45 | if FileExists("%ScriptPath%\delsub.ins")
|
---|
46 | comment "Start uninstall sub section"
|
---|
47 | Sub "%ScriptPath%\delsub.ins"
|
---|
48 | endif
|
---|
49 |
|
---|
50 | if $LicenseRequired$ = "true"
|
---|
51 | comment "Licensing required, free license used"
|
---|
52 | Sub_free_license
|
---|
53 | endif
|
---|
54 |
|
---|
55 | [Sub_free_license]
|
---|
56 | if opsiLicenseManagementEnabled
|
---|
57 | comment "License management is enabled and will be used"
|
---|
58 |
|
---|
59 | comment "Trying to free license used for the product"
|
---|
60 | DefVar $result$
|
---|
61 | Set $result$ = FreeLicense($LicensePool$)
|
---|
62 | ; If there is an assignment of a license pool to the product, it is possible to use
|
---|
63 | ; Set $result$ = FreeLicense("", $ProductId$)
|
---|
64 | ;
|
---|
65 | ; If there is an assignment of a license pool to a windows software id, it is possible to use
|
---|
66 | ; DefVar $WindowsSoftwareId$
|
---|
67 | ; $WindowsSoftwareId$ = "..."
|
---|
68 | ; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
|
---|
69 | else
|
---|
70 | LogError "Error: licensing required, but license management not enabled"
|
---|
71 | isFatalError
|
---|
72 | endif
|
---|
73 |
|
---|
74 |
|
---|
75 |
|
---|