Views
WinstScripts
>>
off2007
last edited 11 months ago by sehlers
Three scripts: off2007.ins, deloff2007.ins and delsub.ins
Qualified for opsi 3.4
--------------------------------------------------------------------
off2007.ins
--------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
[Initial]
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $NewExe$
DefVar $InstallDir$
DefVar $Scriptpath$
Set $Scriptpath$ = "%ScriptPath%"
; This should be edited
set $ProductId$ = "Microsoft Office 2007"
set $MinimumSpace$ = "1999 MB"
set $InstallDir$="%ProgramFilesDir%\"+ "Microsoft Office\Office12"
set $NewExe$=$InstallDir$+"\Winword.exe"
DefVar $TEMP$
Set $TEMP$ = EnvVar("TEMP")
;Variables for OS version
DefVar $OS$
set $OS$ = GetOS
DefVar $MinorOS$
set $MinorOS$ = GetNTVersion
DefVar $InstallCommand$
DefVar $MyCompany$
Set $MyCompany$ = "xxxxxxxxxx"
; Message at install time:
Message "Installing "+$ProductId$+" ..."
; is this a win32 system ?
if ( $OS$ = "Windows_NT" OR $OS$ = "Windows_95" )
; is this a winxp sp2 system ?
if ( $MinorOS$ = "WinXP" OR $MinorOS$ = "Win NT 5.2" OR $MinorOS$ = "Windows Vista" )
if not(HasMinimumSpace ("%SYSTEMDRIVE%", $MinimumSpace$))
LogError "Not enough space on C: . "+$MinimumSpace$+" auf C: fuer "+$ProductId$+" erforderlich."
isFatalError
; Bearbeitung beenden und Produktschalter auf failed setzen
else
; show product picture
ShowBitmap /3 "%scriptpath%\office.png" $ProductId$
;if FileExists("%ScriptPath%\delsub.ins")
;; start uninstall
; sub "%ScriptPath%\delsub.ins"
;endif
; Message at install time:
Message "Installing "+$ProductId$+" ..."
; start setup program
Files_copy_config.xml
XMLPatch_config.xml "c:\tmp\config.xml"
if IniVar ("access") = "off"
XMLPatch_AccessOFF.xml "c:\tmp\config.xml"
else
if IniVar ("access") = "on"
XMLPatch_configACCESSON.xml "c:\tmp\config.xml"
endif
endif
Set $InstallCommand$ = "%SCRIPTPATH%\Setup.exe "
if (FileExists($NewExe$))
; Bestehende Installation
Set $InstallCommand$ = $InstallCommand$ + " /modify Enterprise "
endif
Set $InstallCommand$ = $InstallCommand$ + "/config c:\tmp\config.xml"
if not(FileExists($NewExe$))
; !!! The /adminfile command-line option can be used only during initial installation of the product.
; http://technet2.microsoft.com/Office/en-us/library/0f489f42-4c01-41d1-8b52-3a2a2da8f7311033.mspx?mfr=true
Set $InstallCommand$ = $InstallCommand$ + " /adminfile " + $Scriptpath$ + "\donotremoveaccess.MSP"
endif
Winbatch_install
if not(FileExists($NewExe$))
logError "Fatal: After Installation "+$NewExe$+" not found"
isFatalError
endif
;custom specific stuff
if FileExists("%ScriptPath%\custom_ins_dir\custom.ins")
sub "%ScriptPath%\custom_ins_dir\custom.ins"
endif
endif
ExitWindows /RebootWanted
endif
else
LogError "This is not a XP or Windows 2003 System."
isFatalError
endif
[Winbatch_install]
$InstallCommand$
[Files_copy_config.xml]
copy -v "%SCRIPTPATH%\config.xml" "c:\tmp"
[XMLPatch_config.xml]
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "COMPANYNAME"
attribute:"Value" value="$MyCompany$"
end
[XMLPatch_AccessOFF.xml]
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="ACCESSFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
[XMLPatch_configACCESSON.xml]
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="ACCESSFiles"
attribute: "State" value="local"
attribute: "Children" value="force"
end
[opsiServiceCall_getDomain]
"method": "getDomain"
"params": [
]
[opsiServiceCall_setProductInstallationStatus]
"method": "setProductInstallationStatus"
"params": [
"$UninstallProductId$",
"$ClientId$",
"$InstallationStatus$"
]
[opsiServiceCall_setActionRequestStatus]
"method": "setProductActionRequest"
"params": [
"$UninstallProductId$",
"$ClientId$",
"$ActionRequest$"
]
--------------------------------------------------------------------
deloff2007.ins
--------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
[Initial]
LogLevel=2
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Aktionen]
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $NewExe$
DefVar $InstallDir$
DefVar $InstallCommand$
; This should be edited
set $ProductId$ = "Office 2007"
set $MinimumSpace$ = "30 MB"
DefVar $TEMP$
Set $TEMP$ = EnvVar("TEMP")
;Variables for OS version
DefVar $OS$
DefVar $MinorOS$
DefVar $IstServicePack$
set $OS$ = GetOS
set $MinorOS$ = GetNTVersion
Set $IstServicePack$ = GetRegistryStringValue("[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion] CSDVersion")
ShowBitmap /3 "%scriptpath%\office.png" "Office2007"
; Message at install time:
Message "DEInstalling "+$ProductId$+" ..."
; is this a winxp system ?
if ( $OS$ = "Windows_NT" and $MinorOS$="WinXP")
if FileExists("%ScriptPath%\delsub.ins")
sub "%ScriptPath%\delsub.ins"
endif
endif
-------------------------------------------------------------------
delsub.ins
-------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
Message "Deinstalling "+$ProductId$+" ..."
DefVar $UninstallCommand$
DefVar $DisplayName$
DefVar $UninstallReg$
DefVar $MsiCode$
set $UninstallReg$="[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
set $MsiCode$="{90120000-0030-0000-0000-0000000FF1CE}"
set $DisplayName$ = GetRegistryStringValue (""+$UninstallReg$+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Found "+$DisplayName$+" => uninstalling first"
Files_copy_config.xml
XMLPatch_config.xml "c:\tmp\config.xml"
Set $InstallCommand$ = "%SCRIPTPATH%\Setup.exe "
Set $InstallCommand$ = $InstallCommand$ + " /modify Enterprise "
Set $InstallCommand$ = $InstallCommand$ + "/config c:\tmp\config.xml"
Winbatch_install
Message "Deinstalling "+$ProductId$+" DAUERT LANGE!"
set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
; Winbatch_uninstall /Waitseconds 1800
Winbatch_uninstall /Waitseconds 600
Winbatch_sleep
;
;LinkFolder_del_desktop
endif
[Files_copy_config.xml]
copy -v "%SCRIPTPATH%\config.xml" "c:\tmp"
[Winbatch_install]
$InstallCommand$
[Winbatch_uninstall]
$UninstallCommand$
[XMLPatch_config.xml]
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="ACCESSFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="OUTLOOKFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="GrooveFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="OneNoteFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="OneNoteFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="WORDFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="EXCELFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="PPTFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="PubPrimary"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="RMSFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="VisualStudio_PreviewServer_SPD"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="XDOCSFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="SHAREDFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
OpenNodeSet
- error_when_no_node_existing false
- warning_when_no_node_existing true
- error_when_nodecount_greater_1 false
- warning_when_nodecount_greater_1 true
- create_when_node_not_existing true
- attributes_strict false
documentroot
all_childelements_with:
elementname: "OptionState"
attribute:"Id" value="TOOLSFiles"
attribute: "State" value="absent"
attribute: "Children" value="force"
end
[Winbatch_sleep]
sleep 20