All wizards are launched with a single argument: the path to a temporary file in INI format containing name-value pairs. If a wizard is run without any arguments, because the user started it from the Windows File Manager or Windows Explorer, it should behave in a reasonable default manner. Typically, a page wizard should load a page into the FrontPage Editor, and a web wizard should load pages into the current web.
The format of the parameter file is as follows:
[Input]
arg1=value1
arg2=value2
[Environment]
var1=value1
var2=value2
[Output]
The Input section contains all required and optional wizard parameters. The Environment section contains a snapshot of the parent’s environment variables. The Output section is initially empty; this is where the wizard can write variables that get sent back to the calling process under certain circumstances.
All wizards receive the following built-in arguments when run:
Dir=absolute path to wizard directory
Inf=absolute path to wizard’s INF file
Blocking=0 or 1 (1 if caller is blocked)
Editing=0 or 1 (1 if wizard is being invoked as an editor)
A page wizard’s INF file should contain the key/value “editor=1” if it can be launched as an editor (like the Frames wizard in version 1.1); otherwise the Editing key will always be set to 0.
When a wizard is run with Blocking=0 (the typical non-blocking case), it should delete the parameter file mentioned on the command line before exiting, to avoid cluttering up the temporary directory. When a wizard is run with Blocking=1, the launching program is expecting to pick up some output parameters from the wizard; in this case, the launching program will take care of deleting the parameter file when the wizard exits. If a page wizard is launched with Blocking=1, it must not make any OLE automation calls to the FrontPage Editor or it will hang. Finally, if a wizard is run with Editing=1, it should delete the PageFile when it exists, since this is a temporary file created by the FrontPage Explorer.
A few additional parameters have special meaning to a page wizard:
Destination=editor | web | disk
PageURL=URL where page should be saved
PageTitle=title for new web page
PageFile=path to file being edited (only set if Editing=1)
Each page wizard has a notion of its default destination. This is usually the FrontPage Editor; but if a wizard generates content that cannot be edited by the FrontPage Editor, the wizard should load it to the current web instead.
If Destination=editor, the generated file should be loaded directly into the FrontPage Editor via OLE automation. If Destination=web, the generated file should be loaded directly to the current web via OLE automation. If Destination=disk, the wizard should generate its output into temp files and return a list of filename/URL pairs via the Output section (see below). However, if the custom wizard creates any non-HTML files, then it must upload them to the web by itself, rather than returning it locally on the hard drive (even when the INF file it receives has a destination of disk.)
PageURL is the web-relative path to the page being created (such as “index.htm”). PageTitle is the title of the page being created (such as “My Home Page”). PageFile is an absolute path to the file being edited, which has typically just been downloaded by the Explorer.
For backward compatibility, the following arguments are still passed to wizards by the FrontPage Explorer: WebName, ServerName, Proxy, User.
If Blocking=1, then page wizards should return some values via the parameter file’s Output section.
The ExitStatus key should be set to either “error,” “cancel,” or “OK.” If ExitStatus is not present, the launching program will assume that an error occurred in the wizard.
If Destination=disk, the wizard should write a FileCount key and a list of keys from File1 to FileN and Url1 to UrlN. The values of these keys should be set to the absolute paths and target URLs of each file generated by the wizard.
For example, a wizard that generated two files might create an Output section like this:
[Output]
ExitStatus=ok
FileCount=2
File1=c:\temp\wiz01.tmp
Url1=index.htm
File2=c:\temp\wiz02.tmp
Url2=test.htm
It is assumed that File1 will be the main HTML file created by a page wizard.
Here’s an example of a parameter file that a wizard might receive:
[Input]
PageURL=test.htm
PageTitle=Test Page
Dir=E:\Program Files\Microsoft FrontPage\pages\vtiform.wiz
Inf=E:\Program Files\Microsoft FrontPage\pages\vtiform.wiz\vtiform.inf
Blocking=0
Editing=0
[Environment]
COMPUTERNAME=ARBUS
ComSpec=E:\WINNT35\system32\cmd.exe
HOMEDRIVE=E:
HOMEPATH=\users\default
MSINPUT=E:\MSINPUT
OS=Windows_NT
Os2LibPath=E:\WINNT35\system32\os2\dll;
Path=E:\WINNT35\system32;E:\WINNT35
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 5 Model 2 Stepping 11, GenuineIntel
PROCESSOR_LEVEL=5
PROCESSOR_REVISION=020b
SystemRoot=E:\WINNT35
SystemDrive=E:
temp=E:\temp
tmp=E:\temp
USERDOMAIN=EMINENT
USERNAME=jdoe
windir=E:\WINNT35
[Output]