Variable in OSC File

B

Brendon Rogers

Windows 2000 Server and Pro SP4

I have customized my RIS CIW / OSC files to provide me with a simple menu
choice which requires the tech to select the licence type on the computer,
we want to collect this information for auditing purposes.

Excerpt from LICENSE.OSC:

<FORM ACTION="WARNING">
License type: <SELECT NAME="LICENSETYPE" MAXLENGTH=40><BR>
<OPTION VALUE="None">None
<OPTION VALUE="WindowsXP">Windows XP
<OPTION VALUE="WindowsXP2K">Windows XP & 2000
<OPTION VALUE="Windows2KNT">Windows 2000 & NT4
<OPTION VALUE="WindowsNT">Windows NT4
<OPTION VALUE="Windows9895">Windows 98SE & 95
</SELECT>

I have the menu system working just fine, now my issue is how to pass the
choice to the OS so I can store it somewhere and refer to it later on.
Technet mentions you can use any variable you like in the OSC files, in this
case its %LICENSETYPE%.

How do I store the data in this variable in the registry or a text file? I
have managed to implement a workaround in the .SIF file:

[GuiRunOnce]
%LICENSETYPE%

This stores the info in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce.

I then run a VBScript which is called by CMDLINES.TXT which should read this
key, reseave it in a more appropriate location then delete it (since its
obviously not a valid RunOnce command). However, it appears the VBScript
runs after the RunOnce entry is populated. I have tested the VBScript on a
completed machine and it works then so the script is not at fault.

Any suggestions or other ideas?

Brendon
 
N

NIC Student

That's a cool idea, Brendon. I wish I knew how to do it, but you might ask
the gurus over in microsoft.public.scripting.vbscript. Torgeir Bakken has
helped me many times with vbs ideas.
 
B

Brendon Rogers

I have worked out how to do it, will post more info here later on if anyone
is interested.

Brendon

NIC Student said:
That's a cool idea, Brendon. I wish I knew how to do it, but you might ask
the gurus over in microsoft.public.scripting.vbscript. Torgeir Bakken has
helped me many times with vbs ideas.

--
Scott Baldridge
Windows Server MVP, MCSE
Windows 2000 Server and Pro SP4

I have customized my RIS CIW / OSC files to provide me with a simple menu
choice which requires the tech to select the licence type on the computer,
we want to collect this information for auditing purposes.

Excerpt from LICENSE.OSC:

<FORM ACTION="WARNING">
License type: <SELECT NAME="LICENSETYPE" MAXLENGTH=40><BR>
<OPTION VALUE="None">None
<OPTION VALUE="WindowsXP">Windows XP
<OPTION VALUE="WindowsXP2K">Windows XP & 2000
<OPTION VALUE="Windows2KNT">Windows 2000 & NT4
<OPTION VALUE="WindowsNT">Windows NT4
<OPTION VALUE="Windows9895">Windows 98SE & 95
</SELECT>

I have the menu system working just fine, now my issue is how to pass the
choice to the OS so I can store it somewhere and refer to it later on.
Technet mentions you can use any variable you like in the OSC files, in this
case its %LICENSETYPE%.

How do I store the data in this variable in the registry or a text file? I
have managed to implement a workaround in the .SIF file:

[GuiRunOnce]
%LICENSETYPE%

This stores the info in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce.

I then run a VBScript which is called by CMDLINES.TXT which should read this
key, reseave it in a more appropriate location then delete it (since its
obviously not a valid RunOnce command). However, it appears the VBScript
runs after the RunOnce entry is populated. I have tested the VBScript on a
completed machine and it works then so the script is not at fault.

Any suggestions or other ideas?

Brendon
 
N

NIC Student

Please post your findings, thanks.

--
Scott Baldridge
Windows Server MVP, MCSE

I have worked out how to do it, will post more info here later on if anyone
is interested.

Brendon
That's a cool idea, Brendon. I wish I knew how to do it, but you might ask
the gurus over in microsoft.public.scripting.vbscript. Torgeir Bakken has
helped me many times with vbs ideas.

--
Scott Baldridge
Windows Server MVP, MCSE
in
this
file?
I
have managed to implement a workaround in the .SIF file:

[GuiRunOnce]
%LICENSETYPE%

This stores the info in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce.

I then run a VBScript which is called by CMDLINES.TXT which should
read
this
key, reseave it in a more appropriate location then delete it (since its
obviously not a valid RunOnce command). However, it appears the VBScript
runs after the RunOnce entry is populated. I have tested the VBScript
on
 
C

Chris Nelson

I needed to accomplish the same thing. Basically, from
the GUIRunOnce section, I called a batch file and passed
the %Variable% in the command line of the batch file:

[GuiRunOnce]
Command0 = "c:\winnt\temp\license.cmd %Licensetype%"

My "license.cmd" file simply did this:

echo %1 > c:\winnt\temp\license.txt

Then, later in the remainder of the setup, I have a script
update the value of the license to a field in a database.
The same script also provides the network username of the
user and the name of the computer to the database as well.

I hope this helps.

Regards,
Chris Nelson
-----Original Message-----
That's a cool idea, Brendon. I wish I knew how to do it, but you might ask
the gurus over in microsoft.public.scripting.vbscript. Torgeir Bakken has
helped me many times with vbs ideas.

--
Scott Baldridge
Windows Server MVP, MCSE
Windows 2000 Server and Pro SP4

I have customized my RIS CIW / OSC files to provide me with a simple menu
choice which requires the tech to select the licence type on the computer,
we want to collect this information for auditing purposes.

Excerpt from LICENSE.OSC:

<FORM ACTION="WARNING">
License type: <SELECT NAME="LICENSETYPE"
MAXLENGTH=40> said:
<OPTION VALUE="None">None
<OPTION VALUE="WindowsXP">Windows XP
<OPTION VALUE="WindowsXP2K">Windows XP & 2000
<OPTION VALUE="Windows2KNT">Windows 2000 & NT4
<OPTION VALUE="WindowsNT">Windows NT4
<OPTION VALUE="Windows9895">Windows 98SE & 95
</SELECT>

I have the menu system working just fine, now my issue is how to pass the
choice to the OS so I can store it somewhere and refer to it later on.
Technet mentions you can use any variable you like in
the OSC files, in
this
case its %LICENSETYPE%.

How do I store the data in this variable in the registry or a text file? I
have managed to implement a workaround in the .SIF file:

[GuiRunOnce]
%LICENSETYPE%

This stores the info in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\RunOnce.
I then run a VBScript which is called by CMDLINES.TXT
which should read
this
key, reseave it in a more appropriate location then delete it (since its
obviously not a valid RunOnce command). However, it appears the VBScript
runs after the RunOnce entry is populated. I have tested the VBScript on a
completed machine and it works then so the script is not at fault.

Any suggestions or other ideas?

Brendon


.
 
B

Brendon Rogers

Hi Chris

Thats basically what I came up with too - GuiRunOnce is the only field you
can put variables into which you can then manipulate later. Only difference
with my implementation was using VBScript.

Thanks for the info

Brendon

Chris Nelson said:
I needed to accomplish the same thing. Basically, from
the GUIRunOnce section, I called a batch file and passed
the %Variable% in the command line of the batch file:

[GuiRunOnce]
Command0 = "c:\winnt\temp\license.cmd %Licensetype%"

My "license.cmd" file simply did this:

echo %1 > c:\winnt\temp\license.txt

Then, later in the remainder of the setup, I have a script
update the value of the license to a field in a database.
The same script also provides the network username of the
user and the name of the computer to the database as well.

I hope this helps.

Regards,
Chris Nelson
-----Original Message-----
That's a cool idea, Brendon. I wish I knew how to do it, but you might ask
the gurus over in microsoft.public.scripting.vbscript. Torgeir Bakken has
helped me many times with vbs ideas.

--
Scott Baldridge
Windows Server MVP, MCSE
Windows 2000 Server and Pro SP4

I have customized my RIS CIW / OSC files to provide me with a simple menu
choice which requires the tech to select the licence type on the computer,
we want to collect this information for auditing purposes.

Excerpt from LICENSE.OSC:

<FORM ACTION="WARNING">
License type: <SELECT NAME="LICENSETYPE"
MAXLENGTH=40> said:
<OPTION VALUE="None">None
<OPTION VALUE="WindowsXP">Windows XP
<OPTION VALUE="WindowsXP2K">Windows XP & 2000
<OPTION VALUE="Windows2KNT">Windows 2000 & NT4
<OPTION VALUE="WindowsNT">Windows NT4
<OPTION VALUE="Windows9895">Windows 98SE & 95
</SELECT>

I have the menu system working just fine, now my issue is how to pass the
choice to the OS so I can store it somewhere and refer to it later on.
Technet mentions you can use any variable you like in
the OSC files, in
this
case its %LICENSETYPE%.

How do I store the data in this variable in the registry or a text file? I
have managed to implement a workaround in the .SIF file:

[GuiRunOnce]
%LICENSETYPE%

This stores the info in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersio
n\RunOnce.
I then run a VBScript which is called by CMDLINES.TXT
which should read
this
key, reseave it in a more appropriate location then delete it (since its
obviously not a valid RunOnce command). However, it appears the VBScript
runs after the RunOnce entry is populated. I have tested the VBScript on a
completed machine and it works then so the script is not at fault.

Any suggestions or other ideas?

Brendon


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top