Sequencing Process for Apple Safari
Version 5.34.57.2
SUMMARY
This post outlines the process for sequencing the Apple Safari browser.
Obtain Package Source
Apple has stopped updating Safari for Windows and it is not offered on their website, but is available on Techspot. Download Safari.
Create Scripts for Install, Uninstall and Configuration
Although we are sequencing to an Appv package, we still need to create a set of text-based scripts to configure the browser and suppress several first-run options. These files can be adjusted to your preferences as required. Some of the settings in this example:
- Homepage is set to Intranet
- Browser default check is disabled
The files we will create prior to sequencing are these:
File contents
File Contents are as follows:
defaults.plist
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN”
“http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>HomePage</key>
<string>http://<CompanyIntranetPage>/</string>
<key>BypassDefaultBrowserCheck</key>
<true/>
<key>AskBeforeSubmittingInsecureForms</key>
<true/>
<key>AutoFillFromAddressBook</key>
<true/>
<key>AutoFillMiscellaneousForms</key>
<true/>
<key>AutoFillPasswords</key>
<false/>
<key>AutoOpenSafeDownloads</key>
<true/>
<key>BackForwardListSizeLimit</key> <integer>200</integer>
<key>BackForwardMenuSizeLimit</key>
<integer>30</integer>
<key>BookmarkFeedsInMail</key>
<false/>
<key>BookmarkFeedsInSafari</key>
<true/>
<key>BookmarksCollectionsIncludeAddressBook</key>
<true/>
<key>BookmarksCollectionsIncludeRendezvous</key>
<true/>
<key>BookmarksFlowToListHeightRatio</key>
<real>1</real>
<key>BookmarksMenuIncludesAddressBook</key>
<false/>
<key>BookmarksMenuIncludesBookmarksToolbar</key>
<true/>
<key>BookmarksMenuIncludesRendezvous</key>
<false/>
<key>BookmarksSearchFieldScope</key>
<integer>1</integer> <key>CommandClickMakesTabs</key>
<true/>
<key>ConfirmClosingMultiplePages</key>
<true/>
<key>DebugCachePageText</key>
<true/>
<key>DebugConfirmTossingUnsubmittedFormText</key>
<true/>
<key>DebugUseLightToolbarInFullScreen</key>
<true/>
<key>DefaultDatabaseQuota</key>
<integer>5242880</integer>
<key>ExtensionsEnabled</key>
<true/>
<key>FindOnPageMatchesWordStartsOnly</key>
<true/>
<key>HeaderFooterFontSize</key>
<integer>7</integer>
<key>HistoryAgeInDaysLimit</key>
<integer>31</integer>
<key>HistoryDaysMenuItemsLimit</key>
<integer>7</integer>
<key>InputFieldWidthRatio</key>
<string>2</string>
<key>LastMinimumFontSize</key>
<integer>9</integer>
<key>MaxTabsToOpenWithoutConfirmation</key>
<integer>50</integer>
<key>NSAllowSimpleArrowItemExpandDefault</key>
<true/>
<key>NSGrowBoxSurfaceEnabled</key>
<true/>
<key>PrintHeadersAndFooters</key>
<true/>
<key>RecentHistoryMenuItemsLimit</key>
<integer>18</integer>
<key>ResetSafariOptionsMask</key>
<integer>-1</integer>
<key>RSSBookmarksInBarAreSubscribed</key>
<true/>
<key>RunawayJavaScriptTimerEnabled</key>
<true/>
<key>SavePanelFileFormat</key>
<integer>1</integer>
<key>ShowFavoritesBar</key>
<true/>
<key>ShowLocationBar</key>
<true/>
<key>ShowStatusBar</key>
<false/>
<key>SidebarSplitViewDividerPosition</key>
<integer>300</integer>
<key>SnippetEditorAutoUpdate</key>
<true/>
<key>SnippetEditorDividerRatio</key>
<real>0.4</real>
<key>StartFlashAutomatically</key> <true/>
<key>TopSitesGridArrangement</key>
<integer>1</integer>
<key>URLMenuItemTitleMaxWidth</key>
<integer>400</integer>
<key>WarnAboutFraudulentWebsites</key>
<true/>
<key>WebKitCanvasUsesAcceleratedDrawing</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2CanvasUse sAcceleratedDrawing</key>
<true/>
<key>WebKitDNSPrefetchingEnabled</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2DNSPrefet chingEnabled</key>
<true/>
<key>WebKitEditableLinkBehavior</key>
<integer>4</integer>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2EditableL inkBehavior</key>
<integer>4</integer>
<key>WebKitFullScreenEnabled</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2FullScree nEnabled</key>
<true/>
<key>WebKitJavaScriptCanOpenWindowsAutomatically</key>
<false/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScrip tCanOpenWindowsAutomatically</key>
<false/>
<key>WebKitOfflineWebApplicationCacheEnabled</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2OfflineWe bApplicationCacheEnabled</key>
<true/>
<key>WebKitTextAreasAreResizable</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2TextAreas
AreResizable</key>
<true/>
<key>WebKitUseSiteSpecificSpoofing</key>
<true/>
<key>com.apple.Safari.ContentPageGroupIdentifier.WebKit2NeedsSite
SpecificQuirks</key>
<true/>
<key>WebContinuousSpellCheckingEnabled</key>
<true/>
<key>WebIconDatabaseEnabled</key>
<true/>
<key>WebKitCacheModelPreferenceKey</key>
<integer>2</integer>
<key>WebKitShrinksStandaloneImagesToFit</key>
<true/>
<key>WebKitZoomsTextOnly</key>
<false/>
</dict>
</plist>
Install
The installer is a VB script which we will use for our capture. It does not include options to close any running versions of Safari or to remove previous versions as we will be running this on our Appv sequencer machine. The steps it performs are:
- Installs Safari silently with configuration file
- Suppresses updates
- Removes Desktop shortcuts
Install.vbs
' This script performs the installation or uninstallation of an application(s).
' Created 25/11/2016 | cru2.io
'___________________________________________________________________________
' Variables
Set FSO = CreateObject(“Scripting.FileSystemObject”)
Set Shell = CreateObject(“Wscript.Shell”)
Set objWMI = GetObject(“winmgmts:\\.\root\cimv2”)
Set EnvVar = Shell.Environment(“PROCESS”)
Set objReg = GetObject(“winmgmts:\\.\root\default:StdRegProv”)
Const ForAppending = 8
Const forReading = 1
Const ForWriting = 2
Const HKCR = &H80000000
Const HKCU = &H80000001
Const HKLM = &H80000002 Const HKU = &H80000003
Const HKCC = &H80000005
'___________________________________________________________
Dim strComputer,CmD,Q,LogFile,WorkDir,strPFiles86
WorkDir = Split(WScript.ScriptFullName,WSCRIPT.ScriptName)(0) Q = Chr(034) set shellObj = WScript.CreateObject(“WScript.Shell”) strComputer = “.” strPFiles86 = Shell.ExpandEnvironmentStrings(“%ProgramFiles(x86)%”)
'Install Safari
shellObj.Run "msiexec.exe /i " & Q & WorkDir & "Safari.msi" & Q & " DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 /qn", 0, True
If FSO.FolderExists(strPFiles86 & "\Safari\Safari.resources") Then FSO.CopyFile WorkDir & "Defaults.plist",strPFiles86 & "\Safari\Safari.resources\Defaults.plist"
WScript.Quit(0)
Adobe Flash Plugin
The version of the Adobe Flash Plugin used by Safari is the NPAPI Plugin, which is not in the build. Therefore we need to include the Flash Plugin in our capture. The process for packaging the Flash plugin can be found in another post. It is important that during our capture steps that we capture this plugin as well, since it is not natively installed in the build.
Copy package files to sequencing machine
The sequencing machine I have used is a snapshotted VM. Start this VM up and copy our Safari and Flash NPAPI package folders to the local machine. When sequencing, shorter file paths work better, so we will copy to the root of C:\
Reboot VM
The Appv sequencer will complain about new files having recently been copied to the machine. The way to avoid this is to reboot immediately after copying over your source files, prior to starting the Sequencing process.
Sequencing the Package installs
Start the Microsoft Application Virtualization (App-V) Sequencer Tool).

Click Create a New Virtual Application Package.

Click Next.

At this point you will generally get some warnings. Assess and continue as appropriate. These two below can be ignored.

Click Next.

Because we are sequencing two separate packages together (Firefox + Flash), click Perform a custom installation and click Next.

Give your package a name and click Next.

The system collects information about it’s current state prior to the install.

Once you see this message, leave the sequencer open at this window and we can begin the installation.

Install Safari
Using our automated script we created earlier.

Install Flash
Once that is complete, run our automated Flash install.

Once the installs are complete, click I am finished installing and click Next.

You will see this message while the system compares it’s current state to the snapshot it took prior to the installs.

You now have an opportunity to launch the program so the sequencer can collect any firstrun options you want to include or dismiss.

The system compares any more changes you just made.

Some messages will be displayed for review. The Files excluded from package message generally refers to user profile data which we obviously do not want to include in a package being distributed to many.

At this point you have an opportunity to customise the package further. Click Customize and click Next.

Follow through the required re-launching of the program.
Under Target OS, select Allow this package to run only on the following operating systems.
Select Windows 10 64-bit and click Next.

Select Continue to modify package without saving using the package editor.

At this point you will see the warning dialog once more. Assess and continue as appropriate, click Close.
Select the Virtual Registry tab and remove unwanted entries, specifically those pertaining to the current user.

Select the Package Files tab and remove and User Profile related entries pertaining to the current user.
Click the Shortcuts and FTAs tab. Check you are happy with shortcuts and file associations. These can be adjusted or removed here.
Save AppV Package to desired location.
This can now be copied to the desired repository.

Testing the Appv Package
We can run some scripts to manually install or remove our Appv package on a test machine. We will use PowerShell scripts called by batch files:
Install.bat
:: This script performs the installation or uninstallation of an application(s).
:: Created 25/11/2016 | cru2.io
@echo off
PUSHD %~dp0
%WinDir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File ".\publish.ps1"
POPD
publish.ps1
# This script performs the installation or uninstallation of an application(s).
# Created 25/11/2016 | cru2.io
Import-Module AppVClient
Set-AppvClientConfiguration -EnablePackageScript $true
Add-AppvClientPackage “Apple Safari for Windows 5.34.appv” | Publish-AppvClientPackage -Global
Uninstall.bat
:: This script performs the installation or uninstallation of an application(s).
:: Created 25/11/2016 | cru2.io
@echo off
PUSHD %~dp0
%WinDir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File ".\unpublish.ps1"
POPD
unpublish.ps1
# This script performs the installation or uninstallation of an application(s).
# Created 25/11/2016 | cru2.io
Import-Module AppVClient
Set-AppvClientConfiguration -EnablePackageScript $true
Unpublish-AppvClientPackage "Apple Safari for Windows 5.34" -Global
Remove-AppvClientPackage "Apple Safari for Windows 5.34"
Final Package state
Your package folder should now look like this.

Upgrade Process
There is no upgrade process as Apple have discontinued Safari for Windows.