-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathInstall-FireFoxNoService.wsf
127 lines (90 loc) · 3.74 KB
/
Install-FireFoxNoService.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<job id="Install-FireFoxNoService">
<script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
<script language="VBScript">
' //----------------------------------------------------------------------------
' //
' // Solution: Richard's Deployment Script
' // File: Install-FireFoxNoService.wsf
' //
' // Purpose: This will install Mozilla Firefox with no Maintenance Service
' //
' // Author: Richard Tracy
' //
' // Usage: cscript Install-FireFoxNoService.wsf [/arch:x64|x86] [/debug:true]
' //
' //----------------------------------------------------------------------------
'//----------------------------------------------------------------------------
'// Global constant and variable declarations
'//----------------------------------------------------------------------------
Option Explicit
Dim iRetVal
'//----------------------------------------------------------------------------
'// Main routine
'//----------------------------------------------------------------------------
'On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0
'//---------------------------------------------------------------------------
'// Function: ZTIProcess()
'//---------------------------------------------------------------------------
Function ZTIProcess()
Dim sVersion,sArch,sFile
Dim sInstallName, sInstallerPath
Dim sServiceInstaller
Dim sInstalledPath
'// Apply Architecture arguments:
'If no argument provided check for MDT/SCCM variable
'If no variable or argument is provided, defualt to x86
If oUtility.Arguments.Exists("arch") Then
sArch = oUtility.Arguments("arch")
ElseIf oEnvironment.Exists("Architecture") Then
sArch = oEnvironment.Item("Architecture")
Else
sArch = "x86"
End If
'// Variables:
'// Change if needed
sVersion = "65.0"
If sArch = "x64" then
sFile = "Firefox Setup " & sVersion & " (x64)\Setup.exe"
Else
sFile = "Firefox Setup " & sVersion & "\Setup.exe"
End If
If sArch = "x64" then
sServiceInstaller = oUtility.ScriptDir & "\Firefox Setup " & sVersion & " (x64)\core\maintenanceservice_installer.exe"
Else
sServiceInstaller = oUtility.ScriptDir & "\Firefox Setup " & sVersion & "\core\maintenanceservice_installer.exe"
End If
sInstallName = "Mozilla Firefox"
sInstallerPath = oUtility.ScriptDir & "\Source\" & sFile
'// Start the process
oLogging.CreateEntry "Starting " & sInstallName & " (" & sVersion & ") " & sArch & " installation", LogTypeInfo
If not oFSO.FileExists(sInstallerPath) then
oLogging.CreateEntry sInstallerPath & " was not found, unable to install " & sInstallName & " (" & sVersion & ")", LogTypeError
ZTIProcess = Failure
Exit Function
End if
'// Disable Zone Checks
oEnv("SEE_MASK_NOZONECHECKS") = 1
'// delete core\maintenanceservice_installer.exe
If oFSO.FileExists(sServiceInstaller) Then
oFSO.DeleteFile sServiceInstaller
end if
iRetVal = oUtility.RunWithHeartbeat("""" & sInstallerPath & """ -ms /INI=""" & oUtility.ScriptDir & "\Configs\firefox.ini""""")
if (iRetVal = 0) or (iRetVal = 3010) then
ZTIProcess = Success
oLogging.CreateEntry "Finished " & sInstallName & " installation", LogTypeInfo
sInstalledPath = "C:\Program Files\Mozilla Firefox"
oFSO.CopyFile (oUtility.ScriptDir & "\Configs\mozilla.cfg"), (sInstalledPath & "\mozilla.cfg"), True
oFSO.CopyFile (oUtility.ScriptDir & "\Configs\override.ini"), (sInstalledPath & "\browser\override.ini"), True
oFSO.CopyFile (oUtility.ScriptDir & "\Configs\local-settings.js"), (sInstalledPath & "\defaults\pref\local-settings.js"), True
Else
ZTIProcess = Failure
oLogging.CreateEntry sInstallName & " installation failed with exit code = " & iRetVal, LogTypeError
End If
'// Enable Zone Checks
oEnv.Remove("SEE_MASK_NOZONECHECKS")
End Function
</script>
</job>