poniedziałek, 28 lipca 2008

optymalizacja adobe acrobat

optymalizacja adobe acrobat za pomoca skryptów bat.

przygotowałem własny pakiet msi

Installation Script for Adobe Reader 8.1 - Method 2 and 3
PDF Print
Written by Joe Shonk
Monday, 09 July 2007

Methods 2 and 3

In Install Script for Adobe Reader 8.1 - Method 1 we utilized the Adobe distributed package (AdbeRdr810_en_US.exe ) to perform an installation of Adobe Reader 8.1. For the most part this method works but leaves us with a few interesting challenges:

1) The NOSSO wrapped .msi package uses its own set of switches. The /l switch for logging does not allow you to specify a location for the log file. The /msi switch can be used to pass switches and properties to the MSIEXEC installer but since the value for this switch is set in quotes you won’t be able to use parameters that also need to be in quotes (i.e. /msi=”/l* “C:\Log Files\Adobe Reader 8.1.0.log”” will NOT work)

2) The NOSSO wrapped .msi package will unpack and expand the install files before installation. You can pre-extract the installation files and shave 30-60 seconds off your installation. While 30-60 seconds doesn’t seem like a lot, it does add up if you look at optimizing (one method or another) your other install scripts.

3) If using this method on a Terminal Server/Citrix Server, you MUST be in CHANGE USER /INSTALL mode. If not, the installation will require manual intervention before installation script will continue. I know many of you are already thinking that you should always install applications on a Terminal Server in INSTALL mode. Yes and no. There are many of us (myself included) who like having a little more control over the shadow keys area. This does require a thorough understanding of how shadow keys work.

Method 2 and 3 involves using the .msi package that has been extracted from the AdbeRdr810_en_US.exe distribution package. There are several advantages to doing this. First, the files are already extracted so it’s one less step the installer has to perform (Method 3 only). Second, you can use MSIEXEC switches and properties (This includes specifying the location of the log file). Third, you do not have to be in install mode for the installation to complete when installing on a Terminal Server.

The difference between Method 2 and 3 is in Method 2 the script will extract the source files (from AdbeRdr810_en_US.exe) as part of the script and in Method 3 we skip this step and install from a pre-extracted source.

Install_Adobe_Reader_Method 2.cmd:

TITLE Install Adobe Acrobat Reader 8.1.0
:: Written by Joe Shonk

setlocal
set AppSourcePath=\\server\share\adobe reader 8.1\
set AppExtractPath=%temp%\Adobe Reader 8
set AppLogFile="%temp%\adobe8.log"

set move_start_menu_icon=y
set del_desktop_icons=y

:: Specifiy which MSIEXEC Switches and Properties to use.
set switches=/qb
set switches=%switches% EULA_ACCEPT=YES
set switches=%switches% SUPPRESS_APP_LAUNCH=YES
set switches=%switches% ENABLE_CACHE_FILES=YES

pushd %AppSourcePath%
start /wait AdbeRdr810_en_US.exe -nos_ne -nos_o"%AppExtractPath%

pushd %AppExtractPath%
start /wait msiexec /i AcroRead.msi %switches% /l %AppLogFile%
popd

rd /s /q "%AppExtractPath%"

set regKey="HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer"
REG ADD %regKey% /v EULA /t REG_DWORD /d 1 /f
REG ADD %regKey% /v Launched /t REG_DWORD /d 1 /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown"
REG ADD %regKey% /v bUpdater /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowAdsAllow /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bPurchaseAcro /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bEFIPrintMe /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bRegisterProduct /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bCreatePDFOnline /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowEbookMenu /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bFedExInternetPrinting /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bBrowserIntegration /t REG_DWORD /d 0 /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown\cHostedServices\cMeeting"
REG ADD %regKey% /v bShowMeets /d 0 /t REG_DWORD /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown\cHostedServices\cProtectPDF"
REG ADD %regKey% /v bShowMeets /d 0 /t REG_DWORD /f

set regKey="HKLM\Software\Policies\Adobe\Adobe Acrobat\8.0\FeatureLockDown\cDocumentStatus"
REG ADD %regKey% /v bSuppressMessageBar /d 1 /t REG_DWORD /f
REG ADD %regKey% /v bSuppressStatusDialog /d 1 /t REG_DWORD /f

set regKey="HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdsInReader"
REG ADD %regKey% /v bShowAds /t REG_DWORD /d 0 /f

set regKey="HKLM\Software\Adobe\Acrobat Reader\8.0\Downtown"
REG ADD %regKey% /v bDontShowAtLaunch /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bGoOnline /t REG_DWORD /d 0 /f

set regKey="HKLM\Software\Adobe\Acrobat Reader\8.0\Updater"
REG ADD %regKey% /v bShowAutoUpdateConfDialog /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowNotifDialog /t REG_DWORD /d 0 /f
REG ADD %regKey% /v iUpdateFrequency /t REG_DWORD /d 0 /f

set regKey="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
REG DELETE %regKey% /v "Adobe Reader Speed Launcher" /f

if /i "%move_start_menu_icon:~0,1%" == "y" (
move /Y "%AllUsersProfile%\Start Menu\Programs\Adobe Reader 8.lnk" "%AllUsersProfile%\Start Menu\Programs\Accessories\"
)

if /i "%del_desktop_icons:~0,1%" == "y" (
del "%AllUsersProfile%\Desktop\Adobe Reader 8.lnk"
)

popd
endlocal

In order for the script in Method 3 to work, the AdbeRdr810_en_US.exe package needs to be extracted first. From a command prompt type:

AdbeRdr810_en_US.exe -nos_ne -nos_o"C:\Adobe Reader 8
(Note, the end quote on the above line was left off on purpose. You will get an error if it is added.)
Now move the contents of C:\Adobe Reader 8\ to your favorite file share.

Install_Adobe_Reader_Method_3.cmd:

TITLE Install Adobe Acrobat Reader 8.1
:: Written by Joe Shonk

setlocal
set AppSourcePath=\\server\share\adobe reader 8.1
set AppLogFile="%temp%\adobe8.log"

set move_start_menu_icon=y
set del_desktop_icons=y

:: Specifiy which MSIEXEC Switches and Properties to use.
set switches=/qb
set switches=%switches% EULA_ACCEPT=YES
set switches=%switches% SUPPRESS_APP_LAUNCH=YES
set switches=%switches% ENABLE_CACHE_FILES=YES

pushd %AppSourcePath%

start /wait msiexec /i AcroRead.msi %switches% /l %AppLogFile%

set regKey="HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer"
REG ADD %regKey% /v EULA /t REG_DWORD /d 1 /f
REG ADD %regKey% /v Launched /t REG_DWORD /d 1 /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown"
REG ADD %regKey% /v bUpdater /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowAdsAllow /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bPurchaseAcro /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bEFIPrintMe /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bRegisterProduct /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bCreatePDFOnline /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowEbookMenu /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bFedExInternetPrinting /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bBrowserIntegration /t REG_DWORD /d 0 /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown\cHostedServices\cMeeting"
REG ADD %regKey% /v bShowMeets /d 0 /t REG_DWORD /f

set regKey="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown\cHostedServices\cProtectPDF"
REG ADD %regKey% /v bShowMeets /d 0 /t REG_DWORD /f

set regKey="HKLM\Software\Policies\Adobe\Adobe Acrobat\8.0\FeatureLockDown\cDocumentStatus"
REG ADD %regKey% /v bSuppressMessageBar /d 1 /t REG_DWORD /f
REG ADD %regKey% /v bSuppressStatusDialog /d 1 /t REG_DWORD /f

set regKey="HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdsInReader"
REG ADD %regKey% /v bShowAds /t REG_DWORD /d 0 /f

set regKey="HKLM\Software\Adobe\Acrobat Reader\8.0\Downtown"
REG ADD %regKey% /v bDontShowAtLaunch /t REG_DWORD /d 1 /f
REG ADD %regKey% /v bGoOnline /t REG_DWORD /d 0 /f

set regKey="HKLM\Software\Adobe\Acrobat Reader\8.0\Updater"
REG ADD %regKey% /v bShowAutoUpdateConfDialog /t REG_DWORD /d 0 /f
REG ADD %regKey% /v bShowNotifDialog /t REG_DWORD /d 0 /f
REG ADD %regKey% /v iUpdateFrequency /t REG_DWORD /d 0 /f

set regKey="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
REG DELETE %regKey% /v "Adobe Reader Speed Launcher" /f

if /i "%move_start_menu_icon:~0,1%" == "y" (
move /Y "%AllUsersProfile%\Start Menu\Programs\Adobe Reader 8.lnk" "%AllUsersProfile%\Start Menu\Programs\Accessories\"
)

if /i "%del_desktop_icons:~0,1%" == "y" (
del "%AllUsersProfile%\Desktop\Adobe Reader 8.lnk"
)

popd
endlocal

2 komentarze:

Joanna Zadrożna pisze...

Jestem pod wrażeniem. Bardzo ciekawie napisany artykuł.

Agata Borowska pisze...

Fajnie wyczerpany teamt.