In my research lab we develop programs that uses `A’ geometric kernel. As the projects are inherited from previous students, most of them are built around `A’ 7, an old version with several architechtural problems. In many cases we wanted to run these programs off the CD or any removable device as we are not allowed to install `A’ in the other computers. So I created this program so that, any kind of program can run from the CD, with the dlls located in the CD. I am pasting the user manual below.
This document describes how to create applications that rely on external dlls such as `A’. In this regard it’s should be mentioned that the approach is good for any kind of dll based application.
- `A’ dll requires to be put into the system path. This can be achieved by copying all the relevant dlls (for debug version use files from NT_DLLD and for release version use NT_DLL files) into windows system directory or into the program directory. Copying in this manner is not good. `A’ usually uses PATH environmental variables to achieve this. But this requires administrative privileges and may not be always doable due to license restrictions. One can copy the dlls into a folder and create a BATCH file updating the path variable to include the `A’ dll directory, then calling the program. Thus the program will “see” the `A’ directory in its path and will not complain.
- System files may not match from the development system to other system. Specially program compiled with DEBUG switch turned on will contain debug symbol and will look for debug version of all dlls thus screwing up in other computers that don’t have the dlls with correct debug symbols.
After trying different options this seemed most suitable. An application has been developed in Visual C++ that itself is compiled as static program, so it does not depend on dlls. It reads a file named “CDSelector.inf” of the following format:
[Feature Tutor 2]
[NRep Output Generator]
[Shen’s GDT System]
The common portion is applied to all programs. The common portion sets some environment variables applicable for all applications.
The other portions starting with an enclosed name within left [ and right ] is a separate program. Each program can define as many variables as it wants to followed by a line containing the path to the program. So the CDSelector will read the “CDSelector.inf” and list down the programs as shown below:
Double click the program name or select the name and click Run to run the program. You can place comment by using “;” or “rem” in front of a line.
To solve the problem associated with system variables, trying to run the program using this CDSelector and see what error message you get. If you get a crash try to see the file name that caused the problem by clicking “Details” button note down the file name. Copy the file from the development machine, usually from windows system directory and place it inside the folder containing the application. This will hopefully solve the problem. Try running the program in different versions of Windows and different computers.
To run from a CD you can place a “Autorun.inf” inside the root of the CD containing:
It can be downloaded here.
Powered by Qumana