Self-extracting utility programs
Posted: Mon Dec 12, 2016 5:02 pm
I often like to write utility programs in Xbase++, even if they are small (such as PATHUTIL.EXE) or large (such as XDOT.EXE).
The problem is that to insure they will run requires that there is always a good path to the Xbase++ and eXpress++ runtime DLLs and, sometimes, CH files.
PATHUTIL.EXE is a very handy utility, written in eXpress++ and Xbase++ by Bobby Drakos.
It helps to debug problems in programs in which the programmer must find what files are being used by the program, based on the current environment. Unfortunately, if the system's environment is not set up correctly, even PATHUTIL.EXE may not run.
I solved this problem the following way:
1. I determined which eXpress++ and Xbase++ .DLLs are needed by running Alaska's DLLINFO.EXE utility. This displays a list of only the DLLs that are called by the program. DLLs which are called from the C:\Windows folder and subfolders are ignored.
2. I created a .ZIP file that contains the Executable program and only the DLLs that are needed by the program.
3. I used the Chilkat ZIP 2 Secure (free) utility to create a self-extracting executable from the .ZIP file. It can be downloaded here: https://www.chilkatsoft.com/chilkatsfx.asp
See the below screen shot to see how to configure the self-extracting EXE. This configuration will cause the created DCPATH.EXE to unzip itself into a newly created folder named C:\temp\pathutil, run the PATHUTIL.EXE program, and then delete all the files and the folder when the program is closed. The program will always run, regardless of the environment and will always clean up after itself afterwards and leave no trace of the files.
Here is DCPATH.EXE. Give it a try: http://bb.donnay-software.com/util/dcpath.exe
Here is DCDOT.EXE. http://bb.donnay-software.com/util/dcdot.exe
The problem is that to insure they will run requires that there is always a good path to the Xbase++ and eXpress++ runtime DLLs and, sometimes, CH files.
PATHUTIL.EXE is a very handy utility, written in eXpress++ and Xbase++ by Bobby Drakos.
It helps to debug problems in programs in which the programmer must find what files are being used by the program, based on the current environment. Unfortunately, if the system's environment is not set up correctly, even PATHUTIL.EXE may not run.
I solved this problem the following way:
1. I determined which eXpress++ and Xbase++ .DLLs are needed by running Alaska's DLLINFO.EXE utility. This displays a list of only the DLLs that are called by the program. DLLs which are called from the C:\Windows folder and subfolders are ignored.
2. I created a .ZIP file that contains the Executable program and only the DLLs that are needed by the program.
3. I used the Chilkat ZIP 2 Secure (free) utility to create a self-extracting executable from the .ZIP file. It can be downloaded here: https://www.chilkatsoft.com/chilkatsfx.asp
See the below screen shot to see how to configure the self-extracting EXE. This configuration will cause the created DCPATH.EXE to unzip itself into a newly created folder named C:\temp\pathutil, run the PATHUTIL.EXE program, and then delete all the files and the folder when the program is closed. The program will always run, regardless of the environment and will always clean up after itself afterwards and leave no trace of the files.
Here is DCPATH.EXE. Give it a try: http://bb.donnay-software.com/util/dcpath.exe
Here is DCDOT.EXE. http://bb.donnay-software.com/util/dcdot.exe