wir haben einen Fehler gefunden: Wenn man das Laufwerk P: belegt hat (welches man über C:\Program Files (x86)\opsi.org\opsi-client-agent\opsiclientd\opsiclientd.conf => drive = p: konfiguriert) er hält man vom winst einen Fehler: http://www.fotos-hochladen.net/view/ops ... 67xwbe.png
Warum wird nicht einfach vorher gerpüft, welche Laufwerksbuchstaben frei sind und nutzt den 1. besten?
Ich habe das setup_cmd.bat schon so umgeschrieben, dass es genau diese Funktionalität hat, da ich bei uns nicht davon ausgehen kann, das O: niemals belegt ist. Die User verbinden sich die Laufwerke nämlich so, wie sie gerade lustig sind.
Hier die geänderte setup_cmd.bat, wenn jemand Interesse hat:
Code: Alles auswählen
@echo on
echo %date% %time% >> c:\opsilog.log
echo service_setup.cmd gestartet >> c:\opsilog.log
if not exist O:\ set script_drive=o: & goto mapping
if not exist A:\ set script_drive=a: & goto mapping
if not exist B:\ set script_drive=b: & goto mapping
if not exist C:\ set script_drive=c: & goto mapping
if not exist D:\ set script_drive=d: & goto mapping
if not exist E:\ set script_drive=e: & goto mapping
if not exist F:\ set script_drive=f: & goto mapping
if not exist G:\ set script_drive=g: & goto mapping
if not exist H:\ set script_drive=h: & goto mapping
if not exist I:\ set script_drive=i: & goto mapping
if not exist J:\ set script_drive=j: & goto mapping
if not exist K:\ set script_drive=k: & goto mapping
if not exist L:\ set script_drive=l: & goto mapping
if not exist M:\ set script_drive=m: & goto mapping
if not exist N:\ set script_drive=n: & goto mapping
if not exist P:\ set script_drive=p: & goto mapping
if not exist Q:\ set script_drive=q: & goto mapping
if not exist R:\ set script_drive=r: & goto mapping
if not exist S:\ set script_drive=s: & goto mapping
if not exist T:\ set script_drive=t: & goto mapping
if not exist U:\ set script_drive=u: & goto mapping
if not exist V:\ set script_drive=v: & goto mapping
if not exist W:\ set script_drive=w: & goto mapping
if not exist X:\ set script_drive=x: & goto mapping
if not exist Y:\ set script_drive=y: & goto mapping
if not exist Z:\ set script_drive=z: & goto mapping
echo %date% %time% >> c:\opsilog.log
echo Netzlaufwerksbuchstabe ist %script_drive% >> c:\opsilog.log
:mapping
if not %~d0%==\\ (
set script_drive=%~d0%
goto :mapped
)
set unc=%~f0%
for /f "tokens=1,2,* delims=\" %%a in ("%unc%") do set server=%%a&set share=%%b&set script=%%c
echo %date% %time% >> c:\opsilog.log
echo Verbinde Netzlaufwerk >> c:\opsilog.log
net use %script_drive% \\%server%\%share% /persistent:no
%script_drive%
cd %script%\..
echo %date% %time% >> c:\opsilog.log
echo Netzlaufwerk verbunden, Ausgabe von Computername >> c:\opsilog.log
:mapped
if %1!==/u! goto prework
if %2!==/u! goto prework
echo .
echo Aktueller PC: %COMPUTERNAME%
echo You are at PC: %COMPUTERNAME%
echo .
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !! !!
echo !! Zum Starten der opsi-client-agent Installation !!
echo !! druecken Sie bitte eine beliebige Taste !!
echo !! Zum Abbrechen schliessen Sie einfach dieses Fenster !!
echo !! !!
echo !! To start the installation of the opsi-client-agent !!
echo !! just press any key !!
echo !! To cancel just close this window !!
echo !! !!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo .
REM pause
:prework
echo %date% %time% >> c:\opsilog.log
echo Prüfen, ob %programfiles(x86)%\opsi.org\opsi-client-agent\opsiclientd.exe existiert >> c:\opsilog.log
if exist "%programfiles(x86)%\opsi.org\opsi-client-agent\opsiclientd.exe" goto :exit2
if exist "%programfiles%\opsi.org\opsi-client-agent\opsiclientd.exe" goto :exit2
:startwork
echo %date% %time% >> c:\opsilog.log
echo Prüfen, ob C:\tmp exisitert >> c:\opsilog.log
if exist c:\tmp goto :startwinst
mkdir c:\tmp
:startwinst
echo %date% %time% >> c:\opsilog.log
echo Dateien kopieren und Winst starten >> c:\opsilog.log
if not exist files\opsi\opsi-winst\winst32.exe goto :winstmissing
xcopy /s/y/i files\opsi\*.* c:\tmp\opsi
regedit /s c:\tmp\opsi\UAC_off.reg
copy "%comspec%" "%systemroot%\cmd64.exe"
if %1!==/noreboot! goto noreboot
if %2!==/noreboot! goto noreboot
"c:\tmp\opsi\opsi-winst\winst32.exe" /batch c:\tmp\opsi\setup.ins c:\tmp\opsi-client-agent.log /PARAMETER INSTALL:CREATE_CLIENT:REBOOT
goto :endwinst
:noreboot
echo %date% %time% >> c:\opsilog.log
echo Es wird kein Automatischer Neustart durchgeführt >> c:\opsilog.log
"c:\tmp\opsi\opsi-winst\winst32.exe" /batch c:\tmp\opsi\setup.ins c:\tmp\opsi-client-agent.log /PARAMETER INSTALL:CREATE_CLIENT:NOREBOOT
:endwinst
echo %date% %time% >> c:\opsilog.log
echo Opsi Winst ist fertig >> c:\opsilog.log
echo .
echo Installation abgeschlossen
echo Installation completed
echo .
REM pause
goto :exit
:winstmissing
echo %date% %time% >> c:\opsilog.log
echo Winst wurde in files\opsi\opsi-winst\winst32.exe nicht gefunden. Laufwerksbuchstabe bereits belegt? >> c:\opsilog.log
echo .
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !! !!
echo !! opsi- Winst not found !!
echo !! (File "files\opsi\opsi-winst\winst32.exe" does not exist) !!
echo !! Installation aborted !!
echo !! !!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo .
REM pause
goto :exit
:exit
echo %date% %time% >> c:\opsilog.log
net use %script_drive% /delete /yes
echo Installation beendet >> c:\opsilog.log
REM pause
:exit2
echo %date% %time% >> c:\opsilog.log
net use %script_drive% /delete /yes
echo Opsi bereits installiert, keine weitere Installation durchgeführt >> c:\opsilog.log
REM pause