正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #define MyAppName "我的程序"
- #define MyAppVersion "2.0.1.1"
- #define MyAppPublisher "汉化新世纪"
- #define MyAppURL "[url=http://bbs.hanzify.org/]http://bbs.hanzify.org[/url]"
- #define MyAppExeName "OneKey.exe"
- [Setup]
- ; 注意: AppId 的值是唯一识别这个程序的标志。
- ; 不要在其他程序中使用相同的 AppId 值。
- ; (在编译器中点击菜单“工具 -> 产生 GUID”可以产生一个新的 GUID)
- AppId={{我的程序}
- AppName=我的程序
- AppVersion=1.5
- ;AppVerName=我的程序 1.5
- AppPublisher=我的公司
- AppPublisherURL=http://www.example.com/
- AppSupportURL=http://www.example.com/
- AppUpdatesURL=http://www.example.com/
- DefaultDirName={pf}\我的程序
- DefaultGroupName=我的程序
- OutputDir=E:\本地下载\inno编译目录
- OutputBaseFilename=setup
- Compression=lzma
- SolidCompression=yes
- [Languages]
- Name: "default"; MessagesFile: "compiler:Default.isl"
- [Tasks]
- Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
- [Files]
- Source: "E:\本地下载\inno编译目录\{app}\ISTask.dll"; DestDir: "{app}"; Flags: solidbreak
- Source: "E:\本地下载\inno编译目录\{app}\OneKey.exe"; DestDir: "{app}"; Flags: ignoreversion
- ; 注意: 不要在任何共享的系统文件使用 "Flags: ignoreversion"
- [Icons]
- Name: "{group}\我的程序"; Filename: "{app}\OneKey.exe"
- Name: "{group}\{cm:UninstallProgram,我的程序}"; Filename: "{uninstallexe}"
- Name: "{commondesktop}\我的程序"; Filename: "{app}\OneKey.exe"; Tasks: desktopicon
- [Run]
- Filename: "{app}\OneKey.exe"; Description: "{cm:LaunchProgram,我的程序}"; Flags: nowait postinstall skipifsilent
- [Code]
- function RunTask1(FileName: string; bFullpath: Boolean): Boolean;
- external [email]'RunTask@files:ISTask.dll[/email] stdcall delayload';
- function KillTask1(ExeFileName: string): Integer;
- external [email]'KillTask@files:ISTask.dll[/email] stdcall delayload';
- function RunTask(FileName: string; bFullpath: Boolean): Boolean;
- external [email]'RunTask@{app}\ISTask.dll[/email] stdcall uninstallonly';
- function KillTask(ExeFileName: string): Integer;
- external [email]'KillTask@{app}\ISTask.dll[/email] stdcall uninstallonly';
- function InitializeSetup(): Boolean;
- var
- ResultStr: String;
- ResultCode: Integer;
- begin
- Result:= true;
- if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{我的程序}_is1','UninstallString', ResultStr) then
- //_is1 注册信息
- begin
- ResultStr := RemoveQuotes(ResultStr);
- Exec(ResultStr, '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
- if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{我的程序}_is1','UninstallString', ResultStr) then
- begin
- Result:= false;
- Exit;
- end;
- end;
- if RunTask1('OneKey.exe', false) then
- if MsgBox('安装程序检测到 OneKey.exe 正在运行!'#13''#13'单击“是”按钮关闭程序并继续安装!'#13''#13'单击“否”按钮则退出安装程序!',mbConfirmation, MB_OKCANCEL) = IDOK then
- KillTask1('OneKey.exe')
- else begin
- Result :=false;
- end;
- end;
- procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
- begin
- if CurUninstallStep = usUninstall then
- begin
- if RunTask('OneKey.exe', false) then
- if MsgBox('卸载程序检测到 OneKey.exe 正在运行!'#13''#13'单击“是”按钮关闭程序并进行卸载!'#13''#13'单击“否”按钮则退出安装程序!',mbConfirmation, MB_OKCANCEL) = IDOK then
- KillTask('OneKey.exe')
- else
- Abort;
- UnloadDll(ExpandConstant('{app}\ISTask.dll'));
- end;
- end;
复制代码
|