home *** CD-ROM | disk | FTP | other *** search
-
-
- Setting Up Packages for VendorProg
- ==================================
-
-
- VendorProg is designed to support the same package structure as vendor.exe.
- The server and the packages remain the same. The only difference is that
- the user will no longer use the vendor.exe client program because all the
- client code is contained in the object code for VendorProg, which is a
- subclass of the workplace shell WPProgram object.
-
- The class chain for VendorProg looks like:
-
- SOMObject
- └── WPObject
- └── WPAbstract
- └── WPProgram
- └── NetProg
- └── VendorProg
-
- The NetProg object is defined in NETPROG.DLL which is included with VendorProg.
- It must also be installed on the user's machine. If you have CORE,
- the coreadd for VendorProg will also add NetProg. The NetProg class provides
- new functionality to the VendorProg object to enable better Network
- capabilities. There are NetProg objects in the templates folder as well
- as VendorProg Objects. The NetProg objects can be used for network programs
- that do not require vendor licenses.
-
-
-
- NetProg and VendorProg Installation (non-NetDoor users)
- -------------------------------------------------------
-
- To install NetProg and VendorProg, place NETPROG.DLL, VENDPROG.DLL and
- VNDNET32.DLL in your libpath and NOTHING.EXE somewhere
- on your hard drive. Edit INSTALL.CMD to specify where NOTHING.EXE resides
- and where to install the Program object that points to it. NOTHING.EXE is
- a windows program that does nothing. It's purpose is to allow NetProg to
- change the working directory of WIN-OS/2 seamless to the local hard drive
- when it cannot free a network drive for a seamless program.
-
- Run INSTALL.CMD and the classes will be registered and NetProg and VendorProg
- templates will be created in your templates folder.
-
- NETPROGO.CMD is a sample that can be modified in order to create network
- program objects in an automated fashion.
-
- The PMBROWSE.EXE in this zip file is the one that supports titles.
- The one shipped with old versions of vendor might not have this feature.
- Place the executable in the path or dpath of the workstation.
-
- Creating Vendor Objects
- =======================
-
- There are two ways of creating a vendor program on a user's machine.
-
- 1. The user can open the templates folder and drag a Vendor Program object.
- When the settings open, select the catalog button and choose which package
- to assign to this object. If the package has already been installed on
- the user's system (as shown in the vendor.ini file), the default will be not
- to re-install the package. The "Run Install" checkbox on the package
- page of the object can be checked to force a re-install.
-
- 2. A Rexx .cmd file can be written to install a VendorProg using SysCreateObject
- The syntax would be:
-
- rc = SysCreateObject(ClassName, ObjectTitle, Location, Setup, Flag);
-
- where ClassName is 'VendorProg'
-
- ObjectTitle is whatever title you want to give the object
-
- Location is either a workplace object id like '<WP_DESKTOP>' or
- the fully qualified path of the location to place the
- object
-
- Setup is the setup string. At this point just use 'PACKAGE=packname'
- and let the packinst do the rest. You want the packinst to
- do all the setup because if the user uses the templates
- folder, when the packinst runs, it will setup the object.
-
- Flag is 'ReplaceIfExists', 'UpdateIfExists', or 'FailIfExists'
-
- NOTE: Even if the package for the new object has already been installed,
- the object will still call the packinst.cmd passing SETUPONLY to
- tell the packinst just to setup the object and not to do the actual
- file copying for the package. This way, the packinst.cmd can
- set any specific data on the object (like parameters or what executable
- to run etc.) without re-installing everything.
- But, if the user selects 'Run Install' on the package page, the
- packinst.cmd will be run without passing SETUPONLY and the package
- will fully re-install. More on this later.
-
-
-
- Migration considerations
- ========================
-
- Most of the migration work needs to be done on the packinst.cmd files.
- One important consideration is whether or not your vendor server will be
- supporting users that use either the VendorProg object OR the VENDOR.EXE
- program. In this case the packinst.cmd can be designed to handle
- both cases.
-
- The packinst.cmd will be passed one or two parameters from the VendorProg
- object. When a package re-install is not necessary but the object needs
- to be setup, the packinst will be passed two parameters: the OBJECT ID
- of the VendorProg object making the call (this object id is generated
- by the system and will overwrite any object ids you specify) and the
- string "SETUPONLY" to tell the packinst not to install the entire package.
-
- When a package needs to be re-installed, the VendorProg object will pass
- only the OBJECT ID as a parameter.
-
- NOTE: Due to a problem with sending parameters with the '<' or '>' chars
- to a program in the shell, the object id is passed without those
- characters. It is up to the packinst.cmd to ADD the brackets to
- the object id before passing it through to SysSetObjectData.
-
- If the packinst does not receive any parameters, the call is being made
- from the old vendor client.
-
- So the logic of a packinst.cmd should look like this: (this is pseudo code)
- ---------------------------------------------------------------------------
- parse arg ObjectId SetupOnly
-
- if SetupOnly is blank do
-
- Install the package on the users machine. (just like old packinst.cmd)
-
- endif
- else if ObjectId is not blank do
- tell user you are just updating the object so they don't get confused as
- to why the packinst is running when they said don't re-install.
-
-
- add '<' and '>' to the front and end of ObjectId
-
- call SysSetObjectData using the newly modified object id and any data
- that needs to be set on the object.
-
- endif
- ---------------------------------------------------------------------------
-
-
-
- Setting Data on the Object
- ==========================
-
-
- The Rexx API used to set data on an object is SysSetObjectData.
- The first parameter is the object id and the second parameter is the
- setup string that specifies which object settings to modify.
-
- The format of the setup string is:
-
- KEYWORD=<value>;KEYWORD=<value>;KEYWORD=<value>; etc.
-
- The key word specifies the setting to modify and the <Value> is the
- specific value you wish to assign that setting.
-
- The OS/2 2.0 Presentation Manager Programming Reference vol. II lists all
- the possible setup key words and values you can set for any object
- (under wpSetup) and all that can be set for a program object
- (which VendorProg is a descendent from) (under WPProgram).
-
- Again, do not use the OBJECTID= keyword because the VendorProg will assign
- itself its own object id and overwrite yours.
-
- Some useful keywords from WPProgram are:
-
- Key Word Value
- ------------------- -----------------------------------------------
-
- PARAMETERS whatever parameters the program requires to run.
-
- PROGTYPE FULLSCREEN os/2 fullscreen
- WINDOWABLEVIO os/2 window
-
- PM os/2 pm
-
- VDM dos fullscreen
- WINDOWEDVDM dos window
-
- SEPARATEWIN (3.0)win-os2 seamless separate sess.
- WIN (3.0)win-os2 fullscreen
- WINDOWEDWIN (3.0)win-os2 seamless common sess.
-
- PROG_31_STD (3.1)win-os2 fullscreen
- PROG_31_STDSEAMLESSCOMMON (3.1) win-os2 seamless
- PROG_31_STDSEAMLESSVDM (3.1) win-os2 seamless
- separate session
-
- PROG_31_ENH (3.1)win-os2 fullscreen enhanced
- PROG_31_ENHSEAMLESSCOMMON (3.1) win-os2 seamless
- enhanced
- PROG_31_ENHSEAMLESSVDM (3.1) win-os2 seamless
- separate session enhanced
-
- NOTE: DO NOT USE EXENAME= or STARTUPDIR= the .exe name is specified in
- the package or by RUNFILE= by the packinst and the STARTUPDIR is
- replaced by WORKINGDIR (more on that below...)
-
- VendorProg is also a descendent from NetProg (Network Program Object).
-
- The keywords supported by NetProg are:
-
- Key Word Value
- ------------- --------------------------------------------------------
- WDNETNAME Network name of working directory (leave out if
- working dir to be set is on local machine)
-
- WDLANDRIVE drive letter to assign WDNETNAME. default is '*' which
- means use any drive.
-
- WORKINGDIR path (not including drive letter or UNC for network paths)
- of working dir. If the working dir is on the local
- machine, include the drive letter.
-
- ENVREPLACE replace the following environment string. (see help
- on environment page of VendorProg) (must have a space
- before the actual string to replace)
-
- NOTE: env strings only work for OS/2 programs. (not DOS or WIN-OS/2)
-
- example: ENVREPLACE PATH=C:\MYPATH^;C:\ANOTHERPATH^;;
- NOTE: use the '^' for any ';' that is to be treated
- as a literal ';' to go into the path statement
- and not to separate the different setup keywords.
-
- ENVAPPEND same as replace but do an append of the environment string
-
- ENVPREPEND same as replace but do a prepend of the environment string
-
- NOTE:
- you must provide the proper separator in the BEGINNING of
- an environment string for ENVAPPEND for any env variable
- other than PATH and DPATH. Also provide a proper separator
- at the END for ENVPREPEND for env variables other
- than PATH and DPATH.
-
- Also, '?' gets replaced on execution with program network
- drive and '~' gets replaced on execution with working dir
- network drive
-
- e.g. ENVREPLACE PATH=?:\MYPATH;~:\ANOTHER
-
-
- RUNBEFORE fully qualified path of .cmd file to run before VendorProg
- executes
-
- RUNBEFORESTYLE INSTALL - run only once for this object and never again.
- ONCE - (default) run on only first instance of program
- opening
- MULTIPLE - (not supported for VendorProg) never more than
- one running.
-
- RUNAFTER fully qualified path of .cmd file to run after VendorProg
- executes
-
- NOTE: RUNBEFORE and RUNAFTER are useful to replace any
- file editing that needed to be done in the packrun.
-
- RUNBACKGROUND NO (default) run the RUNBEFORE and RUNAFTER .cmd files
- in the foreground
-
- YES run the RUNBEFORE and RUNAFTER .cmd files in the
- background.
-
- EXTRADRIVE specify extra drives to net use when the program
- executes.
- this is in the form of netname^D^n,netname^D^n;
-
- netname can be an alias or UNC path
- D is the drive letter desired ('*' for any) this is required.
- n is a number to assign this drive if you are using * and want
- to also use substitution in env strings. (you can only have
- 9 of these 1-9) the ^n is optional.
- ^ separates netname, drive letter, and number
- , separates each separate extra drive requested
-
- EXAMPLE: EXTRADRIVES=myalias^*^1,\\myserv\myshare^Q;ENVREPLACE PATH=?1\mypath;
-
- here I want myalias assigned to any drive given the drive number
- 1 so it can be replaced in my PATH statement for ENVREPLACE.
- note I used ?1\ the '?' tells netprog to substitute the drive
- and the '1' following directly after means use extra drive 1
- (if you don't put the number the program path drive will be used)
- NOTE: don't put a colon. I will replace the '?' with the drive letter
- and the '1' or whatever number with a ':'.
-
- RUNIFFAIL YES if any or all of extra drives fail to get accessed
- message goes up but program will still run.
-
- NO message goes up program does not run.
-
- NOTE: this is for extra drives ONLY!!!
-
-
- The keywords supported by VendorProg are:
-
- Key Word Value
- ------------- --------------------------------------------------------
- PACKAGE package name to use for this VendorProg object
-
- RUNFILE Executable to run if different from the run file
- specified in the package definition. This is for
- migration if there are people using the old vendor
- client for this package and still need to packrun.cmd
- to run for them but VendorProg will run the .exe
- directly.
- VendorProg will add <landrive>:\ to the front of
- the name.
-
- Also use this if the run file is on the local machine
- (in that case use drive letter)
-
- LANDRIVE If package is set to always use the same lan drive
- but the user can choose which one, the packinst has
- to option to query the user for the drive letter and
- then pass it through to the object. If LANDRIVE
- isn't used, the user can set the drive on the
- Package page of the settings notebook.
-
-
-
- Object Settings Notebook
- ========================
-
- The VendorProg class adds the Package page to the settings notebook of
- the object. This enables the user to change which package this object
- points to. The Vendor.ini file keeps record of any time a specific packinst
- was run, which lan drive they were assigned (if relevant)
- and whether or not the install program had been run yet. All other
- data is stored locally to the VendorProg object itself.
-
- The Package page is also where users can specify parameters for the
- vendor program.
-
- When the settings notebook is opened, VendorProg tries to get a
- license so the workplace shell can access the executable on the lan
- which enables the session page to work properly. This license
- will use any available drive and the settings notebook must be closed
- before running the VendorProg object.
-
- The Working Dir, Environment, and Command File pages are added by
- NetProg. These provide the settings described before for NetProg.
- WPProgram adds the Session and Association pages. The association page
- currently does not work due to a bug in OS/2 that will be fixed in
- version 2.2. The Window and General pages are added by WPObject.
-
-
- Do You Need a Packrun.cmd?
- ==========================
-
- In almost all cases you can configure a VendorProg from the packinst.cmd
- so it does not require a packrun.cmd. Here are some common uses of
- the packrun.cmd and how the function can be ported into the object itself:
-
- 1. Edit the autoexec.bat before and after execution of the program:
-
- Set the RUNBEFORE and RUNAFTER settings on the object to point
- to .cmd files to perform the action.
-
- OR on OS/2 2.1 'SET DOS_AUTOEXEC=DiffExec.bat' in setup string.
-
- 2. Pass special parameters.
-
- use PARAMETERS= in packinst.cmd when setting data on the object.
-
- 3. Change PATH or other environment strings (os/2 programs only).
-
- use ENVREPLACE, ENVAPPEND or ENVPREPEND setup strings in packinst.cmd
-
- 4. Net use other drives
-
- use EXTRADRIVES setup string in packinst.cmd
-
-
- If you can replace all functions of the packrun.cmd for a specific package
- with VendProg features and you do not need to support old client users,
- have the package definition point directly to the executable name.
-
- If you must support users on the old client, keep the package definition
- pointing to the packrun.cmd and have the packinst.cmd tell VendorProg
- to use the executable (RUNFILE= in setup string).
-
- WINSTART.EXE Used to run programs like project and Microsoft Word
- That can't run on OS/2 2.1 because they require
- a working directory different from where the executable
- exists.
-
- NOTE: The current icon for WINSTART.EXE isn't very nice. We are going to
- fix it soon. It is very easy to write the program, though. It
- looks like this: (you need a windows SDK)
-
-
- /*-------------------------------------------------------------------------*/
- /* WinStart - a "Windows Start-a-Program Program"
- /*
- /* Gunnar Seaburg 6/93
- /* IBM Corp.
- /*-------------------------------------------------------------------------*/
- #include <windows.h>
- /*-------------------------------------------------------------------------*/
- /* Main
- /*-------------------------------------------------------------------------*/
- int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
- LPSTR lpszCmdLine, int nCmdShow)
- {
- return WinExec (lpszCmdLine, SW_SHOW);
- }
-
-