|
-
Jan 24th, 2005, 03:15 PM
#1
Thread Starter
Lively Member
Dynamically creating a form and control in a VBscript
I need to create a VBscript which has 1 form, and at least one control.
I want to prompt the use to change the drive letter.
So I need a form, and a Dir List Box.
However, I don't know how to add a form or control to a vbscript, since it seems to be limited to variant data types only.
I will initially do this in a VB6 program, so I can see what properties need to have default values set, then move it over to a VBScript. It's also much easier to develop and debug in VB6 than in VBScript.
Would someone who has actually done this in VBScript, please point me to an example of adding a form & control in a vbscript? Unfortunatley, It's not quite the same as working in regular VB.
thanks
-
Jan 24th, 2005, 04:24 PM
#2
Re: Dynamically creating a form and control in a VBscript
The only thing visual you have access to in VBScript is Server.CreateObject("SomeProject.SomeVisualComponent")
In what environment will this VBScript be executed? ie.. command-line, ASP page from IIS?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jan 24th, 2005, 04:39 PM
#3
Thread Starter
Lively Member
Re: Dynamically creating a form and control in a VBscript
 Originally Posted by Dave Sell
The only thing visual you have access to in VBScript is Server.CreateObject("SomeProject.SomeVisualComponent")
In what environment will this VBScript be executed? ie.. command-line, ASP page from IIS?
It will be executed from an Install Shield installer.
I've got one example that shows a Session object, but I would rather put up aVBform (not an HTML form), with a DirListbox (or similar) on it.
Unfortunately, I can only find articles about web-based vbscript examples.
im pth
dim drv
'The following statement displays the path from which setup is run
'MsgBox session.property("SETUPEXEDIR")
'Store this value in a variable
pth = session.property("SETUPEXEDIR")
'extract the first 2 characters of the path that stands for the drive
drv = Left(pth,2)
'Assign the drive to be the installation drive and also add subdirectories if you wish
session.property("INSTALLDIR") = drv + "\NameADir"
-
Jan 24th, 2005, 04:42 PM
#4
Re: Dynamically creating a form and control in a VBscript
Well, then, my idea won't work. I was going to suggest you to make your own ActiveX Control, and register it with the system, and then call Server.CreateObject() on your custom Object.
However this won't work in the context of an installer, as the machine in question doesn't have your stuff installed on it yet...
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jan 24th, 2005, 06:46 PM
#5
Thread Starter
Lively Member
Re: Dynamically creating a form and control in a VBscript
 Originally Posted by Dave Sell
Well, then, my idea won't work. I was going to suggest you to make your own ActiveX Control, and register it with the system, and then call Server.CreateObject() on your custom Object.
However this won't work in the context of an installer, as the machine in question doesn't have your stuff installed on it yet...
Actually, I believe it will. THe above suggestion came from the tech support at Install Shield. The vbscript only has to prove the user with a choice to select a drive letter, then send this back to the installer, so the installation drive will get changed. Once it's changed, the installer will copy the files to the new location.
The installer is equipped to execute EXE, DLL, or VBscripts at various point during installation. It's unfortunate, I can't access the Session object from a VB6 executable. I don't know where the object comes from, but it's accessible in VBscript
-
Jan 25th, 2005, 01:20 AM
#6
Re: Dynamically creating a form and control in a VBscript
Well, the reason I beleive my suggestion wont work is because such an object has to be registered with the system before you use it. I dont use install shield, so I dont know if you can register an object that is part of the install package, and use it at the same time you are trying to complete the rest of the installation.
If you do have that ability, then you could make your own visual object which can return a value to the installer.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jan 26th, 2005, 08:15 PM
#7
Hyperactive Member
Re: Dynamically creating a form and control in a VBscript
cappy2112,
If im understanding you correctly, couldnt you use BrowseForFolder???
Example
VB Code:
Set BFF=CreateObject("Uncommon.BrowseForFolder")
BFF.Title="Choose installation directory."
BFF.FLAGS=&H10
BFF.InitialFolder="c:\"
BFF.ShowModal(0)
MsgBox BFF.Path
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|