Jump to content

Integrating Applications into a RIS image.


Recommended Posts

Hmmm....

I dont understand it but anyway... reommend:

[GuiRunOnce]

Command0 = "Start /Wait cmd.exe /c c:\install\Install-Application-1.cmd"

Command1 = "Start /Wait cmd.exe /c c:\install\Install-Application-2.cmd"

Command2 = "Start /Wait cmd.exe /c c:\install\Install-Application-3.cmd"

And it still doesn't work?

:huh:

Then try adding one application and then the next one until done... to figure out if there is one specific install that messes up the flow..

Link to comment
Share on other sites


  • 2 weeks later...

Not sure how many people are interested in my RIS application install method, but figured i'd share it just in case.

Basically my RunOnceEx.bat contains all the switches required for all available applications to install across my entire network (350+ machines). When it executes because of my site naming convention (EG C2-01) it breaks up the name to determin the room and required room config.

From there it parses a pre set list for that room of what is needed and applies the appropriate keys to RunOnceEx. AutoLogon keys are added for a single logon then the machine is restarted. It logs on, installs all the appropriate applications restarts again ready for use.

Here's an example of the scripts, mine carries about 50 different apps but for explaining ive cut most of it out.

RunOnceEx.bat

cmdow @ /HID
@echo off

::SETS AUTOLOGON KEY
SET KEY=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

::ENABLES SINGLE ADMIN LOGON
REG ADD "%KEY%" /f /v DefaultDomainName /t REG_SZ /d DOMAIN
REG ADD "%KEY%" /f /v AltDefaultDomainName /t REG_SZ /d DOMAIN
REG ADD "%KEY%" /f /v DefaultUserName /t REG_SZ /d USERNAME
REG ADD "%KEY%" /f /v AltDefaultUserName /t REG_SZ /d USERNAME
REG ADD "%KEY%" /f /v DefaultPassword /t REG_SZ /d PASSWORD
REG ADD "%KEY%" /f /v AutoLogonCount /t REG_DWORD /d 1
REG ADD "%KEY%" /f /v AutoAdminLogon /t REG_SZ /d 1
REG ADD "%KEY%" /f /v DontDisplayLastUserName /t REG_DWORD /d 0

::SETS RUNONCEEX TITLE AND WORKING KEY
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %KEY% /V TITLE /D "Installing Applications" /f

::CREATES CLEANUP.CMD
set CLEANUPATH=%SystemDrive%\CleanUp.cmd
echo cmdow @ /HID>%CLEANUPATH%
echo @echo off>>%CLEANUPATH%

::MOUNTS APPLICATION WORKING DIRECTORY
REG ADD %KEY%\001 /VE /D "Mounting Applications Folder" /f
REG ADD %KEY%\001 /V 1 /D "NET USE Y: \\RISServer\Applications$" /f

::APPLYS APPROPRIATE KEYS FOR SITE/CURRENT ROOM/MACHINE
for /f "tokens=1* delims=-" %%a in ("%COMPUTERNAME%") DO SET ROOMNAME=%%a
if exist RoomConfig\ALLROOMS.txt for /f "tokens=* delims= " %%a in (RoomConfig\AllRooms.txt) DO if not '%%a'=='' call :%%a
if exist RoomConfig\%ROOMNAME%.txt for /f "tokens=* delims= " %%a in (RoomConfig\%ROOMNAME%.txt) DO if not '%%a'=='' call :%%a
if exist RoomConfig\%COMPUTERNAME%.txt for /f "tokens=* delims= " %%a in (RoomConfig\%COMPUTERNAME%.txt) DO if not '%%a'=='' call :%%a

::UNMOUNTS APPLICATION WORKING DIRECTORY
REG ADD %KEY%\998 /VE /D "Removing Applications Folder" /f
REG ADD %KEY%\998 /V 1 /D "NET USE Y: /DELETE" /f

::FINALIZES CLEANUP.CMD AND ADDS IT TO RUNONCEEX
echo SHUTDOWN /R /M \\%COMPUTERNAME% /T 02 /f>>%CLEANUPATH%
echo DEL /F /Q %CLEANUPATH%>>%CLEANUPATH%
REG ADD %KEY%\999 /VE /D "Cleaning up and Restarting" /f
REG ADD %KEY%\999 /V 1 /D "%CLEANUPATH%" /f

::EXITS RUNONCEEX SCRIPT
EXIT

:APP1
REG ADD %KEY%\010 /VE /D "Application 1" /f
REG ADD %KEY%\010 /V 1 /D "App1 Install Path" /f
goto :eof

:APP2
REG ADD %KEY%\020 /VE /D "Application 2" /f
REG ADD %KEY%\020 /V 1 /D "App2 Install Path" /f
goto :eof

:APP3
REG ADD %KEY%\030 /VE /D "Application 3" /f
REG ADD %KEY%\030 /V 1 /D "App3 Install Path" /f
goto :eof

:APP4
REG ADD %KEY%\040 /VE /D "Application 4" /f
REG ADD %KEY%\040 /V 1 /D "App4 Install Path" /f
goto :eof

RoomConfig\ALLROOMS.txt

APP1
APP2

RoomConfig\C2.txt

APP3

RoomConfig\C2-03.txt

APP4

So in the above example my entire site recieves APP1 & APP2 - Room C2 recives APP3 - and only machine 3 in room C2 recieves APP4.

Its far more versatile than that, if you want to add clean up lines to the cleanup script depending on what applications you install a line such as echo DEL C:\*.tmp>>%CLEANUPATH% under :APP4 would delete all .tmp files only when you specify APP4 to be installed.

Hopefully someone finds it useful, i hated all the alternatives requiring me to replicate install code for each different config. now all i need to do when i get new machines is name the machines right and create a new txt file in roomconfig and RIS + This script looks after the rest.

New applications i simple add the silent install switch once to RunOnceEx.cmd, reference in the appropriate room txt files and when the machines are next rebuilt that app is included.

hopefully someone finds it useful, and if you need more explanation ill be more than happy to help out.

regards theunknown

Link to comment
Share on other sites

  • 5 weeks later...

slight update for those interested, i ran into the need to exclude apps from certain rooms, this is the fix to allow it.

change

::APPLYS APPROPRIATE KEYS FOR SITE/CURRENT ROOM/MACHINE
for /f "tokens=1* delims=-" %%a in ("%COMPUTERNAME%") DO SET ROOMNAME=%%a
if exist RoomConfig\ALLROOMS.txt for /f "tokens=* delims= " %%a in (RoomConfig\AllRooms.txt) DO if not '%%a'=='' call :%%a
if exist RoomConfig\%ROOMNAME%.txt for /f "tokens=* delims= " %%a in (RoomConfig\%ROOMNAME%.txt) DO if not '%%a'=='' call :%%a
if exist RoomConfig\%COMPUTERNAME%.txt for /f "tokens=* delims= " %%a in (RoomConfig\%COMPUTERNAME%.txt) DO if not '%%a'=='' call :%%a

to

::APPLYS APPROPRIATE KEYS FOR SITE/CURRENT ROOM/MACHINE
for /f "tokens=1* delims=-" %%a in ("%COMPUTERNAME%") DO SET ROOMNAME=%%a
if not exist Exclude md Exclude
if exist RoomConfig\ALLROOMS.txt for /f "tokens=1* delims= " %%a in (RoomConfig\AllRooms.txt) DO if not '%%a'=='' if '%%b'=='NO' (echo.>Exclude\%%a.txt) else echo %%a>>temp.txt
if exist RoomConfig\%ROOMNAME%.txt for /f "tokens=1* delims= " %%a in (RoomConfig\%ROOMNAME%.txt) DO if not '%%a'=='' if '%%b'=='NO' (echo.>Exclude\%%a.txt) else echo %%a>>temp.txt
if exist RoomConfig\%COMPUTERNAME%.txt for /f "tokens=1* delims= " %%a in (RoomConfig\%COMPUTERNAME%.txt) DO if not '%%a'=='' if '%%b'=='NO' (echo.>Exclude\%%a.txt) else echo %%a>>temp.txt
if exist temp.txt for /f "tokens=* delims= " %%a in (temp.txt) DO if not exist Exclude\%%a.txt call:%%a
if exist temp.txt del /F /Q temp.txt
if exist Exclude RD /S /Q Exclude

this way you can do

RoomConfig\C2-04.txt

APP2 NO

and computer C2-04 wont get APP2, this can be done for site/rooms/individual computers.

regards, theunknown

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...