Can someone elaborate on this? I'm doing a similar thing (create an installation setup).
I've got all the information I need from the registry (cui location, program install path location), but I don't know how point my solution to allow looking in the local AutoCAD install folder for the AcCui.dll (and the others).
I'm using C# and I am not sure how to implement the SetDllDirectoryA function from VB.
I emailed Wayne Brill about this since it (modifying a cui outside of AutoCAD) wasn't covered in the presentation. Here's the response (an excerpt from a previous case).
It is not legal to ship the AutoCAD specific DLL’s with your application. But you may copy the already installed CUI DLL’s on a machine into your applications installation directory during the installation process. That is the machine must have AutoCAD installed on it.
I am not sure if it is compulsory for you to go with the standalone approach but I would like to put forth some of the comments that came up during the discussion with my colleagues regarding this case. Although, it is mentioned that you can build standalone applications looks like it is not a good idea and the reasons being:
1. As I mentioned above, developers aren’t permitted to ship the CUI DLL’s with their applications, so that rules out installing CUI DLL’s with your application.
(Maybe a workaround to this would be for the installer to copy the already installed CUI DLL on a machine into its install directory, but that's messy)
2. The CUI DLL resides in the AutoCAD install directory, but is not a strong named assembly, so has no entry in the GAC. Therefore, to use it the developer must either
a. Run his executable from the AutoCAD install directory.
b. Dynamically find and load the CUI DLL at runtime
You may want to take a look at the following solution in MSDN:
How to load an assembly at runtime that is located in a folder that is not the bin folder of the application
c. Have a hard coded dependency on a specific location for the CUI DLL. This then assumes AutoCAD is installed in the default directory.
Of the above installing in the AutoCAD directory is probably the best.
Dynamically find and load the CUI DLL at runtime [would be] the best option if it worked. Unfortunately, it seems that .exe directory is hard-coded when AcCustomize.dll is loaded from AcCUI.dll. Even if AcCustomize.dll is already loaded, the FileNotFoundException is thrown if exe_dir\AcCustomize.dll is not found.
Please record this issue as a Change Request.