CAD secondary development, write registry in the installer

CAD secondary development, write registry in the installer 1. Write registry when loading dll We know that the dll is loaded into cad and used HostApplicationServices.Current.RegistryProductRootKey() You can get the current cad registry, so if you want to write when installing the program, there is no cad environment at this time, what should you do? Second, get the registry path of all installed cad After cad is installed, it will store the registry locations of all installed cad in the Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\Hardcopy directory of the registry As shown in the picture, since I only installed one, only one is displayed here, and we can get all valueName values ​​by using the code public static List GetHardcopyList() { List list = new List(); var key = Registry.LocalMachine.CreateSubKey(@”SOFTWARE\Autodesk\Hardcopy”); if (key != null) { string[] subKeyNames = key. GetValueNames(); subKeyNames.Count().Prompt(); foreach (string name in subKeyNames) { list. Add(name); } } return list; } After getting the valueName value, we can use the following method to write the registration form public static void WriteZcb() { var names = GetHardcopyList(); var dllFile = “D:\\123.dll”; foreach (var name in names) { var address = “SOFTWARE\\” + name + “\\Applications”; RegisteringCAD(address, dllFile); } } /// /// Register dll…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索