|
下了很多CAD的二次开发安装程序,效果都不符合自己的要求,自己又用VB写了一个,发上来看看在没有人用得着。过一段时间测试后再把源代码传上来,供使用者自行修改以符合特定的要求。本程序配合inno setup及其他安装程序打包自己的二次开发程序,最终只有一个安装程序 说明如下:
Installcad.exe共有四个参数,用一个或多个空格分开,其参数依次为
一、安装还是卸载(u/i),只能是一个字母,不分大小写,其他将不能识别
二、支持的CAD版本,任意字符分隔(R15.0,R16.0,R16.1或者R14.0:R16.0:R16.1均可),单独使用参数"A" 或"a",将支持2000及其以上所有版本。
三、菜单组名,如果要加上一个或多个下拉菜单,跟在后面,用英文分号分隔,如my-zandan-tools菜单组中有一个下拉菜单pop1 ,可以这样写(my-zandan-toolsop1或者不要下拉菜单只写my-zandan-tools均可)。第一个下拉菜单将安装在倒数第三的位置上,依次类推。
四、菜单文件名,不加后缀,安装时将检查菜单文件(.mns or .mnu)是否存在,不存在将退出。
功能:首先检测是否运行,如未运行则添加本程序所地路径到CAD支持文件搜索路径,添加菜单(包括下拉菜单)
示例参数 i R16.0;R16.1 my-zandan-toolsop1 zandan-tools
自己的一段脚本如下:
[Files]
Source: Installcad.exe; DestDir: {app}; Flags: ignoreversion
;Source: E:\试安装CAD\展点\AcadInst.ini; DestDir: {app}; Flags: ignoreversion
Source: HUI-luxdian.txt; DestDir: {app}; Flags: ignoreversion
Source: my-zandan-tools.mnl; DestDir: {app}; Flags: ignoreversion
Source: my-zandan-tools.mns; DestDir: {app}; Flags: ignoreversion
Source: 产状.dwg; DestDir: {app}; Flags: ignoreversion
Source: 地质点示例数据.xls; DestDir: {app}; Flags: ignoreversion
Source: 展点帮助文件.chm; DestDir: {app}; Flags: ignoreversion
Source: 展点主程序.fas; DestDir: {app}; Flags: ignoreversion
Source: 调用EXCEL展点.fas; DestDir: {app}; Flags: ignoreversion
Source: 展点示范文件.gif ;DestDir: {app}; Flags: isreadme
Source: 示例图框.dwg ; DestDir: {app}; Flags: ignoreversion
; 注意: 不要在任何共享系统文件中使用“Flags: ignoreversion”
[Icons]
;shorcut icons
Name: "{group}\重安装展点程序";IconFilename: "{app}\Installcad.exe" ; Filename: "{app}\Installcad.exe"; Parameters:"i R15.0;R15.1;R16.0;R16.1 my-zandan-tools my-zandan-tools"
Name: "{group}\{cm:UninstallProgram,老张展点程序}"; Filename: "{uninstallexe}"
[Run]
Filename: {app}\Installcad.exe; Parameters:" i R15.0;R15.1;R16.0;R16.1 my-zandan-tools my-zandan-tools"; WorkingDir: {app}; Flags: runminimized
[UninstallDelete]
;delete these files on uninstall
Type: files; Name: {app}\my-zandan-tools.mnc
Type: files; Name: {app}\my-zandan-tools.mnr
Type: files; Name: {app}\示例图框.bak
[UninstallRun]
;run this program on uninstall
Filename: {app}\Installcad.exe; Parameters:"u R15.0;R15.1;R16.0;R16.1 my-zandan-tools "; WorkingDir: {app}; Flags: waituntilidle |
|