VBS Datei als Installation

Post Reply
nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

VBS Datei als Installation

Post by nashia » 16. Feb 2011, 14:30

Ich möchte gerne Software mit Hilfe eine VBS Datei Installieren, da hier mehrere Sachen und Programme geprüft und aufgerufen werden.

Wenn ich im Unattendet Paket das ganze so einfüge:

Code: Select all

[SET:Installation]
AddMeter -1
Call "%SRC%\install.vbs"
If %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf
Bekomme ich den Fehler von MS Based Script Host das er die angegebende Datei nicht finden kann. Fehlercode 80070002

Habe ich eventuell beim einbinden was falsch gemacht? So kann ich die VBS Datei ausführen ...

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 8100
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: VBS Datei als Installation

Post by Hendrik_Ambrosius » 16. Feb 2011, 16:31

Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 17. Feb 2011, 08:30

Wunderbar, Dankeschön :)

Habe extra nach "vbs" gesucht hier wird aber kein Suchergebnis angezeigt ... komisch

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 17. Feb 2011, 08:57

Er meint zwar er hätte was Installiert, aber es passiert nicht mehr als kurzes aufpoppen der Kommandozeile und das war's auch schon.
Selbst mit "call" statt "callhidden"

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 8100
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: VBS Datei als Installation

Post by Hendrik_Ambrosius » 17. Feb 2011, 09:09

Dann posten Sie doch mal die aktuelle setup.inf.
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 17. Feb 2011, 14:39

Code: Select all

[SetupInfo]
Author                  =adm_be
CreationDate            =16.02.2011 13:32:29
InventoryID             =
Description             =
Method                  =
Tested on               =
Dependencies            =
Command line options    =/S2
Last Change             =
Build                   =

[VarDefInfo]
; <Variable>, <Type: 0=Computer 1=User>, <Allow NULL values: 0=No 1=Yes>

[Setup]
Version=10.5
ShowCaption=1
BlockInput=0
Platform=x86

[Requirements]

[Application]
ProductName=LEXolution Kanzlei
DeveloperName=STP AG
Version=4.4.96
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName% %Version%",         Arial,           30, , 00FFFF, 4,    , LEFT BOLD ITALIC
Text2="%DeveloperName%",                 Arial,           24, , 00FFFF, 4,    , LEFT BOLD ITALIC
Text8="%Company%",                       Arial,           18, , 00FFFF, 4,  10, RIGHT BOLD ITALIC
Text9="%InstallationFor% %WindowsUser%", Arial,           16, , 007F00, 4, -18, BOTTOM ITALIC LEFT
BackgroundColor=FF0000,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER
UserKeyName=%DeveloperName%\%ProductName%
MachineKeyName=%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
ReinstallMode=1
SrcDir=..
ApplicationDir=%ProgramFilesDir%\%ProductName%
SetupInfDir=Install
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=1
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=1
Reboot=0
PreventExternalReboot=1
StartServicesOnReboot=0
CallTimeOut=3600
AbortAfterCallTimeOut=1
DisableCancelButton=1
ShowEndMessage=1
EndMessage=%EndMessageDesc%


[Strings:07]
Disk1=Installationsmedium 1
EndMessageDesc=Die Installation wurde erfolgreich abgeschlossen!
ErrorLogMessage=Die Installation/Deinstallation wurde mit einer Fehlermeldung abgebrochen!
InstallationFor=Installation für:
InstallerDesc=Dienstprogramm zum Installieren einzelner Komponenten.
InstallerName=Installationsprogramm
SetupWizard=Installations-Assistent
Uninstallation=deinstallieren
ErrorText=Fehler
CallingText=beim Aufruf von

[Strings:09]
Disk1=Installation media 1
EndMessageDesc=Installation was completed successfully!
ErrorLogMessage=The installation/uninstallation aborted with an error message!
InstallationFor=Installation for:
InstallerDesc=Service program to install single components.
InstallerName=Setup program
SetupWizard=Installation Wizard
Uninstallation=Uninstallation
ErrorText=Error
CallingText=launching

[SysStrings:07]
Users=Benutzer

[SysStrings:09]
Users=Users

[Environment]
CommonSetupDir=%CommonFilesDir%\Setup%SetupBits%
V_MachineValuesPath=\\%EmpirumServer%\Values$\MachineValues\%DomainName%
V_UserValuesPath=%HKLM,"Software\matrix42\Software Depot","HomeServer"%\Values$\UserValues\%UserDomain%

; Maschinenabhängige Variablen
; machine dependent variables
;VM_<Variable>=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,<Variable>%%

; Userabhängige Variablen
; user dependent variables
;VU_<Variable>=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,<Variable>%%

; !!! Setzen der entsprechenden ReplaceEnv Befehle für die Variablen im Abschnitt [Product] nicht vergessen!!!
; !!! Don't forget to set the appropriate ReplaceEnv instructions for the variables in the section [Product]!!!

[Encryption]

[Disks]
1=%Disk1%

[Options]
Installer = %InstallerName%, COPYALWAYS, Installer, "%InstallerDesc%"
Product   = %ProductName%,   COPYALWAYS, Product,   "%ProductDesc%"

[OptionDependencies]

[OptionGroups]

[Installer]
1:..\..\..\..\User\Setup.exe,          %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupDeu.chm,       %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupEnu.chm,       %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\Mx42SynSem.dll,     %System%,         OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS32, 0
1:..\..\..\..\User\x64\Mx42SynSem.dll, %System%,         OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS64, 0
1:%SetupInfDir%\Setup.inf,                             , NORMAL,                                             0
1:%Temp%\Setup64.exe,                  %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64,      0

[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf

[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf

[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf

[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort


[Product]
;#FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT
;ReplaceEnv <Variable>

#Set:Product
#Set:Installation, DONTDELETE
#Set:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:Product]

[SET:Installation]
AddMeter -1
call cscript.exe "%SRC%\install.vbs"
If %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf

[SET:Deinstallation]
If "%Src%\install.vbs" <> "" Then "SET:Deinstallation2" EndIf

[SET:Deinstallation2]
If %ErrorLevel% <> "0" Then "SET:DeInstallationError" EndIf
-callhidden cscript.exe "%Src%\install.vbs" 
-AddMeter -1

[Reg:OnUninstallProduct]

[Reg:Product]

[Ini:Product]

[Security:Product]

[Shell:Product]

[SET:InstallationError]
ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% install.vbs
Abort

[SET:DeInstallationError]
-Abort
-ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% install.vbs

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 8100
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: VBS Datei als Installation

Post by Hendrik_Ambrosius » 17. Feb 2011, 15:27

Und die VBS Datei liegt im Ordner "packages\STP AG\LEXolution Kanzlei\4.4.96" ?
Dann liegt es vermutlich an der VBS Datei selbst.
Können Sie die noch mal posten?
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 17. Feb 2011, 16:39

Die VBS an sich funktioniert:

Code: Select all

REM Dieses Skript dient dazu mehrere Programme in Folge aufzurufen ohne ein hässliches
REM Shell-Fenster angezeigt zu bekommmen, wie bei einem Batch-Skript.
Set WshShell = WScript.CreateObject( "WScript.Shell" )

REM Hinweisweldung wegen der Office-Addins anzeigen
REM Auskommentiert, da die Meldung unter Windows 7 immer im Hintergrund kommt.
REM MsgBox "Stellen Sie bitte sicher, dass alle Office-Anwendungen vor dem Aktualisieren geschlossen sind.", 48, "LEXolution Kanzlei"

REM .Net 2.0-Framework installieren
const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727"
strValueName = "Install"
Result = oReg.GetDWORDValue( HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue )
If Result<>0 Or dwValue<>1 Then
	Result = WshShell.Run("dotnetfx.exe /q:a /c:""install /q""",0,True)
End If
If Result>0 And Result<>3010 Then WScript.Quit(Result) End If

REM Visual Studio Tools für Office und die Office PIAs installieren
const HKEY_CLASSES_ROOT = &H80000000
strKeyPath = "CLSID\{000209FF-0000-0000-C000-000000000046}\ProgID"
strValueName = ""
Result = oReg.GetStringValue( HKEY_CLASSES_ROOT, strKeyPath, strValueName, sValue )
If Result=0 Then
	If sValue="Word.Application.11" Then
		WshShell.Run "msiexec /qn /lvx* install_pia.log /i o2003pia.msi",0,True
	Else 
		If sValue="Word.Application.12" Then
			WshShell.Run "msiexec /qn /lvx* install_pia.log /i o2007pia.msi",0,True
		End If
	End If
End If
strKeyPath = "Software\Microsoft\vsto runtime Setup\v2.0.50727"
strValueName = "Update"
Result = oReg.GetDWORDValue( HKEY_CLASSES_ROOT, strKeyPath, strValueName, dwValue )
If Result<>0 Or dwValue<3 Then
	WshShell.Run "vstor.exe /q:a /c:""install /q /l""",0,True
	WshShell.Run "vstolp20.exe /q:a /c:""install /q /l""",0,True
End If

REM Alte Installation der Links entfernen
Result = WshShell.Run("STP.SetupTool_static.exe RemovePrograms ""LEXolution Office Link"" ""LEXolution winsolvenz.p3 Link 3.1"" ""LEXolution Outlook Link""",0,True)
If Result>0 Then WScript.Quit(Result) End If

REM LEXolution installieren
Result = WshShell.Run("msiexec /qn /lvx* install.log /i STP.Ecm.Client.Setup.msi STPUPDATE=true",0,True)
WScript.Quit(Result)

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 8100
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: VBS Datei als Installation

Post by Hendrik_Ambrosius » 17. Feb 2011, 18:17

Aber das Script greift auf Dateien ohne Pfadangabe zu, z.V. o2003pia.msi.
Wie soll denn das Script diese Datei finden?
Da muss vorher in das richtige Verzeichnis gewechselt werden oder es muss mit absoluten Pfaden gearbeitet werden!
Bin mir nicht sicher was das working dir nach einem cscript-Aufruf ist, aber wahrscheinlich %windows% oder so...
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 18. Feb 2011, 08:06

Die Dateien liegen im gleichen Ordner. Er sollte damit also keine Probleme haben, wenn ich das Script alleine Auführe funktioniert es ja auch.

Walter_Schulz
Posts: 876
Joined: 17. Dec 2004, 12:29
Contact:

Re: VBS Datei als Installation

Post by Walter_Schulz » 18. Feb 2011, 08:29

"Sollte" hilft nicht viel, wenn die Fehlermeldung aus dem VB-Script generiert wird und "Fehler 2" heisst, dass eine Datei nicht gefunden wird.

Ciao!
Walter Schulz

nashia
Posts: 50
Joined: 07. Jul 2008, 13:35
Contact:

Re: VBS Datei als Installation

Post by nashia » 18. Feb 2011, 10:59

Die Installation allein durch das Aufrufen des Scriptes funktioniert. Sobald ich die VBS Datei in Empirum einbinden nicht mehr. Kurzes aufpoppen des Fensters und das wars. Angeblich ist die Installation dann erfolgreich abgeschlossen.

Walter_Schulz
Posts: 876
Joined: 17. Dec 2004, 12:29
Contact:

Re: VBS Datei als Installation

Post by Walter_Schulz » 18. Feb 2011, 11:07

Verstehe ich das richtig?
- Die Pfade wurden im VB-Script eingetragen
- Die Abarbeitung innerhalb der Setup.inf erzeugt keine 2er-Fehlermeldung mehr, die Programme terminieren ohne Fehlermeldung und die Installationen aus dem VB-Skript heraus sind nicht erfolgt.

Falls dem so ist, wuerde ich mal das VBS debuggen und ein paar Echos einstreuen, die mir die Variablen und Pfade zur Laufzeit anzeigen.


Ciao!
Walter Schulz

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: No registered users and 14 guests