• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script et agent 2.3.0
#26
Hi mips,

Is this better for you?

Code:
@@ -190,7 +190,7 @@ Function IsInstallationNeeded (strSetupVersion, strSetupArchitecture)
    IsInstallationNeeded = False
    ' Get operative system architecture
    '    It can be 'x86', 'AMD64' or 'x64'
-   strSystemArchitecture = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
+   strSystemArchitecture = WshShell.Environment("System").Item("PROCESSOR_ARCHITECTURE")
    ' Check the operative system architecture
    If strSystemArchitecture = "x86" Then
       ' The system architecture is 32-bit
Tomás Abad
  Reply
#27
Yes, i think is better and fast than reg query.

thanks

@+ (See you later)
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#28
Hi

I have do the same think that mips and so i have a heterogeneous park
and i do some change about setup32 and setup64

Option Explicit
Dim Setup, SetupArchitecture, SetupLocation, SetupOptions, SetupVersion, SetupVerbose, Setup32, Setup64


SetupArchitecture = "auto"

' SetupOptions
' Consult the installer documentation to know its list of options.
'
SetupOptions = "/acceptlicense /runnow /server='http://<server>/plugins/fusioninventory/' /tag=TAG /httpd-trust=127.0.0.1 /S"

' Setup
' The installer file name. You should not have to modify this variable ever.
'
Setup32 = "fusioninventory-agent_windows-x86_" & SetupVersion & ".exe"
Setup64 = "fusioninventory-agent_windows-x64_" & SetupVersion & ".exe"

and

If strSystemArchitecture = "x86" Then
' The system architecture is 32-bit
' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
' This subkey is now deprecated
On error resume next
strCurrentSetupVersion =WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent\DisplayVersion")
If Err.Number = 0 Then
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
If strCurrentSetupVersion <> strSetupVersion Then
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strCurrentSetupVersion & "' -> '" & strSetupVersion & "'"
End If
IsInstallationNeeded = True
setup = setup32
End If
Exit Function
Else
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' doesn't exist
Err.Clear
' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
On error resume next
strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
If Err.Number = 0 Then
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
If strCurrentSetupVersion <> strSetupVersion Then
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strCurrentSetupVersion & "' -> '" & strSetupVersion & "'"
End If
setup = setup32
IsInstallationNeeded = True
End If
Exit Function
Else
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
Err.Clear
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strSetupVersion & "'"
End If
setup = setup32
IsInstallationNeeded = True
End If
End If
Else
' The system architecture is 64-bit
' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
' This subkey is now deprecated
On error resume next
strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent\DisplayVersion")
If Err.Number = 0 Then
' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
If strCurrentSetupVersion <> strSetupVersion Then
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strCurrentSetupVersion & "' -> '" & strSetupVersion & "'"
End If
setup = setup64
IsInstallationNeeded = True
End If
Exit Function
Else
' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' doesn't exist
Err.Clear
' Check if the subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
On error resume next
strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
If Err.Number = 0 Then
' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
If strCurrentSetupVersion <> strSetupVersion Then
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strCurrentSetupVersion & "' -> '" & strSetupVersion & "'"
End If
setup = setup64
IsInstallationNeeded = True
End If
Exit Function
Else
' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
Err.Clear
' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
On error resume next
strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
If Err.Number = 0 Then
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
If strCurrentSetupVersion <> strSetupVersion Then
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strCurrentSetupVersion & "' -> '" & strSetupVersion & "'"
End If
setup = setup64
IsInstallationNeeded = True
End If
Exit Function
Else
' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
Err.Clear
If SetupVerbose <> "No" Then
Wscript.Echo "Installation needed: '" & strSetupVersion & "'"
End If
setup = setup64
IsInstallationNeeded = True
End If
End If
End If
End If
End Function

'
'
' MAIN
'
Merci

GLPI 0.90.5/ Plugins Fusion : 090+1.4 / Agent : 2.3.18 < Serveur Centos 64 Bits>
  Reply
#29
Hello to everybody,

This is the new code; better (I think so), tested and ready to use. I hope that it be soon available from GitHub (already available). I wait your comments.

These are the changes:
  • Add authors' names and e-mails.
  • Add auto detection of SetupArchitecture.
    Proposed-by: Christophe Pujol <chpujol@gmail.com>
    Lee[/*]
  • Remove Setup after installation whether SetupLocation is an URL.
    Proposed-by: Tomas Abad <tabadgp@gmail.com>[/*]
  • Add Force feature.
    Proposed-by: Tomas Abad <tabadgp@gmail.com>[/*]
  • Improve system architecture detection.
    Proposed-by: Christophe Pujol <chpujol@gmail.com>[/*]
  • Improve and add comments.
  • Improve code.

Code:
'
'  ------------------------------------------------------------------------
'  fusioninventory-agent-deployment.vbs
'  Copyright (C) 2010-2013 by the FusionInventory Development Team.
'
'  http://www.fusioninventory.org/ http://forge.fusioninventory.org/
'  ------------------------------------------------------------------------
'
'  LICENSE
'
'  This file is part of FusionInventory project.
'
'  This file is free software; you can redistribute it and/or modify it
'  under the terms of the GNU General Public License as published by the
'  Free Software Foundation; either version 2 of the License, or (at your
'  option) any later version.
'
'
'  This file is distributed in the hope that it will be useful, but WITHOUT
'  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
'  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
'  more details.
'
'  You should have received a copy of the GNU General Public License
'  along with this program; if not, write to the Free Software Foundation,
'  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA,
'  or see <http://www.gnu.org/licenses/>.
'
'  ------------------------------------------------------------------------
'
'  @package   FusionInventory Agent
'  @file      .\contrib\windows\fusioninventory-agent-deployment.vbs
'  @author(s) Benjamin Accary <meldrone@orange.fr>
'             Christophe Pujol <chpujol@gmail.com>
'             Marc Caissial <marc.caissial@zenitique.fr>
'             Tomas Abad <tabadgp@gmail.com>
'  @copyright Copyright (c) 2010-2013 FusionInventory Team
'  @license   GNU GPL version 2 or (at your option) any later version
'             http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
'  @link      http://www.fusioninventory.org/
'  @link      http://forge.fusioninventory.org/projects/fusioninventory-agent
'  @since     2012
'
'  ------------------------------------------------------------------------
'

'
'
' Purpose:
'     FusionInventory Agent Unatended Deployment.
'
'

Option Explicit
Dim Force, Verbose
Dim Setup, SetupArchitecture, SetupLocation, SetupOptions, SetupVersion

'
'
' USER SETTINGS
'
'

' SetupLocation
'    Depending on your needs or your environment, you can use either a HTTP or
'    CIFS/SMB.
'
'    If you use HTTP, please, set to SetupLocation a URL:
'
'       SetupLocation = "http://host[:port]/[absolut_path]" or
'       SetupLocation = "https://host[:port]/[absolut_path]"
'
'    If you use CIFS, please, set to SetupLocation a UNC path name:
'
'       SetupLocation = "\\host\share\[path]"
'
'       You also must be sure that you have removed the "Open File Security Warning"
'       from programs accessed from that UNC.
'
SetupLocation = "http://freefr.dl.sourceforge.net/project/fiawi/2.3.x/2.3.0"

' SetupVersion
'    Setup version with the pattern <major>.<minor>.<release>[-<package>]
'
SetupVersion = "2.3.0-1"

' SetupArchitecture
'    The setup architecture can be 'x86', 'x64' or 'Auto'
'
'    If you set SetupArchitecture = "Auto" be sure that both installers are in
'    the same SetupLocation.
'
SetupArchitecture = "Auto"

' SetupOptions
'    Consult the installer documentation to know its list of options.
'
'    You should use simple quotes (') to set between quotation marks those values
'    that require it; double quotes (") doesn't work with UNCs.
'
SetupOptions = "/acceptlicense /runnow /server='http://glpi.yourcompany.com/glpi/plugins/fusioninventory/' /S"

' Setup
'    The installer file name. You should not have to modify this variable ever.
'
Setup = "fusioninventory-agent_windows-" & SetupArchitecture & "_" & SetupVersion & ".exe"

' Force
'    Force the installation even whether Setup is previously installed.
'
Force = "No"

' Verbose
'    Enable or disable the information messages.
'
'    It's advisable to use Verbose = "Yes" with 'cscript //nologo ...'.
'
Verbose = "No"

'
'
' DO NOT EDIT BELOW
'
'

Function AdvanceTime(nMinutes)
   Dim nMinimalMinutes, dtmTimeFuture
   ' As protection
   nMinimalMinutes = 5
   If nMinutes < nMinimalMinutes Then
      nMinutes = nMinimalMinutes
   End If
   ' Add nMinutes to the current time
   dtmTimeFuture = DateAdd ("n", nMinutes, Time)
   ' Format the result value
   '    The command AT accepts 'HH:MM' values only
   AdvanceTime = Hour(dtmTimeFuture) & ":" & Minute(dtmTimeFuture)
End Function

Function baseName (strng)
   Dim regEx, ret
   Set regEx = New RegExp
   regEx.Global = true
   regEx.IgnoreCase = True
   regEx.Pattern = ".*[/\\]([^/\\]+)$"
   baseName = regEx.Replace(strng,"$1")
End Function

Function GetSystemArchitecture()
   Dim strSystemArchitecture
   Err.Clear
   ' Get operative system architecture
   On Error Resume Next
   strSystemArchitecture = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%")
   If Err.Number = 0 Then
      ' Check the operative system architecture
      Select Case strSystemArchitecture
         Case "x86"
            ' The system architecture is 32-bit
            GetSystemArchitecture = "x86"
         Case "AMD64"
            ' The system architecture is 64-bit
            GetSystemArchitecture = "x64"
         Case Else
            ' The system architecture is not supported
            GetSystemArchitecture = "NotSupported"
      End Select
   Else
      ' It has been not possible to get the system architecture
      GetSystemArchitecture = "Unknown"
   End If
End Function

Function isHttp(strng)
   Dim regEx, matches
   Set regEx = New RegExp
   regEx.Global = true
   regEx.IgnoreCase = True
   regEx.Pattern = "^(http(s?)).*"
   If regEx.Execute(strng).count > 0 Then
      isHttp = True
   Else
      isHttp = False
   End If
   Exit Function
End Function

Function IsInstallationNeeded(strSetupVersion, strSetupArchitecture, strSystemArchitecture)
   Dim strCurrentSetupVersion
   ' Compare the current version, whether it exists, with strSetupVersion
   If strSystemArchitecture = "x86" Then
      ' The system architecture is 32-bit
      ' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
      '    This subkey is now deprecated
      On error resume next
      strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent\DisplayVersion")
      If Err.Number = 0 Then
      ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
         If strCurrentSetupVersion <> strSetupVersion Then
            ShowMessage("Installation needed: " & strCurrentSetupVersion & " -> " & strSetupVersion)
            IsInstallationNeeded = True
         End If
         Exit Function
      Else
         ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' doesn't exist
         Err.Clear
         ' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
         On error resume next
         strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
         If Err.Number = 0 Then
         ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
            If strCurrentSetupVersion <> strSetupVersion Then
               ShowMessage("Installation needed: " & strCurrentSetupVersion & " -> " & strSetupVersion)
               IsInstallationNeeded = True
            End If
            Exit Function
         Else
            ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
            Err.Clear
            ShowMessage("Installation needed: " & strSetupVersion)
            IsInstallationNeeded = True
         End If
      End If
   Else
      ' The system architecture is 64-bit
      ' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
      '    This subkey is now deprecated
      On error resume next
      strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent\DisplayVersion")
      If Err.Number = 0 Then
      ' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' exists
         If strCurrentSetupVersion <> strSetupVersion Then
            ShowMessage("Installation needed: " & strCurrentSetupVersion & " -> " & strSetupVersion)
            IsInstallationNeeded = True
         End If
         Exit Function
      Else
         ' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory Agent' doesn't exist
         Err.Clear
         ' Check if the subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
         On error resume next
         strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
         If Err.Number = 0 Then
         ' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
            If strCurrentSetupVersion <> strSetupVersion Then
               ShowMessage("Installation needed: " & strCurrentSetupVersion & " -> " & strSetupVersion)
               IsInstallationNeeded = True
            End If
            Exit Function
         Else
            ' The subkey 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
            Err.Clear
            ' Check if the subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
            On error resume next
            strCurrentSetupVersion = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent\DisplayVersion")
            If Err.Number = 0 Then
            ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' exists
               If strCurrentSetupVersion <> strSetupVersion Then
                  ShowMessage("Installation needed: " & strCurrentSetupVersion & " -> " & strSetupVersion)
                  IsInstallationNeeded = True
               End If
               Exit Function
            Else
               ' The subkey 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\FusionInventory-Agent' doesn't exist
               Err.Clear
               ShowMessage("Installation needed: " & strSetupVersion)
               IsInstallationNeeded = True
            End If
         End If
      End If
   End If
End Function

Function IsSelectedForce()
   If LCase(Force) <> "no" Then
      ShowMessage("Installation forced: " & SetupVersion)
      IsSelectedForce = True
   Else
      IsSelectedForce = False
   End If
End Function

' http://www.ericphelps.com/scripting/samples/wget/index.html
Function SaveWebBinary(strSetupLocation, strSetup)
   Const adTypeBinary = 1
   Const adSaveCreateOverWrite = 2
   Const ForWriting = 2
   Dim web, varByteArray, strData, strBuffer, lngCounter, ado, strUrl
   strUrl = strSetupLocation & "/" & strSetup
   'On Error Resume Next
   'Download the file with any available object
   Err.Clear
   Set web = Nothing
   Set web = CreateObject("WinHttp.WinHttpRequest.5.1")
   If web Is Nothing Then Set web = CreateObject("WinHttp.WinHttpRequest")
   If web Is Nothing Then Set web = CreateObject("MSXML2.ServerXMLHTTP")
   If web Is Nothing Then Set web = CreateObject("Microsoft.XMLHTTP")
   web.Open "GET", strURL, False
   web.Send
   If Err.Number <> 0 Then
      SaveWebBinary = False
      Set web = Nothing
      Exit Function
   End If
   If web.Status <> "200" Then
      SaveWebBinary = False
      Set web = Nothing
      Exit Function
   End If
   varByteArray = web.ResponseBody
   Set web = Nothing
   'Now save the file with any available method
   On Error Resume Next
   Set ado = Nothing
   Set ado = CreateObject("ADODB.Stream")
   If ado Is Nothing Then
      Set fs = CreateObject("Scripting.FileSystemObject")
      Set ts = fs.OpenTextFile(baseName(strUrl), ForWriting, True)
      strData = ""
      strBuffer = ""
      For lngCounter = 0 to UBound(varByteArray)
         ts.Write Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1)))
      Next
      ts.Close
   Else
      ado.Type = adTypeBinary
      ado.Open
      ado.Write varByteArray
      ado.SaveToFile CreateObject("WScript.Shell").ExpandEnvironmentStrings("%TEMP%") & "\" & strSetup, adSaveCreateOverWrite
      ado.Close
   End If
   SaveWebBinary = True
End Function

Function ShowMessage(strMessage)
   If LCase(Verbose) <> "no" Then
      WScript.Echo strMessage
   End If
End Function

'
'
' MAIN
'
'

Dim nMinutesToAdvance, strCmd, strSystemArchitecture, strTempDir, WshShell
Set WshShell = WScript.CreateObject("WScript.shell")

nMinutesToAdvance = 5

' Get system architecture
strSystemArchitecture = GetSystemArchitecture()
If (strSystemArchitecture <> "x86") And (strSystemArchitecture <> "x64") Then
   ShowMessage("The system architecture is unknown or not supported.")
   ShowMessage("Deployment aborted!")
   WScript.Quit 1
Else
   ShowMessage("System architecture detected: " & strSystemArchitecture)
End If

' Check and auto detect SetupArchitecture
Select Case LCase(SetupArchitecture)
   Case "x86"
      ' The setup architecture is 32-bit
      SetupArchitecture = "x86"
      Setup = Replace(Setup, "x86", SetupArchitecture, 1, 1, vbTextCompare)
      ShowMessage("Setup architecture: " & SetupArchitecture)
   Case "x64"
      ' The setup architecture is 64-bit
      SetupArchitecture = "x64"
      Setup = Replace(Setup, "x64", SetupArchitecture, 1, 1, vbTextCompare)
      ShowMessage("Setup architecture: " & SetupArchitecture)
   Case "auto"
      ' Auto detection of SetupArchitecture
      SetupArchitecture = strSystemArchitecture
      Setup = Replace(Setup, "Auto", SetupArchitecture, 1, 1, vbTextCompare)
      ShowMessage("Setup architecture detected: " & SetupArchitecture)
   Case Else
      ' The setup architecture is not supported
      ShowMessage("The setup architecture '" & SetupArchitecture & "' is not supported.")
      WScript.Quit 2
End Select

' Check the relation between strSystemArchitecture and SetupArchitecture
If (strSystemArchitecture = "x86") And (SetupArchitecture = "x64") Then
   ' It isn't possible to execute a 64-bit setup on a 32-bit operative system
   ShowMessage("It isn't possible to execute a 64-bit setup on a 32-bit operative system.")
   ShowMessage("Deployment aborted!")
   WScript.Quit 3
End If

If IsSelectedForce() Or _
   IsInstallationNeeded(SetupVersion, SetupArchitecture, strSystemArchitecture) Then
   If isHttp(SetupLocation) Then
      ShowMessage("Downloading: " & SetupLocation & "/" & Setup)
      If SaveWebBinary(SetupLocation, Setup) Then
         strCmd = WshShell.ExpandEnvironmentStrings("%ComSpec%")
         strTempDir = WshShell.ExpandEnvironmentStrings("%TEMP%")
         ShowMessage("Running: """ & strTempDir & "\" & Setup & """ " & SetupOptions)
         WshShell.Run """" & strTempDir & "\" & Setup & """ " & SetupOptions, 0, True
         ShowMessage("Scheduling: DEL /Q /F """ & strTempDir & "\" & Setup & """")
         WshShell.Run "AT.EXE " & AdvanceTime(nMinutesToAdvance) & " " & strCmd & " /C ""DEL /Q /F """"" & strTempDir & "\" & Setup & """""", 0, True
         ShowMessage("Deployment done!")
      Else
         ShowMessage("Error downloading '" & SetupLocation & "\" & Setup & "'!")
      End If
   Else
      ShowMessage("Running: """ & SetupLocation & "\" & Setup & """ " & SetupOptions)
      WshShell.Run "CMD.EXE /C """ & SetupLocation & "\" & Setup & """ " & SetupOptions, 0, True
      ShowMessage("Deployment done!")
   End If
Else
   ShowMessage("It isn't needed the installation of '" & Setup & "'.")
End If
Tomás Abad
  Reply
#30
I said Excelent. Smile You made a good job. Big Grin

Question: is the package log the silent install ?

For debugging silent install, we need a log file.
I think this script is near to be finalising

Good night

@+
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#31
Hi mips,

mips Wrote:Question: is the package log the silent install ?

Not at the moment, but it's planned. Wink

Thank you for your comments and good night too.
Tomás Abad
  Reply
#32
Impossible de Joindre l'agent en 2.3.0-1

dans la fiche de l'ordinateur en cliquant sur forcer l'inventaire
Merci

GLPI 0.90.5/ Plugins Fusion : 090+1.4 / Agent : 2.3.18 < Serveur Centos 64 Bits>
  Reply
#33
lee, peux-tu ouvrir un nouveau sujet sur le forum? Merci d'avance.
Please contact Fusioninventory Partners companies if you look for a FusionInventory on site expert.
http://www.fusioninventory.org/partners/
  Reply
#34
Pourquoi votre scénario ne passe pas dans le domaine sur les ordinateurs avec le système d'exploitation windows xp? À la main tout travaille
  Reply
#35
Suite a l'erreur signalé ci-dessus, le script demande a installer sous windows xp x86 la version x64 de l'agent.

C'est un bug. je fais le necessaire pour le signaler.
Je vais voir si je peux proposer un patch pour les x86 fonctionnel.

/****
* For Tabad
\****

Following the error noted above, the script application insaller under windows xp x86 x64 version of the agent.

This is a bug. I needed for the report.
I'll see if I can provide a patch for x86 functional.


Error is " Run setup x64 on OS x32"
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#36
n'ayant pas mes identifiants GIT sous la main, j'explique içi pour nos cher programmeur.

Code:
.
.
.
81 ' SetupArchitecture
82'    The setup architecture can be 'i386', 'x86' , 'x64' or for autodetection 'auto'.
83'
84'    If SetupVersion is 2.2.x (or previous) you must use 'i386' exclusively.
85'    If SetupVersion is 2.3.x (or later) you can use 'x86' or 'x64', but not 'i386'.
86'
87 SetupArchitecture = "auto"
.
.
.
97 Setup = "fusioninventory-agent_windows-" & strSetupArchitecture & "_" & SetupVersion & ".exe"
.
.
.
112 Dim strSetupArchitecture
.
.
.
197    If strSystemArchitecture = "x86" Then
198      ' The system architecture is 32-bit
199      SetupArchitecture = strSystemArchitecture
use the same system for x64
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#37
Hi mips,

I'm not sure but I think you should use the last version of the script.

--- Google Translation ---

Bonjour mips,

Pas sûr, mais je pense que vous devriez utiliser la dernière version du script.
Tomás Abad
  Reply
#38
Thanks
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#39
Before my last contribution, this script run perfectly withe the 2.3.12 agent.

that's so good :-)

See you later
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#40
Bonjour a tous,

Le script https://github.com/mips81/fusioninventor...oyment.vbs a été fixé.

L'URL de téléchargement est correct.

J'ai simplifier le changement de version. Il n'y a qu'une variable pour la version (SetupVersion).

Code:
'
'
' USER SETTINGS
'
'

' SetupVersion
'    Setup version with the pattern <major>.<minor>.<release>[-<package>]
'
SetupVersion = "2.3.16"

' SetupLocation
'    Depending on your needs or your environment, you can use either a HTTP or
'    CIFS/SMB.
'
'    If you use HTTP, please, set to SetupLocation a URL:
'
'       SetupLocation = "http://host[:port]/[absolut_path]" or
'       SetupLocation = "https://host[:port]/[absolut_path]"
'
'    If you use CIFS, please, set to SetupLocation a UNC path name:
'
'       SetupLocation = "\\host\share\[path]"
'
'       You also must be sure that you have removed the "Open File Security Warning"
'       from programs accessed from that UNC.
'
'SetupLocation = "http://freefr.dl.sourceforge.net/project/fiawi/2.3.x/2.3.0"
SetupLocation = "http://netcologne.dl.sourceforge.net/project/fiawi/2.3.x/" & SetupVersion

Todo:

— Mise à jour de la luste des mirroirs disponible
— Choix du mirroir le plus rapide

Pour votre information, cette version de script est en production et stable.

À bientôt…
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#41
Attention,

À la ligne 85 l'URL est a changer comme ci-dessous
Code:
SetupLocation = "http://freefr.dl.sourceforge.net/project/fiawi/2.3.x/" & SetupVersion

À bientôt
- EyesOfNetworks 3.0 (CentOS) & XenServer x64 6.1
- glpi 0.84.80
- fusioninventory-for-glpi- 0.84+3.2
- fusioninventory-agent_2.3.15
  Reply
#42
Bonjour,

Quel paramètre peut-on modifier dans le script pour installer le plugin en mode debugg 2 ?

Cordialement
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)