Taylor Huckstep
asked on
Help Silently Installing Java Version 6 Update 29
I have a script I cannot get to work and I've tried all sorts of suggestions from websites and don't know what I'm doing wrong.
I need to silently install Java Version 6 update 29, but when I try /s or /v" or /qn nothing seems to work. The program never installs. I would preferably like this script to work on Windows 7 as well as XP.
THANKS!
CODE:
-------------------------- ---------- ------
@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls
:PreSetUp -V6.3 installation
:: check for environment pre-setup requirements on local machine
cls
:variables
:: setup stable environment variables
SET A_DIR=C:\Docume~1\AllUse~1 \Desktop
SET U_DIR=C:\Docume~1\%usernam e%\Desktop
SET J_DIR=C:\Docume~1\%usernam e%\Applic~ 1\Sun\Java \Deploymen t
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favori tes" goto Message1
:Message1
:: installation message
echo.
echo -------------------------- ---------- ---------- ----
echo ^| ^|
echo ^| This program is installing the ^|
echo ^| required components for using the ^|
echo ^| Kronos WFC Timekeeping systems ^|
echo ^| on your computer. ^|
echo ^| ^|
echo ^| Please wait while installation continues ^|
echo ^| ^|
echo -------------------------- ---------- ---------- ----
echo.
:JRE Install file copy
echo -------Starting Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kron os\JRE6029 \jre-6u29- windows-i5 86.exe" %windir%\Temp >nul 2>&1
copy /Y "\\servername\Install\Kron os\JRE6029 \JavaUpdat eOFF.reg" %windir%\Temp >nul 2>&1
"%windir%\Temp\jre-6u29-wi ndows-i586 .exe" /s
regedit /s %windir%\Temp\JavaUpdateOF F.reg
@Echo Off
echo deployment.javaws.autodown load=NEVER >>%J_DIR%\deployment.prope rties
goto end
:end
:: finishing script and cleanup
:: show message prompt telling user that update has finished
echo.
echo -------------------------- ---------- ---------- ----
echo ^| ^|
echo ^| Your Kronos Client update is finished now! ^|
echo ^| ^|
echo ^| Good Bye! ^|
echo ^| ^|
echo -------------------------- ---------- ---------- ----
echo.
echo.
:end2clear
:: clear temp variables
SET A_DIR=
SET U_DIR=
:: delete common temp files from computer
del %temp%\~*.* /f /q >nul 2>&1
del %temp%\*.tmp /f /q >nul 2>&1
del %tmp%\~*.* /f /q >nul 2>&1
del %tmp%\*.tmp /f /q >nul 2>&1
:: ALL PROCESSES ARE FINISHED NOW!
:: pause for user prompt to strike a key to acknowledge end
pause
:: force exit from script
color
exit
I need to silently install Java Version 6 update 29, but when I try /s or /v" or /qn nothing seems to work. The program never installs. I would preferably like this script to work on Windows 7 as well as XP.
THANKS!
CODE:
--------------------------
@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls
:PreSetUp -V6.3 installation
:: check for environment pre-setup requirements on local machine
cls
:variables
:: setup stable environment variables
SET A_DIR=C:\Docume~1\AllUse~1
SET U_DIR=C:\Docume~1\%usernam
SET J_DIR=C:\Docume~1\%usernam
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favori
:Message1
:: installation message
echo.
echo --------------------------
echo ^| ^|
echo ^| This program is installing the ^|
echo ^| required components for using the ^|
echo ^| Kronos WFC Timekeeping systems ^|
echo ^| on your computer. ^|
echo ^| ^|
echo ^| Please wait while installation continues ^|
echo ^| ^|
echo --------------------------
echo.
:JRE Install file copy
echo -------Starting Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kron
copy /Y "\\servername\Install\Kron
"%windir%\Temp\jre-6u29-wi
regedit /s %windir%\Temp\JavaUpdateOF
@Echo Off
echo deployment.javaws.autodown
goto end
:end
:: finishing script and cleanup
:: show message prompt telling user that update has finished
echo.
echo --------------------------
echo ^| ^|
echo ^| Your Kronos Client update is finished now! ^|
echo ^| ^|
echo ^| Good Bye! ^|
echo ^| ^|
echo --------------------------
echo.
echo.
:end2clear
:: clear temp variables
SET A_DIR=
SET U_DIR=
:: delete common temp files from computer
del %temp%\~*.* /f /q >nul 2>&1
del %temp%\*.tmp /f /q >nul 2>&1
del %tmp%\~*.* /f /q >nul 2>&1
del %tmp%\*.tmp /f /q >nul 2>&1
:: ALL PROCESSES ARE FINISHED NOW!
:: pause for user prompt to strike a key to acknowledge end
pause
:: force exit from script
color
exit
You're presumably attempting this only with Admin privileges?
ASKER
Yes, all users have local admin.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked! I don't know what you changed to make it work, I'm going to compare it to my script, but it installed successfully.
I did get it throwing a bunch of access denied errors at the end, maybe when it tried deleting the tmp files? Any ideas why?
C:\DOCUME~1\huckst\LOCALS~ 1\Temp\~DF B1E.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~ 1\Temp\~DF B23.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~ 1\Temp\~DF B8E3.tmp
Access is denied.
...etc...
Press any key to continue . . .
Regardless, thanks for the help! Today started off bad as my pet tarantula escaped her cage this morning and is loose in my house.
I did get it throwing a bunch of access denied errors at the end, maybe when it tried deleting the tmp files? Any ideas why?
C:\DOCUME~1\huckst\LOCALS~
Access is denied.
C:\DOCUME~1\huckst\LOCALS~
Access is denied.
C:\DOCUME~1\huckst\LOCALS~
Access is denied.
...etc...
Press any key to continue . . .
Regardless, thanks for the help! Today started off bad as my pet tarantula escaped her cage this morning and is loose in my house.
ASKER
I see you removed >nul 2>&1 which is no big deal at all. Thanks again for the help!
Those files might be locked still. They're just really warnings that can be ignored. That's why >nul was used.
Moral of the story: don't double-click a batch file to run it unless you're 100% certain it's going to work ;)
Moral of the story: don't double-click a batch file to run it unless you're 100% certain it's going to work ;)
ASKER
or run it on a test system you don't care about losing :)
I did look over the code to make sure you didn't add in a little sneaky surprise :)
I just removed the deletion of temp files, I don't know that that's necessary.
Weird that removing the nul parameters made it work, but thanks for your help!
I did look over the code to make sure you didn't add in a little sneaky surprise :)
I just removed the deletion of temp files, I don't know that that's necessary.
Weird that removing the nul parameters made it work, but thanks for your help!
I suspect that it was something other than the nul thing really.
ASKER
Contents of the script:
@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls
:PreSetUp -V6.3 installation
:: check for environment pre-setup requirements on local machine
cls
:variables
:: setup stable environment variables
SET A_DIR=C:\Docume~1\AllUse~1 \Desktop
SET U_DIR=C:\Docume~1\%usernam e%\Desktop
SET J_DIR=C:\Docume~1\%usernam e%\Applic~ 1\Sun\Java \Deploymen t
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favori tes" goto Message1
:Message1
:: installation message
echo.
echo -------------------------- ---------- ---------- ----
echo ^| ^|
echo ^| This program is installing the ^|
echo ^| required components for using the ^|
echo ^| Kronos WFC Timekeeping systems ^|
echo ^| on your computer. ^|
echo ^| ^|
echo ^| Please wait while installation continues ^|
echo ^| ^|
echo -------------------------- ---------- ---------- ----
echo.
:JRE Install file copy
echo -------Starting Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kron os\JRE6029 \jre-6u29- windows-i5 86.exe" %windir%\Temp
copy /Y "\\servername\Install\Kron os\JRE6029 \JavaUpdat eOFF.reg" %windir%\Temp
"%windir%\Temp\jre-6u29-wi ndows-i586 .exe" /s
regedit /s %windir%\Temp\JavaUpdateOF F.reg
@Echo Off
echo deployment.javaws.autodown load=NEVER >>%J_DIR%\deployment.prope rties
goto end
:end
:: finishing script and cleanup
:: show message prompt telling user that update has finished
echo.
echo -------------------------- ---------- ---------- ----
echo ^| ^|
echo ^| Your update is finished now! ^|
echo ^| ^|
echo ^| Good Bye! ^|
echo ^| ^|
echo -------------------------- ---------- ---------- ----
echo.
echo.
:end2clear
:: clear temp variables
SET A_DIR=
SET U_DIR=
:: delete common temp files from computer
del %temp%\~*.* /f /q
del %temp%\*.tmp /f /q
del %tmp%\~*.* /f /q
del %tmp%\*.tmp /f /q
:: ALL PROCESSES ARE FINISHED NOW!
:: pause for user prompt to strike a key to acknowledge end
pause
:: force exit from script
color
exit
@echo off
MODE CON: COLS=57 LINES=25
color 1f
cls
:PreSetUp -V6.3 installation
:: check for environment pre-setup requirements on local machine
cls
:variables
:: setup stable environment variables
SET A_DIR=C:\Docume~1\AllUse~1
SET U_DIR=C:\Docume~1\%usernam
SET J_DIR=C:\Docume~1\%usernam
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favori
:Message1
:: installation message
echo.
echo --------------------------
echo ^| ^|
echo ^| This program is installing the ^|
echo ^| required components for using the ^|
echo ^| Kronos WFC Timekeeping systems ^|
echo ^| on your computer. ^|
echo ^| ^|
echo ^| Please wait while installation continues ^|
echo ^| ^|
echo --------------------------
echo.
:JRE Install file copy
echo -------Starting Java 1.6.0_29 Install---------
copy /Y "\\servername\Install\Kron
copy /Y "\\servername\Install\Kron
"%windir%\Temp\jre-6u29-wi
regedit /s %windir%\Temp\JavaUpdateOF
@Echo Off
echo deployment.javaws.autodown
goto end
:end
:: finishing script and cleanup
:: show message prompt telling user that update has finished
echo.
echo --------------------------
echo ^| ^|
echo ^| Your update is finished now! ^|
echo ^| ^|
echo ^| Good Bye! ^|
echo ^| ^|
echo --------------------------
echo.
echo.
:end2clear
:: clear temp variables
SET A_DIR=
SET U_DIR=
:: delete common temp files from computer
del %temp%\~*.* /f /q
del %temp%\*.tmp /f /q
del %tmp%\~*.* /f /q
del %tmp%\*.tmp /f /q
:: ALL PROCESSES ARE FINISHED NOW!
:: pause for user prompt to strike a key to acknowledge end
pause
:: force exit from script
color
exit