InstallShield脚本读取CAD路径
作者:互联网
function setFolder()
STRING szParam,szKey, szNumName, szNumValue;
NUMBER nvType, nvSize;
NUMBER rtn;
begin
rtn = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Autodesk\\AutoCAD\\R17.0\\ACAD-5001:804";
nvType = REGDB_STRING;
szNumName = "AcadLocation";
szNumValue = "";
nvSize = -1;
rtn = RegDBGetKeyValueEx(szKey, szNumName, nvType, szNumValue, nvSize);
if( rtn < 0 ) then
szKey = "SOFTWARE\\Wow6432Node\\Autodesk\\AutoCAD\\R17.0\\ACAD-5001:804";
rtn = RegDBGetKeyValueEx(szKey, szNumName, nvType, szNumValue, nvSize);
if( rtn < 0 ) then
MessageBox("找不到CAD程序",INFORMATION);
return FALSE;
endif;
endif;
if( nvType != REGDB_STRING) then
return FALSE;
endif;
if( nvSize <= 0 ) then
return FALSE;
endif;
szParam = szNumValue ^ "\\acad.exe";
CreateProgramFolder( SHELL_OBJECT_FOLDER );
ShowProgramFolder( SHELL_OBJECT_FOLDER, SW_SHOW );
//szParam = TARGETDIR ^ "\\autoStart.exe";
LongPathToQuote( szParam ,TRUE );
AddFolderIcon( SHELL_OBJECT_FOLDER, "江门市电子报批-设计端", szParam,
TARGETDIR , "", 0, "", REPLACE );
AddFolderIcon( FOLDER_DESKTOP, "江门市电子报批-设计端", szParam,
TARGETDIR, "", 0, "", REPLACE );
if(nWindVer>=6) then
if(Is(FILE_EXISTS,TARGETDIR^"\\modifyShortCut.exe")) then
LaunchAppAndWait(TARGETDIR^"\\modifyShortCut.exe","江门市电子报批-设计端.lnk",WAIT);//安装engine
endif;
endif;
标签:InstallShield,szParam,rtn,nvType,szKey,endif,CAD,szNumValue,读取 来源: https://blog.csdn.net/myfatenight/article/details/88389265