Unattended Install Script til Terminal og Citrix Servere

Nedenstående lister et unattended install script (RunOnceEx.cmd) til Terminal/Citrix servere. De fleste registry settings er taget fra www.appdeploy.com.
Det kan nemt udvides til andre applikationer. Dette script sikre en ensartet installationsrutine for alle serverne.
Kør scriptet efter du har installeret Terminal Services og genstart serveren. Næste gang man logger ind på serveren, vil scriptet blive afviklet.
For mere info omkring RunOnceEx.cmd, se dette link http://unattended.msfn.org/unattended.xp/view/web/31/.
Forinden har jeg lavet et network share på en given server (\WIN-VS-001XenApp). Her ligger jeg alle mine ønskede software pakker.
I forbindelse med Application Deployment skal man altid benytte såkaldte DFS path for at bevare UNC navnet til ens software reposetory.
Nedenstående billede viser scriptet der bliver afviklet når man logger ind på serveren.

Jeg har valgt at installere følgende applikationer:
Java – Adobe Flash Player – Adobe Shockwave – Adobe reader – UPHClean – ThreadMaster – Office 2007 + SaveAsPDFandXPS + Office 2007 SP1.

@ECHO OFF
SET KEY=HKLMSOFTWAREMicrosoftWindowsCurrentVersionRunOnceEx

REG ADD %KEY% /V TITLE /D “Citrix XenApp – Deploy Applications” /f

REG ADD %KEY%00 /VE /D “Change User /install” /f
REG ADD %KEY%00 /V 1 /D “\WIN-VS-001XenAppInstall.cmd” /f

REG ADD %KEY%05 /VE /D “Java Runtime Environment 6 Update 3” /f
REG ADD %KEY%05 /V 1 /D “\WIN-VS-001XenAppJava16_3Java16_3.cmd” /f

REG ADD %KEY%10 /VE /D “Adobe Flash Player” /f
REG ADD %KEY%10 /V 1 /D “\WIN-VS-001XenAppFP9FP9.cmd” /f

REG ADD %KEY%15 /VE /D “Adobe Shockwave” /f
REG ADD %KEY%15 /V 1 /D “\WIN-VS-001XenAppSWP10_1SWP10_1.cmd” /f

REG ADD %KEY%20 /VE /D “Adobe Reader” /f
REG ADD %KEY%20 /V 1 /D “\WIN-VS-001XenAppAdobeR812AdobeR812.cmd” /f

REG ADD %KEY%25 /VE /D “User Profile Hive Cleanup Service” /f
REG ADD %KEY%25 /V 1 /D “\WIN-VS-001XenAppUPHCleanUPHClean.cmd” /f

REG ADD %KEY%30 /VE /D “ThreadMaster” /f
REG ADD %KEY%30 /V 1 /D “\WIN-VS-001XenAppThreadMasterTM.cmd” /f

REG ADD %KEY%35 /VE /D “Office 2007 Prof” /f
REG ADD %KEY%35 /V 1 /D “\WIN-VS-001XenAppOffice2007Office.cmd” /f

REG ADD %KEY%40 /VE /D “SaveAsPDFandXPS” /f
REG ADD %KEY%40 /V 1 /D “\WIN-VS-001XenAppSaveAsPDFandXPSSaveAsPDFandXPS.cmd” /f

REG ADD %KEY%45 /VE /D “Office 2007 SP1” /f
REG ADD %KEY%45 /V 1 /D “\WIN-VS-001XenAppOffice2007SP1Office2007SP1.cmd” /f

REG ADD %KEY%99 /VE /D “Change User /execute” /f
REG ADD %KEY%09 /V 1 /D “\WIN-VS-001XenAppExecute.cmd” /f

REG ADD %KEY%100 /VE /D “Reboot Server” /f
REG ADD %KEY%100 /V 1 /D “\WIN-VS-001XenAppReboot.cmd” /f

EXIT

Java16_3.cmd:
@ECHO OFF
ECHO Java Runtime Environment 6 Update 3
START /WAIT \WIN-VS-001XenAppJava16_3jre-6u3-windows-i586-p-s.exe /s ADDLOCAL=jrecore IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 REBOOT=Suppress /L %SYSTEMROOT%TEMPJRE6setup.log
START /WAIT \WIN-VS-001XenAppJava16_3Java.vbs

Java.vbs:
Option Explicit
Dim objReg, strComputer
Dim strKeyPath1, strKeyPath2
Dim strValueName1, strValueName2, strValueName3, strValueName4, strValueName5
Dim EnableDWord, DisableDWord
const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = “SOFTWAREJavaSoftJava Plug-in1.6.0_03”
strKeyPath2 = “SOFTWAREJavaSoftJava UpdatePolicy”
strValueName1 = “HideSystemTrayIcon”
strValueName2 = “EnableJavaUpdate”
strValueName3 = “NotifyDownload”
strValueName4 = “NotifyInstall”
strValueName5 = “EnableAutoUpdateCheck”
EnableDWord = 00000001
DisableDWord = 00000000
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\”&_
strComputer & “rootdefault:StdRegProv”)
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath1
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath2
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName1,EnableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName2,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName3,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName4,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName5,DisableDWord

FP9.cmd:
@ECHO OFF
ECHO Adobe Flash Player 9.0
START /WAIT MSIEXEC /I “\WIN-VS-001XenAppFP9install_flash_player_active_x.MSI” ALLUSERS=TRUE REBOOT=SUPPRESS /QB

SWP10_1.cmd:
@ECHO OFF
ECHO Adobe Shockwave 10.1
START /WAIT MSIEXEC /I “\WIN-VS-001XenAppSWP10_1sw_lic_full_installer.MSI” ALLUSERS=TRUE REBOOT=SUPPRESS /QB
START /WAIT \WIN-VS-001XenAppSWP10_1SWP.vbs

SWP.vbs:
Option Explicit
Dim objReg, strComputer
Dim strKeyPath1, strKeyPath2
Dim strValueName1
Dim strValue
const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = “SOFTWAREMacromediaShockwave 10AutoUpdate”
strKeyPath2 = “SOFTWAREMacromediaShockwave 10CollectStatistics”
strValueName1 = “”
strValue = “n”
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\”&_
strComputer & “rootdefault:StdRegProv”)
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath1
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath2
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName1,strValue
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName1,strValue

AdobeR812.cmd:
@ECHO OFF
ECHO Adobe Reader 8.1.2
START /WAIT MSIEXEC /I “\WIN-VS-001XenAppAdobeR812AcroRead.msi” ALLUSERS=TRUE EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES TRANFORMS=Reader8xAdvanced.mst /QB-
START /WAIT \WIN-VS-001XenAppAdobeR812AdobeReader.vbs

AdobeReader.vbs:
Option Explicit
Dim objReg, strComputer
Dim strKeyPath1, strKeyPath2, strKeyPath3, strKeyPath4,strKeyPath5
Dim strValueName1, strValueName2, strValueName3, strValueName4, strValueName5, strValueName6, strValueName7, strValueName8, strValueName9
Dim EnableDWord, DisableDWord
const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = “SoftwareAdobeAcrobat Reader8.0AdobeViewer”
strKeyPath2 = “SoftwareAdobeAcrobat Reader8.0Downtown”
strKeyPath3 = “SOFTWAREPoliciesAdobeAcrobat Reader8.0FeatureLockdown”
strKeyPath4 = “SOFTWAREPoliciesAdobeAcrobat Reader8.0FeatureLockdowncHostedServicescMeeting”
strKeyPath5 = “SOFTWAREPoliciesAdobeAcrobat Reader8.0FeatureLockdowncHostedServicescProtectPDF”
strValueName1 = “EULA”
strValueName2 = “Launched”
strValueName3 = “bDontShowAtLaunch”
strValueName4 = “bGoOnline”
strValueName5 = “bPurchaseAcro”
strValueName6 = “bShowEbookMenu”
strValueName7 = “bUpdater”
strValueName8 = “bShowMeets”
strValueName9 = “bShowMeets”
EnableDWord = 00000001
DisableDWord = 00000000
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\”&_
strComputer & “rootdefault:StdRegProv”)
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath1
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath2
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath3
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath4
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath5
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName1,EnableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName2,EnableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName3,EnableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName4,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath3,strValueName5,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath3,strValueName6,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath3,strValueName7,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath4,strValueName8,DisableDWord
objReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath5,strValueName9,DisableDWord

UPHClean.cmd:
@ECHO OFF
ECHO User Profile Hive Cleanup Service
START /WAIT MSIEXEC /I “\WIN-VS-001XenAppUPHCleanUPHClean-Setup.msi” /QB

TM.cmd:
Jeg har her benyttet det medfølgende install script og ændret følgende for at kunne installere fra en netværks-share:
REM cd /D %~p0
copy /Y \WIN-VS-001XenAppThreadMaster*.* %zInstDir% >NUL
START /WAIT \WIN-VS-001XenAppThreadMasterTM.vbs

TM.vbs:
Option Explicit
Dim objReg, strComputer
Dim strKeyPath1
Dim strValueName1
Dim strValue
const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = “SYSTEMCurrentControlSetServicesThreadMasterParameters”
strValueName1 = “MainSampleTime”
strValue = “15”
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\”&_
strComputer & “rootdefault:StdRegProv”)
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath1
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName1,strValue

Office.cmd:
@ECHO OFF
ECHO Office 2007 Prof.
START /WAIT \WIN-VS-001XenAppOffice2007Setup.exe
REGSVR32 /U %SYSTEMROOT%SYSTEM32MSCTF.DLL /S
START /WAIT \WIN-VS-001XenAppOffice2007Office.vbs

Office.vbs:
Option Explicit
Dim objReg, strComputer
Dim strKeyPath1, strKeyPath2
const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath1 = “SOFTWAREMicrosoftWindows NTCurrentVersionTerminal ServerInstallSoftwareMicrosoftOfficeCommonUserInfo”
strKeyPath2 = “SOFTWAREMicrosoftWindows NTCurrentVersionTerminal ServerInstallSoftwareMicrosoftOfficeCommon”
strComputer = “.”
Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\”&_
strComputer & “rootdefault:StdRegProv”)
objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath1
objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath2

SaveAsPDFandXPS.cmd:
@ECHO OFF
ECHO SaveAsPDFandXPS
START /WAIT \WIN-VS-001XenAppSaveAsPDFandXPSSaveAsPDFandXPS.exe /QUIET

Office2007SP1.cmd:
@ECHO OFF
ECHO Office 2007 SP1
START /WAIT \WIN-VS-001XenAppOffice2007SP1office2007sp1-kb936982-fullfile-da-dk.exe /passive /norestart

Reboot.cmd:
@ECHO OFF
shutdown.exe -r -f -t 60

Nedenstående, lister en række gode links i forhold til ovenstående applikationer:

Java:
Direkte download link til Java Runtime Environment 6 Update 3.
http://javadl.sun.com/webapps/download/AutoDL?BundleId=12798
Lockdown settings for java.
http://www.appdeploy.com/packages/detail.asp?id=923

Adobe flash and Shockwave:
Direkte link til MSI filerne. Kræver en registrering.
http://www.adobe.com/licensing/distribution/

Adobe Reader:
Direkte download link til nyeste offline fil.
http://www.adobe.com/products/acrobat/readstep2.html?type=distrib
Kommando til at upakke exe-filen er som følger:
AdbeRdr812_en_US.EXE -nos_ne – MSI filen vil blive extractet i Documents and Settings<username>Local SettingsTempAdobe Reader.
Lockdown settings for Adobe Reader.
http://www.appdeploy.com/packages/detail.asp?id=915

UPHClean:
http://www.microsoft.com/downloads/details.aspx?FamilyID=1B286E6D-8912-4E18-B570-42470E2F3582&displaylang=en

ThreadMaster:
http://threadmaster.tripod.com/
Guide til ThreadMaster.
http://www.msterminalservices.org/articles/ThreadMaster-Rogue-Applications.html

Office 2007 i et Terminal Server miljø:
http://support.microsoft.com/?kbid=823586
http://www.microsoft.com/technet/technetmag/issues/2008/02/OfficeTS/default.aspx
http://technet2.microsoft.com/Office/en-us/library/7e816caa-7c1c-4d78-ac28-693aa4ea58d81033.mspx?mfr=true
Considerations when installing Outlook 2007 in a Terminal Services environment
http://technet2.microsoft.com/Office/en-us/library/ba930d00-dc38-4564-ad00-8304d74f1d8c1033.mspx?mfr=true

Nedenstående billeder viser Outlook settings via Office Customization Tool (OCT). Man gemmer til sidst sin tilrettet MSP-fil i Office Updates folderen.



Alle feature lockdowns styrer jeg via Office 2007 GPO templates.
Her kan bla nævnes, Customer Experience Improvement- Office Diagnostic – Office update – Outlook AutoArchive mfl.

Comments are closed.