正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
IS自带的建立卸载快捷方式(Project A Assistant -> Application Shortcuts -> Create an uninstallation shortcut)是有问题的,会出现卸载不完全的现象。解决方法是写脚本:
Install Script -> After More Data -> OnFirstUIAfter 中添加:
- STRING szFile;
- NUMBER nResult;
- szFile = UNINSTALL_STRING + “/UNINSTALL”;
- nResult = StrFind(szFile,”.exe”);
- if(nResult >= 0) then
- StrSub(szMsg1, szFile, 0, nResult + 4);
- StrSub(szMsg2, szFile, nResult + 4, 200);
- LongPathToQuote(szMsg1, FALSE);
- LongPathToQuote(szMsg2, FALSE);
- szFile = “\” + szMsg1 + “\” + szMsg2;
- endif;
-
- AddFolderIcon(FOLDER_PROGRAMS ^ “AliProbe”, “Uninstall AliProbe”, szFile, WINDIR, WINDIR ^ “System32\\msiexec.exe”, 0, REPLACE);
-
- 然后在OnMaintUIAfter()中添加:
- // 删除开始所有程序中的AliProbe文件夹
- DeleteProgramFolder(“AliProbe”);
-
- // 删除桌面上的快捷方式
- STRING szItemName = “AliProbe”;
- STRING szProgramFolder = FOLDER_DESKTOP;
- DeleteFolderIcon(szProgramFolder, szItemName);
-
- // 删除安装目录文件夹
- DeleteProgramFolder(TARGETDIR);
-
- ? 向注册表写入安装路径
- prototype AliprobeReg(); //声明函数
- function AliprobeReg()
- number nRootKey,nType,nSize;
- string szKey,szNumName,szNumValue,szClass;
- begin
- //修改注册表
- nRootKey = HKEY_LOCAL_MACHINE;
- RegDBSetDefaultRoot (nRootKey); //置根为nRootKey
- //注册子项
- szKey="SOFTWARE\\Aliprobe\";
- if RegDBKeyExist(szKey) < 0 then //不存在“SOFTWARE\\Aliprobe”,创建这个项
- RegDBCreateKeyEx(szKey,"");
- endif;
- //初始化每个键的公共值
- nType=REGDB_STRING;
- nSize=-1;
- //注册安装路径
- szNumName="PATH";
- szNumValue=TARGETDIR;
- RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
- end;
- 在OnInstallFilesActionAfter()中调用上面的函数。
-
复制代码
安装结束后启动进程和readme文件
在OnFirstUIAfter()中添加:
- szMsg1 = "AliProbe已经安装完成";
- szMsg2 = "";
- bOpt1 = TRUE;
- bOpt2 = TRUE;
- szOption1 = "打开readme文件";
- // szOption2 = "启动Aliprobe";
- szOption2 = "";
- nResult = SdFinish(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2);
-
- if(bOpt1) then
- if(FindFile(TARGETDIR, "readme.txt", szFile) = 0) then
- LaunchApp(WINDIR^"Notepad.exe", TARGETDIR^"readme.txt");
- endif;
- endif;
-
- if(bOpt2) then
- if(FindFile(TARGETDIR, "AliProbe.exe", szFile) = 0) then
- LaunchApp(TARGETDIR^"AliProbe.exe", "");
- endif;
- endif;
复制代码 |