“Fork

SolidWorks的Add-in写入注册表。

对于SolidWorks的Add-in编写完成之后的注册表写入问题,特编写基本步骤,按照此步骤可以实现add-in的注册表写入。

SetUp Process

1. Create a new add-in using a SolidWorks API SOK template in Microsoft Visual Studio 2005 or 2008. //利用vs和SolidWorksAPI SDK Template 生成一个新的add-in项目

Create the Windows Installer setup project and files//创建安装部署文件

Open the add-in's solution file in Visual Studio.//打开解决方案

Click File, Add, New Project to open the Add New Project dialog. //选择文件、添加、新建项目
Expand Other Project Types in Project Types. //打开项目名称、其他项目类型
Click Setup and Deployment in Project Types. //选择安装部署类型
Click Setup Project in Templates. //创建安装部署项目
Type the name of your setup project in Name.//输入项目名称
Click OK.//点击OK
Select your new setup project in the Solution Explorer.//资源管理器中选择建好的项目
Click Project, Add, Project Output to open the Add Project Output Group dialog. //选择项目、添加、主输出
Select your add-in's project in Project. //选择SolidWorks add-in项目
Select Primary Output in the list. //选择列表中的主输出
Click OK. //点击OK

一下就是创建注册表项、键值、字符串等
2. Display your add-in in the SolidWorks Add-ins manager
Click View, Editor, Registry. //右键选择视图、编辑、注册表
Expand HKEY _LOCAL_MACHINE. //打开Local_Machine
Right-click Software, select New, Key, and type SolidWorks as the new key's name.//右键software、新建、Key值,输入名称 SolidWorks
Right-click SolidWorks, select New, Key, and type Addins as the new key's name.//右键SolidWorks、新建、输入名称 Addins
Right-click Addins, select New, Key, and type {Your add-in's GUID} as the new key's name.//右键Addins、新建、Key值、输入Addin的Guid,打开创建的SolidWorks Add-in项目中的SwAddin进行查看

NOTE: You must enclose the GUID in curly braces.//确保GUID用{}括起来

Right-click the GUID key, select New, DWORD Value. //右键GUID、新建、DWORD值
Type Default Name and type the value set by your add-in's RegisterFunction function in Value.//输入Default名称,SwAddin中查看实际值
Right-click the GUID key, select New, String Value //右键GUID、新建、字符值
Type Description in Name and type the value set by your add-in's RegisterFunction function in Value (e.g., "MyNewAddin description").//输入Description名称,SwAddin中查看实际值
Right-click the GUID key, select New, String Value. //右键GUID,新建、字符值
Type Title in Name and type the value set by your add-in's RegisterFunction function in value(e.g.,"MyNewAddin").//输入Title名称,SwAddin查看实际值
Save and build the setup project.//保存并生成安装项目

A setup.exe file and a .msi file are created that you can use to distribute your add-in.//完成

 

作者:AndyTGYan

posted @ 2019-11-01 17:21  颜廷国  阅读(1400)  评论(0编辑  收藏  举报