Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Need help converting DOS batch-driven installer intoVBScripting-driven one

Reply
 
Old 03-09-2009   #1 (permalink)
DL


 
 

Need help converting DOS batch-driven installer intoVBScripting-driven one

Hi,

Where the Installer is Now
a) What the Installer does is to install various components including
sql express (has been granted permission to re-distribute from MS).
b) The way the installer works is like this:
in the very beginning, it reads all the license text files including
those from other companies at DOS screen, then, the Main controller
(main batch file) starts/controls the installation of various
component named com1.bat, com2.bat etc.

Perceived Current Deficiency of the Installer / Rationale for
converting the installer to a GUI -ish one
Younger generation (target market) may be "scared" by the dark/arcane
DOS screen.

Also, I'm totally new to VBscripting

QUESTIONS
' Note: everything below would be considered as part of VBScripting
code
' with lots of comments/questions etc.

' a guru on another NG created the sample VBscript for me based on
limited requirements that I posted there.
' I'd like it to evolve into what I need for the installer conversion

' following comments/questions are all mine to reflect my
understanding or intention etc.
==============================================================
' Section 1 -- define the installer to use VBscript
@echo off
wscript.exe c:\dl.vbs
' dl.vbs being my VB script for the installer conversion
(put your batch file commands here)
' my current Main controller batch file

'
' so, the dl.vbs should look like the following two sections?
'

' Section 2 -- initialization
Quote:

>If you're willing to play around, here is the reverse of the above:
iDelay = 60 'seconds
Set oWshShell = CreateObject("WScript.Shell")
iTime = Timer
Do
oWshShell.Popup "Please wait while the PC settles down!", _
iDelay, "Message from your PC", 0
if Timer - iTime >= iDelay then Exit Do
Loop
MsgBox "OK, you can use the PC now, Mum", 6, "Message from your PC"
' what would determine the initiazation time?

' Section 3 -- run the main code block
DQ = """"
sBatch = "c:\MyProgram\Batch File.bat"
' just for clarity, the above batch file should be my MAIN batch file
Set oWshShell = CreateObject("WScript.Shell")
oWshShell.run "cmd.exe /c " & DQ & sBatch & DQ
' the author later advised to consider change the above line to the
following
oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ

' Q1
' how to bring up a Window that reads multiple license text file that
a user
, then with a label like You Agree to this
Agreement [x] and You Do not Agree to this Agreement [x] , Next
button at bottom
' not MsgBox command

'Q2
' does the last line of code in the above Section 3 imply that the
Main batch controller can still
very much function the same such as calling another batch file and
pasing its execution result
back to the caller etc.?

'Q3
' currently the program supports both XP and Vista and since each's
internal/Windows Installer differs
a bit, I simply created two separate installers of XP_installer.bat
and Vista_installer.bat while each calls
all the same sub-routines (com1.bat, com2.bat etc.). But I'd like to
just use one Installer.bat and let
VB script to detect current OS and decide which Windows Installer to
use, how?

oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ

=====================================================

Recommendation of VBScripting Tutorial would be wonderful, net search
has not yielded satisfactory result.


Many thanks.

My System SpecsSystem Spec
Old 03-09-2009   #2 (permalink)
Monitor


 
 

Re: Need help converting DOS batch-driven installer into VBScripting-driven one


"DL" <tatata9999@xxxxxx> wrote in message
news:70936057-32bf-4653-bb91-21caba575820@xxxxxx
Quote:

> Hi,
>
> Where the Installer is Now
> a) What the Installer does is to install various components including
> sql express (has been granted permission to re-distribute from MS).
> b) The way the installer works is like this:
> in the very beginning, it reads all the license text files including
> those from other companies at DOS screen, then, the Main controller
> (main batch file) starts/controls the installation of various
> component named com1.bat, com2.bat etc.
>
> Perceived Current Deficiency of the Installer / Rationale for
> converting the installer to a GUI -ish one
> Younger generation (target market) may be "scared" by the dark/arcane
> DOS screen.
>
> Also, I'm totally new to VBscripting
>
> QUESTIONS
> ' Note: everything below would be considered as part of VBScripting
> code
> ' with lots of comments/questions etc.
>
> ' a guru on another NG created the sample VBscript for me based on
> limited requirements that I posted there.
> ' I'd like it to evolve into what I need for the installer conversion
>
> ' following comments/questions are all mine to reflect my
> understanding or intention etc.
> ==============================================================
> ' Section 1 -- define the installer to use VBscript
> @echo off
> wscript.exe c:\dl.vbs
> ' dl.vbs being my VB script for the installer conversion
> (put your batch file commands here)
> ' my current Main controller batch file
>
> '
> ' so, the dl.vbs should look like the following two sections?
> '
>
> ' Section 2 -- initialization
Quote:

> >If you're willing to play around, here is the reverse of the above:
> iDelay = 60 'seconds
> Set oWshShell = CreateObject("WScript.Shell")
> iTime = Timer
> Do
> oWshShell.Popup "Please wait while the PC settles down!", _
> iDelay, "Message from your PC", 0
> if Timer - iTime >= iDelay then Exit Do
> Loop
> MsgBox "OK, you can use the PC now, Mum", 6, "Message from your PC"
> ' what would determine the initiazation time?
>
> ' Section 3 -- run the main code block
> DQ = """"
> sBatch = "c:\MyProgram\Batch File.bat"
> ' just for clarity, the above batch file should be my MAIN batch file
> Set oWshShell = CreateObject("WScript.Shell")
> oWshShell.run "cmd.exe /c " & DQ & sBatch & DQ
> ' the author later advised to consider change the above line to the
> following
> oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ
>
> ' Q1
> ' how to bring up a Window that reads multiple license text file that
> a user
> , then with a label like You Agree to this
> Agreement [x] and You Do not Agree to this Agreement [x] , Next
> button at bottom
> ' not MsgBox command
>
> 'Q2
> ' does the last line of code in the above Section 3 imply that the
> Main batch controller can still
> very much function the same such as calling another batch file and
> pasing its execution result
> back to the caller etc.?
>
> 'Q3
> ' currently the program supports both XP and Vista and since each's
> internal/Windows Installer differs
> a bit, I simply created two separate installers of XP_installer.bat
> and Vista_installer.bat while each calls
> all the same sub-routines (com1.bat, com2.bat etc.). But I'd like to
> just use one Installer.bat and let
> VB script to detect current OS and decide which Windows Installer to
> use, how?
>
> oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ
>
> =====================================================
>
> Recommendation of VBScripting Tutorial would be wonderful, net search
> has not yielded satisfactory result.
>
>
> Many thanks.
It would take someone at least an hour to work through your post and give
you a meaningful answer. You might find it difficult to find a respondent
who is prepared to spend this amount of time for you. You will probably get
more help if you limit yourself to one or two concise questions or if you
spend the time to write the script yourself, then ask for assistance in case
you get stuck at a particular spot.

You appear to have posted a similar question in a batch-related newsgroup.
This is likely to lead to duplication of effort and is likely to discourage
potential respondents. It would be much better to use cross-posting so that
everybody can see everybody's replies.


My System SpecsSystem Spec
Old 03-09-2009   #3 (permalink)
DL


 
 

Re: Need help converting DOS batch-driven installer intoVBScripting-driven one

On Mar 9, 7:34*pm, "Monitor" <nos...@xxxxxx> wrote:
Quote:

> "DL" <tatata9...@xxxxxx> wrote in message
>
> news:70936057-32bf-4653-bb91-21caba575820@xxxxxx
>
>
>
>
>
Quote:

> > Hi,
>
Quote:

> > Where the Installer is Now
> > a) What the Installer does is to install various components including
> > sql express (has been granted permission to re-distribute from MS).
> > b) The way the installer works is like this:
> > in the very beginning, it reads all the license text files including
> > those from other companies at DOS screen, then, the Main controller
> > (main batch file) starts/controls the installation of various
> > component named com1.bat, com2.bat etc.
>
Quote:

> > Perceived Current Deficiency of the Installer / Rationale for
> > converting the installer to a GUI -ish one
> > Younger generation (target market) may be "scared" by the dark/arcane
> > DOS screen.
>
Quote:

> > Also, I'm totally new to VBscripting
>
Quote:

> > QUESTIONS
> > ' Note: everything below would be considered as part of VBScripting
> > code
> > ' with lots of comments/questions etc.
>
Quote:

> > ' a guru on another NG created the sample VBscript for me based on
> > limited requirements that I posted *there.
> > ' I'd like it to evolve into what I need for the installer conversion
>
Quote:

> > ' following comments/questions are all mine to reflect my
> > understanding or intention etc.
> > ==============================================================
> > ' Section 1 -- define the installer to use VBscript
> > @echo off
> > wscript.exe c:\dl.vbs
> > ' dl.vbs being my VB script for the installer conversion
> > (put your batch file commands here)
> > ' my current Main controller batch file
>
Quote:

> > '
> > ' so, the dl.vbs should look like the following two sections?
> > '
>
Quote:

> > ' Section 2 -- initialization
Quote:

> > >If you're willing to play around, here is the reverse of the above:
> > iDelay = 60 'seconds
> > Set oWshShell = CreateObject("WScript.Shell")
> > iTime = Timer
> > Do
> > *oWshShell.Popup "Please wait while the PC settles down!", _
> > *iDelay, "Message from your PC", 0
> > *if Timer - iTime >= iDelay then Exit Do
> > Loop
> > MsgBox "OK, you can use the PC now, Mum", 6, "Message from your PC"
> > ' what would determine the initiazation time?
>
Quote:

> > ' Section 3 -- run the main code block
> > DQ = """"
> > sBatch = "c:\MyProgram\Batch File.bat"
> > ' just for clarity, the above batch file should be my MAIN batch file
> > Set oWshShell = CreateObject("WScript.Shell")
> > oWshShell.run "cmd.exe /c " & DQ & sBatch & DQ
> > ' the author later advised to consider change the above line to the
> > following
> > oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ
>
Quote:

> > ' Q1
> > ' how to bring up a Window that reads multiple license text file that
> > a user
> > , then with a label like You Agree to this
> > Agreement [x] and *You Do not Agree to this Agreement [x] , Next
> > button at bottom
> > ' not MsgBox command
>
Quote:

> > 'Q2
> > ' does the last line of code in the above Section 3 imply that the
> > Main batch controller can still
> > very much function the same such as calling another batch file and
> > pasing its execution result
> > back to the caller etc.?
>
Quote:

> > 'Q3
> > ' currently the program supports both XP and Vista and since each's
> > internal/Windows Installer differs
> > a bit, I simply created two separate installers of XP_installer.bat
> > and Vista_installer.bat while each calls
> > all the same sub-routines (com1.bat, com2.bat etc.). *But I'd like to
> > just use one Installer.bat and let
> > VB script to detect current OS and decide which Windows Installer to
> > use, how?
>
Quote:

> > oWshShell.exec "cmd.exe /c " & DQ & sBatch & DQ
>
Quote:

> > =====================================================
>
Quote:

> > Recommendation of VBScripting Tutorial would be wonderful, net search
> > has not yielded satisfactory result.
>
Quote:

> > Many thanks.
>
> It would take someone at least an hour to work through your post and give
> you a meaningful answer. You might find it difficult to find a respondent
> who is prepared to spend this amount of time for you. You will probably get
> more help if you limit yourself to one or two concise questions or if you
> spend the time to write the script yourself, then ask for assistance in case
> you get stuck at a particular spot.
>
> You appear to have posted a similar question in a batch-related newsgroup..
> This is likely to lead to duplication of effort and is likely to discourage
> potential respondents. It would be much better to use cross-posting so that
> everybody can see everybody's replies.- Hide quoted text -
>
> - Show quoted text -
ok, I was trying to be thorough, will post a simpler, shorter one.
Not cross-posting though, this same exact post was posted to this NG
only and was done so by recommendation of another netter for most
appropriateness.

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Driven mad by folder permissions Vista General
DOS batch file -based installer going VS scripting - need moredirection VB Script
Domain Driven Design - Free London Event with Eric Evans .NET General
Free event - Effective Test-Driven Database Development .NET General
Converting FROM .wma and .wav TO .mp3 using WMC 11 Vista music pictures video


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46