Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Help Silently Installing Java Version 6 Update 29

Posted on 2012-08-15
9
Medium Priority
?
990 Views
Last Modified: 2012-08-23
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
0
Comment
Question by:Taylor Huckstep
  • 5
  • 4
9 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 38298550
You're presumably attempting this only with Admin privileges?
0
 

Author Comment

by:Taylor Huckstep
ID: 38298612
Yes, all users have local admin.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 38299586
Please rename with a .bat extension and run the attached batch file (made a little less silent) from the command line and let us know what happens.
less-silent.txt
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Taylor Huckstep
ID: 38325570
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.
0
 

Author Comment

by:Taylor Huckstep
ID: 38325605
I see you removed >nul 2>&1 which is no big deal at all.  Thanks again for the help!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38327329
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 ;)
0
 

Author Comment

by:Taylor Huckstep
ID: 38327404
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!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38327423
I suspect that it was something other than the nul thing really.
0
 

Author Closing Comment

by:Taylor Huckstep
ID: 38327424
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
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question