I'd like to convert my Scripted task in my K1000 to a Post Install task on my k2000
K1000 v 6.2.109330
K2000 v 3.7.116629
Ths is my copied script to install UVNC under "On Success". I have all of my files included under dependencies.
Set “HKLM64\SOFTWARE\ORL\WinVNC3\Default”.
Launch “SYS\cmd.exe” with params “/C if not exist ”C:\Program Files\UltraVNC“ mkdir ”C:\Program Files\UltraVNC“”.
Launch “SYS\cmd.exe” with params “/C copy /Y ”$(KACE_DEPENDENCY_DIR)\ultravnc.ini“ ”C:\Program Files\UltraVNC\ultravnc.ini“”.
Launch “SYS\cmd.exe” with params “/C copy /Y ”$(KACE_DEPENDENCY_DIR)\SCHook.dll“ ”C:\Program Files\UltraVNC\SCHook.dll“”.
Launch “SYS\cmd.exe” with params “/C copy /Y ”$(KACE_DEPENDENCY_DIR)\SCHook64.dll“ ”C:\Program Files\UltraVNC\SCHook64.dll“”.
Launch “SYS\cmd.exe” with params “/C copy /Y ”$(KACE_DEPENDENCY_DIR)\acl.txt“ ”C:\Program Files\UltraVNC\acl.txt“”.
Launch “$(KACE_DEPENDENCY_DIR)\UltraVNC_1.2.06_$(KACE_OS_ARCH)_Setup.exe” with params “/verysilent /loadinf=”$(KACE_DEPENDENCY_DIR)\vncserver.inf“ /norestart”.
Launch “C:\Program Files\UltraVNC\MSLogonACL.exe” with params “/i /o ”C:\Program Files\UltraVNC\acl.txt“”.
Unzip “$(KACE_DEPENDENCY_DIR)\drivers.zip” to “$(KACE_DEPENDENCY_DIR)”.
Launch “$(KACE_DEPENDENCY_DIR)\driverinstall.bat” with params “”.
Launch “SYS\cmd.exe” with params “/C copy /Y ”$(KACE_DEPENDENCY_DIR)\UltraVNC.ini“ ”C:\Program Files\UltraVNC\UltraVNC.ini“”.
Restart service “uvnc_service”.
Launch “$(KACE_DEPENDENCY_DIR)\del-ultravnc-menu.bat” with params “”.
Set “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System!SoftwareSASGeneration” to “1”.
Any help would be greatly appreciated.
0 Comments
[ + ] Show comments
Answers (3)
Answer Summary:
Please log in to answer
Posted by:
SMal.tmcc
8 years ago
Top Answer
this should work for OS versions vista on up (not for xp) both x86 and x64
you want to unzip your driver.zip into the folder you placed your install files in. it should be in a subdir under the main one named drivers. then you zip everything up to one zip file to attach the post application task.
you should have the dll's, exe's and other files you are copying and running in the root directory of the zip
there should be a subdirectory structure named drivers and under that all the os's
unv.zip
if this does not work you will need to break it into a separate post tasks for x86 and x64
the if exist then else calls may not work with the start /wait pre-command
x86 only
you want to unzip your driver.zip into the folder you placed your install files in. it should be in a subdir under the main one named drivers. then you zip everything up to one zip file to attach the post application task.
you should have the dll's, exe's and other files you are copying and running in the root directory of the zip
there should be a subdirectory structure named drivers and under that all the os's
unv.zip
files- schook.dll, schook64.dll, ultravnc.ini, ...etc
subdirectories
Drivers
vista64
vista
xp64
w2k
etc
reg add HKLM\SOFTWARE\ORL\WinVNC3 /ve
if not exist ”C:\Program Files\UltraVNC“ mkdir ”C:\Program Files\UltraVNC“
copy /Y "ultravnc.ini“ ”C:\Program Files\UltraVNC\ultravnc.ini“
copy /Y ”SCHook.dll“ ”C:\Program Files\UltraVNC\SCHook.dll“
copy /Y ”SCHook64.dll“ ”C:\Program Files\UltraVNC\SCHook64.dll“
start /wait copy /Y ”acl.txt“ ”C:\Program Files\UltraVNC\acl.txt“
start /wait if exist "c:\program files (x86)" UltraVNC_1.2.06_x64_Setup.exe /verysilent /loadinf=vncserver.inf /norestart else UltraVNC_1.2.06_x86_Setup.exe /verysilent /loadinf=vncserver.inf /norestart
start /wait “C:\Program Files\UltraVNC\MSLogonACL.exe” /i /o ”C:\Program Files\UltraVNC\acl.txt“
start /wait certutil.exe -addstore "TrustedPublisher" uvnc-bvba.cer
start /wait if exist "c:\program files (x86)" .\drivers\vista64\setupdrv install else .\drivers\vista\setupdrv install
start /wait net stop winvnc
start /wait copy /Y ”UltraVNC.ini“ ”C:\Program Files\UltraVNC\UltraVNC.ini“
start /wait net start winvnc
start /wait rmdir /q /s "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Ultravnc"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SoftwareSASGeneration /d 1 /f
if this does not work you will need to break it into a separate post tasks for x86 and x64
the if exist then else calls may not work with the start /wait pre-command
x86 only
reg add HKLM\SOFTWARE\ORL\WinVNC3 /vex64 only
if not exist ”C:\Program Files\UltraVNC“ mkdir ”C:\Program Files\UltraVNC“
copy /Y "ultravnc.ini“ ”C:\Program Files\UltraVNC\ultravnc.ini“
copy /Y ”SCHook.dll“ ”C:\Program Files\UltraVNC\SCHook.dll“
copy /Y ”SCHook64.dll“ ”C:\Program Files\UltraVNC\SCHook64.dll“
start /wait copy /Y ”acl.txt“ ”C:\Program Files\UltraVNC\acl.txt“
start /wait UltraVNC_1.2.06_x86_Setup.exe /verysilent /loadinf=vncserver.inf /norestart
start /wait “C:\Program Files\UltraVNC\MSLogonACL.exe” /i /o ”C:\Program Files\UltraVNC\acl.txt“
start /wait certutil.exe -addstore "TrustedPublisher" uvnc-bvba.cer
start /wait .\drivers\vista\setupdrv install
start /wait net stop winvnc
start /wait copy /Y ”UltraVNC.ini“ ”C:\Program Files\UltraVNC\UltraVNC.ini“
start /wait net start winvnc
start /wait rmdir /q /s "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Ultravnc"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SoftwareSASGeneration /d 1 /f
reg add HKLM\SOFTWARE\ORL\WinVNC3 /ve
if not exist ”C:\Program Files\UltraVNC“ mkdir ”C:\Program Files\UltraVNC“
copy /Y "ultravnc.ini“ ”C:\Program Files\UltraVNC\ultravnc.ini“
copy /Y ”SCHook.dll“ ”C:\Program Files\UltraVNC\SCHook.dll“
copy /Y ”SCHook64.dll“ ”C:\Program Files\UltraVNC\SCHook64.dll“
start /wait copy /Y ”acl.txt“ ”C:\Program Files\UltraVNC\acl.txt“
start /wait UltraVNC_1.2.06_x64_Setup.exe /verysilent /loadinf=vncserver.inf /norestart
start /wait “C:\Program Files\UltraVNC\MSLogonACL.exe” /i /o ”C:\Program Files\UltraVNC\acl.txt“
start /wait certutil.exe -addstore "TrustedPublisher" uvnc-bvba.cer
start /wait .\drivers\vista64\setupdrv install
start /wait net stop winvnc
start /wait copy /Y ”UltraVNC.ini“ ”C:\Program Files\UltraVNC\UltraVNC.ini“
start /wait net start winvnc
start /wait rmdir /q /s "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Ultravnc"
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SoftwareSASGeneration /d 1 /f
Comments:
-
Thanks a ton!! I will get to work on this and let you know what happens. - wessdf 8 years ago
-
the start /wait keeps them in sequence, the batch file will wait for the command after the switch to complete before moving on to the next command. - SMal.tmcc 8 years ago
-
if you run into problems you can put a "pause" command in between any or all the lines to for testing and troubleshooting - SMal.tmcc 8 years ago
Posted by:
SMal.tmcc
8 years ago
Create a post application:
you can zip your files you need up with a batch file that runs the commands you need that are listed above and use a call like this for the parameter:
you can zip your files you need up with a batch file that runs the commands you need that are listed above and use a call like this for the parameter:
cmd /c nameof.bat
or name the batch file nameofbat.cmd and call the parameter
nameofbat.cmd
Comments:
-
I have made a batch file and kace executes it, but i don't think i have the syntax of all the lines in the bat file are correct. These are as kace looks at them in the task sequence.
For ex: Set... Launch... Unzip... Restart service... I don't think these are correct. - wessdf 8 years ago
Posted by:
SMal.tmcc
8 years ago
you want to create two post tasks one for x86 and one for x64, much easier to use
you will want to unzip drivers.zip to the same directory containing the other files that you are using to do this (ultravnc.ini, SCHook.dll, SCHook64.dll, acl.txt, UltraVNC_1.2.06_x86_Setup.exe, UltraVNC_1.2.06_x64_Setup.exe, etc...) then zip all those up as one zip file.
I also need to see the contents of the driverinstall.bat and del-ultravnc-menu.bat
this is what a batch or cmd file will look like
you will want to unzip drivers.zip to the same directory containing the other files that you are using to do this (ultravnc.ini, SCHook.dll, SCHook64.dll, acl.txt, UltraVNC_1.2.06_x86_Setup.exe, UltraVNC_1.2.06_x64_Setup.exe, etc...) then zip all those up as one zip file.
I also need to see the contents of the driverinstall.bat and del-ultravnc-menu.bat
this is what a batch or cmd file will look like
reg add HKLM\SOFTWARE\ORL\WinVNC3 /ve
if not exist ”C:\Program Files\UltraVNC“ mkdir ”C:\Program Files\UltraVNC“
copy /Y "ultravnc.ini“ ”C:\Program Files\UltraVNC\ultravnc.ini“
copy /Y ”SCHook.dll“ ”C:\Program Files\UltraVNC\SCHook.dll“
copy /Y ”SCHook64.dll“ ”C:\Program Files\UltraVNC\SCHook64.dll“
copy /Y ”acl.txt“ ”C:\Program Files\UltraVNC\acl.txt“
UltraVNC_1.2.06_x64_Setup.exe /verysilent /loadinf=vncserver.inf /norestart
“C:\Program Files\UltraVNC\MSLogonACL.exe” /i /o ”C:\Program Files\UltraVNC\acl.txt“
contents of driverinstall.bat goes here
net stop winvnc
copy /Y ”UltraVNC.ini“ ”C:\Program Files\UltraVNC\UltraVNC.ini“
net start winvnc
contents of del-ultravnc-menu.bat goes here
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SoftwareSASGeneration /d 1 /f
Comments:
-
I did not create these, so I really not sure what they do, I just use them lol.
del-ultravnc-menu.bat:
CD %allusersprofile%\Startm~1\programs
rmdir /q /s UltraVNC
driverinstall.bat:
@echo off
ver | find "2003" > nul
if %ERRORLEVEL% == 0 goto ver_2003
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto ver_xp
ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto ver_2000
ver | find "NT" > nul
if %ERRORLEVEL% == 0 goto ver_nt
REM these should work for all languages ...
ver | findstr /i "5.0." > nul
IF %ERRORLEVEL% == 0 goto ver_2000
ver | findstr /i "5.1." > nul
IF %ERRORLEVEL% == 0 goto ver_xp
ver | findstr /i "6.0." > nul
IF %ERRORLEVEL% == 0 goto ver_vista
ver | findstr /i "6.1." > nul
IF %ERRORLEVEL% == 0 goto ver_7
ver | findstr /i "6.2." > nul
IF %ERRORLEVEL% == 0 goto ver_2008
if not exist %SystemRoot%\system32\systeminfo.exe goto skipsysteminfotest
REM this will only work on english systems
systeminfo | find "OS Name" > %TEMP%\osname.txt
FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i
echo %vers% | find " XP " > nul
if %ERRORLEVEL% == 0 goto ver_xp
echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto ver_7
echo %vers% | find "Windows Vista" > nul
if %ERRORLEVEL% == 0 goto ver_vista
echo %vers% | find "2008" > nul
if %ERRORLEVEL% == 0 goto ver_2008
:skipsysteminfotest
REM Fallthrough to most recent OS if we can't figure it out ...
:ver_2008
:ver_7
:ver_vista
certutil.exe -addstore "TrustedPublisher" uvnc-bvba.cer
if defined ProgramFiles(x86) (
cd driver\vista64
install.bat
) else (
cd driver\vista
install.bat
)
goto exit
:ver_2003
:ver_xp
if defined ProgramFiles(x86) (
cd driver\xp64
install.bat
) else (
cd driver\xp
install.bat
)
goto exit
:ver_2000
REM echo Windows 2000
cd driver\w2K
install.bat
goto exit
:ver_nt
REM echo Windows NT (not supported)
goto exit
:exit
exit - wessdf 8 years ago-
open the drivers.zip folder and go to both driver\vista64\install.bat and driver\vista\install.bat and list the contents of those for me - SMal.tmcc 8 years ago
-
vista\install.bat:
setupdrv install
vista64\install.bat
setupdrv install
There is an exe in them "setupdrv.exe" along with a folder called "driver" and a "license.txt" - wessdf 8 years ago