Jump to content

How to automate .reg entries in RIS installations


Recommended Posts

I have RIS on a 2k3 server. RIS works great for what I need except for one thing and its getting the best of me. I need to have RIS automatically copy the i386 files to the c:\ drive. That part I was able to figure out. What I need to do now is change the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath to c:\ instead of it pointing to the RIS server. So I made a .reg file and called it sourcepath.reg.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]

"SourcePath"="c:\\"

I put sourcepath.reg in the $oem$ folder and made a file called cmdlines.txt in the $oem$ folder. Here is the cmdlines.txt file.

[Commands]

"regedit /s sourcepath.reg"

What am I doing wrong? I've been working on this for two days. I found most of my RIS help just by reading these forums. The post I found on my current issue at hand is here

http://www.msfn.org/board/index.php?showtopic=57218&st=15

I have read many other posts and tried other suggestions. This method seems like the easiest and most logical solution. I do not need anything fancy. Can anyone tell me what I'm doing wrong?

Thanks Guys!

Link to comment
Share on other sites


i just exported that key and noticer that the sourcepath looks like this:

Windows Registry Editor Version 5.00

"SourcePath"="C:"

notice i have the \\ missing.

So i would suggest checking find the key, export and delete what you don't want from it.

It won't import and incorrect key

Link to comment
Share on other sites

Nope, it still does not work. I exported the file again and this is what I see. Note the double slashes. BTW, This image is of win2ksp4.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"SourcePath"="c:\\"

Thanks!

Link to comment
Share on other sites

Ok, it still is not working. I'm going to post all the files I use for this process and their paths:

\RemoteInstall\Setup\English\Images\win2ksp4\i386\templates\ristndrd.sif

[data]
floppyless = "1"
msdosinitiated = "1"
OriSrc = "\\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"
OriTyp = "4"
LocalSourceOnCD = 1

[SetupData]
OsLoadOptions = "/noguiboot /fastdetect"
SetupSourceDevice = "\Device\LanmanRedirector\%SERVERNAME%\RemInst\%INSTALLPATH%"

[Unattended]
OemPreinstall = Yes
NoWaitAfterTextMode = 0
FileSystem = LeaveAlone
ExtendOEMPartition = 0
ConfirmHardware = no
NtUpgrade = no
Win31Upgrade = no
TargetPath = \WINNT
OverwriteOemFilesOnUpgrade = no
OemSkipEula = yes
InstallFilesPath = "\\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"

[UserData]
FullName = "aaa"
OrgName = "aaa"
ComputerName = *
ProductID = "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"

[GuiUnattended]
OemSkipWelcome = 1
OemSkipRegional = 1
TimeZone = 35
AdminPassword = "*************"
AutoLogon=Yes
AutoLogonCount=1

[LicenseFilePrintData]
AutoMode = PerSeat

[Display]
ConfigureAtLogon = 0
BitsPerPel = 32
XResolution = 1024
YResolution = 768
VRefresh = 60
AutoConfirm = 1

[Networking]
ProcessPageSections=Yes

[GuiRunOnce]
Command1 = "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\install.bat"


[Identification]
JoinWorkgroup = workgroup

[NetProtocols]
MS_TCPIP=params.MS_TCPIP

[params.MS_TCPIP]
; transport: TC (TCP/IP Protocol)
InfID=MS_TCPIP
DHCP=Yes

[NetClients]
MS_MSClient=params.MS_MSClient

[params.MS_MSClient]
InfID=MS_MSClient

[NetServices]
MS_Server=params.MS_Server

[params.MS_Server]
; service: SRV (Server)
InfID=MS_Server
BroadcastsToLanman2Clients = No

[ServicesSection]

[RemoteInstall]
Repartition = Yes
UseWholeDisk = Yes

[OSChooser]
Description ="Microsoft Windows 2000 Professional SP4"
Help ="Automatically installs Microsoft Windows 2000 Professional without prompting the user for input."
LaunchFile = "%INSTALLPATH%\%MACHINETYPE%\templates\startrom.com"
ImageType =Flat
Version="5.0 (2195)"

\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\cmdlines.txt

[Commands]
"regedit /s sourcepath.reg"

\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\sourcepath.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"SourcePath"="c:\\"

Now, I know the sourcepath.reg file works because I merged it with the system I just ris'd and it changed the sourcepath to c:\. So the \\ seems to be correct. Anyone know what else I'm overlooking? I have a feeling it is sitting right under my nose, I'm just not seeing it.

Edited by infoteklink
Link to comment
Share on other sites

cmdlines is too early to make that registry change. You should try doing it from GuiRunOnce or RunOnceEx. It's not that you can't import reg entries during the cmdlines execution, I do it on every install, it's what you're changing. There are numerous registry entries that will not "stick" when made from cmdlines and I think this may be one of them.

Link to comment
Share on other sites

@RogueSpear: How do you import registry settings from your cmdlines.txt? I'm using it for my riprep image. Everytime I try to import settings into the registry it gives me an error that it can't access the registry. In my riprep-image I have the folder SYSPREP\i386\$oem$

In that directory I hace cmdlines.txt with under the [commands] section "regedit import.reg"

Also in that directory there is the import.reg file

I don't use the /s yet because I keep getting the access error of the registry.

Edited by Arbeider
Link to comment
Share on other sites

This is my cmdlines.txt:

[Commands]
"cscript cmdlines.vbs"

There's a line in the VBscript that imports:

ws.Run("REGEDIT /S cmdlines.reg"),0,True

I see you're using RIPrep however. I can't understand with thread after thread of the same problems why people still insist on using that. Anyway, I can't say for sure what works or not under RIPrep. The above may work, it may not.

Link to comment
Share on other sites

I'm still having a small problem. First I'll post all my processes then give a pic of what I still can not accomplish.

My .sif

[GuiRunOnce]
Command1 = "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\install.bat"

Install.bat to copy i386 files to local c drive and start the .reg process (.reg process is still the problem)

xcopy "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\$1\w2k-isg-addon\i386\*.*" "c:\i386\*.*" /s /y

call "\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\reg_add.bat"

reg_add.bat

start regedit /s
\\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\sourcepath.reg

sourcepath.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"SourcePath"="c:\\"

Everything seems to work good except I still have to click to accept the setting for the reg entry.

Here

reg1.jpg

and here

reg2.jpg

How can I automate that?

Edited by infoteklink
Link to comment
Share on other sites

try removing the word start from your reg_add.bat - for some reason this can be weird in action - i had similar issue other day and noticed it all worked with no start action. also is it all one long line as codebox may be breaking it ni display - just wanted to check

Link to comment
Share on other sites

HAH!! You guys are the doo doo! :thumbup I did have the lines seperate. I put them on the same line and now it works perfect. Here is my reg_add.bat file now.

regedit /s \\risserver\e$\RemoteInstall\Setup\English\Images\win2ksp4\i386\$oem$\sourcepath.reg

I initially left the "start" in to see if it mattered or not. It didn't matter if it was there or not, so I just took it out. No need to have more crap in the code than needs to be.

Thanks again RogueSpear and oioldman!!

Link to comment
Share on other sites

  • 4 weeks later...

I've also found that you have to change the sourcepath in two locations, always worth considering:

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup

SourcePath=

and

HKLM\Software\Microsoft\Windows NT\CurrentVersion

SourcePath=

For some reason I've found only changing one of these values doesn't work. Changing both always works, praps I've just run across a glitch unique to me.

Cheers and beers

Benno

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...