Link to home
Start Free TrialLog in
Avatar of Taylor Huckstep
Taylor HuckstepFlag for United States of America

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\%username%\Desktop
  SET J_DIR=C:\Docume~1\%username%\Applic~1\Sun\Java\Deployment
  SET D_FAV="C:\Documents and Settings\Default User\Favorites"
  SET U_FAV="C:\Documents and Settings\%username%\Favorites" 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\Kronos\JRE6029\jre-6u29-windows-i586.exe"  %windir%\Temp >nul 2>&1
copy /Y  "\\servername\Install\Kronos\JRE6029\JavaUpdateOFF.reg" %windir%\Temp >nul 2>&1

"%windir%\Temp\jre-6u29-windows-i586.exe" /s
regedit /s %windir%\Temp\JavaUpdateOFF.reg

@Echo Off

echo deployment.javaws.autodownload=NEVER  >>%J_DIR%\deployment.properties

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
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You're presumably attempting this only with Admin privileges?
Avatar of Taylor Huckstep

ASKER

Yes, all users have local admin.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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\~DFB1E.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~1\Temp\~DFB23.tmp
Access is denied.
C:\DOCUME~1\huckst\LOCALS~1\Temp\~DFB8E3.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 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 ;)
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 suspect that it was something other than the nul thing really.
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\%username%\Desktop
SET J_DIR=C:\Docume~1\%username%\Applic~1\Sun\Java\Deployment
SET D_FAV="C:\Documents and Settings\Default User\Favorites"
SET U_FAV="C:\Documents and Settings\%username%\Favorites" 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\Kronos\JRE6029\jre-6u29-windows-i586.exe"  %windir%\Temp
copy /Y  "\\servername\Install\Kronos\JRE6029\JavaUpdateOFF.reg" %windir%\Temp

"%windir%\Temp\jre-6u29-windows-i586.exe" /s
regedit /s %windir%\Temp\JavaUpdateOFF.reg

@Echo Off

echo deployment.javaws.autodownload=NEVER  >>%J_DIR%\deployment.properties

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