Skip to content

Commit 6d90bd6

Browse files
committed
fix: Windows installation VBS script should not try to install on x86 since 1.8
Closes #728
1 parent de5f5b5 commit 6d90bd6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

contrib/windows/glpi-agent-deployment.vbs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,24 @@ Function isNightly(strng)
328328
Exit Function
329329
End Function
330330

331+
' Major version 1 and Minor version greater than 7 doesn't support x86
332+
Function doesNotSupportX86(strng)
333+
Dim regEx, matches, major, minor
334+
Set regEx = New RegExp
335+
regEx.Global = true
336+
regEx.Pattern = "^([0-9]+)\.([0-9]+)"
337+
Set matches = regEx.Execute(strng)
338+
doesNotSupportX86 = False
339+
If matches.count > 0 Then
340+
major = matches(0).SubMatches(0)
341+
minor = matches(0).SubMatches(1)
342+
If major = 1 And minor > 7 Then
343+
doesNotSupportX86 = True
344+
End If
345+
End If
346+
Exit Function
347+
End Function
348+
331349
Function IsInstallationNeeded(strSetupVersion, strSetupArchitecture, strSystemArchitecture)
332350
Dim strCurrentSetupVersion
333351
' Compare the current version, whether it exists, with strSetupVersion
@@ -577,6 +595,14 @@ If (strSystemArchitecture = "x86") And (SetupArchitecture = "x64") Then
577595
WScript.Quit 3
578596
End If
579597

598+
' Check if we are trying to installed version not supporting x86
599+
If (SetupArchitecture = "x86") And doesNotSupportX86(SetupVersion) Then
600+
' Support of 32-bit operative system has since discontinued since 1.8
601+
ShowMessage("GLPI-Agent v" & SetupVersion & " doesn't support installation on a 32-bit operative system.")
602+
ShowMessage("Deployment aborted!")
603+
WScript.Quit 4
604+
End If
605+
580606
bInstall = False
581607
strInstallOrRepair = "/i"
582608

0 commit comments

Comments
 (0)