Beyond My Mind

April 27, 2006

CD Selector: A “run from cd” tool

Filed under: Research — mahbub @ 3:17 pm

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.

Requirements

  1. `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.
  2. 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.

Solution

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:

[COMMON]

PATH=dlls\a_dlls;%WINDIR%\system32;%WINDIR%

[Feature Tutor 2]

Tutor2\Tutor2.exe

[AppViewer]

AppViewer\AppViewer.exe

[NRep Output Generator]

OutGen\OUTGen.exe

[Shen’s GDT System]

SOME=ShenTestbed

CODE=%SOME%\code

DATA=%SOME%\data

DOF=%SOME%\global_model

QHULL=%SOME%\local_model

SAT=%SOME%\sat

XLS=%SOME%\demo-xls

SomeSys\System.exe

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:

[autorun]

open=CDSelector.exe

icon= CDSelector.exe,0

It can be downloaded here.

Powered by Qumana

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: