inno安装卸载时检测程序是否正在运行卸载完成后自动打开网页-代码无效
inno setup 安装卸载时检测程序是佛正在运行卸载完成后自动打开网页-代码无效
--------------------------代码如下---------------------------
[Code]
var
ErrorCode: Integer;
IsRunning: Integer;
// 安装时判断客户端是否正在运行
function InitializeSetup(): Boolean;
begin
Result :=true; //安装程序继续
IsRunning:=FindWindowByWindowName('东方宽频网络电视');
while IsRunning<>0 do
begin
if Msgbox('安装程序检测到客户端正在运行。' #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then
begin
Result :=false; //安装程序退出
IsRunning :=0;
end else begin
Result :=true; //安装程序继续
IsRunning:=FindWindowByWindowName('东方宽频网络电视');
end;
end;
end;
// 卸载时判断客户端是否正在运行
function InitializeUninstall(): Boolean;
begin
Result :=true; //安装程序继续
IsRunning:=FindWindowByWindowName('东方宽频网络电视');
while IsRunning<>0 do
begin
if Msgbox('安装程序检测到客户端正在运行。' #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then
begin
Result :=false; //安装程序退出
IsRunning :=0;
end else begin
Result :=true; //安装程序继续
IsRunning:=FindWindowByWindowName('东方宽频网络电视');
end;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usUninstall:
begin // 开始卸载
end;
usPostUninstall:
begin // 卸载完成
// MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall just finished.', mbInformation, MB_OK);
// ...insert code to perform post-uninstall tasks here...
ShellExec('open', 'http://www.baidu.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;
end;
请问“东方宽屏网络电视”是不是改成自己程序的名字
这些代码无效 怎没办 - -!!
|
|
|
|
lh822 | 2011-11-17 14:13 |
; 脚本由 Inno Setup 脚本向导 生成! ; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "我的程序" #define MyAppVersion "1.5" #define MyAppPublisher "我的公司" #define MyAppURL "http://www.example.com/" #define MyAppExeName "AngryBirds.exe" [Setup] ; 注: AppId的值为单独标识该应用程序。 ; 不要为其他安装程序使用相同的AppId值。 ; (生成新的GUID,点击 工具|在IDE中生成GUID。) AppId={{84B08A76-86FA-4ADA-8943-4275F0CC0F21} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}{#MyAppName} DefaultGroupName={#MyAppName} OutputBaseFilename=setup Compression=lzma SolidCompression=yes [Languages] Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 [Files] Source: "E:愤怒的小鸟AngryBirds.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "E:愤怒的小鸟*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion” [Icons] Name: "{group}{#MyAppName}"; Filename: "{app}{#MyAppExeName}" Name: "{group}{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" Name: "{group}{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" Name: "{commondesktop}{#MyAppName}"; Filename: "{app}{#MyAppExeName}"; Tasks: desktopicon [Run] Filename: "{app}{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent [Code] var ErrorCode: Integer; IsRunning: Integer; // 安装时判断客户端是否正在运行 function InitializeSetup(): Boolean; begin Result :=true; //安装程序继续 IsRunning:=FindWindowByWindowName('我的程序'); while IsRunning<>0 do begin if Msgbox('安装程序检测到客户端正在运行。' #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then begin Result :=false; //安装程序退出 IsRunning :=0; end else begin Result :=true; //安装程序继续 IsRunning:=FindWindowByWindowName('我的程序'); end; end; end; // 卸载时判断客户端是否正在运行 function InitializeUninstall(): Boolean; begin Result :=true; //安装程序继续 IsRunning:=FindWindowByWindowName('我的程序'); while IsRunning<>0 do begin if Msgbox('安装程序检测到客户端正在运行。' #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then begin Result :=false; //安装程序退出 IsRunning :=0; end else begin Result :=true; //安装程序继续 IsRunning:=FindWindowByWindowName('我的程序'); end; end; end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); begin case CurUninstallStep of usUninstall: begin // 开始卸载 end; usPostUninstall: begin // 卸载完成 // MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall just finished.', mbInformation, MB_OK); // ...insert code to perform post-uninstall tasks here... ShellExec('open', 'http://www.baidu.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode); end; end; end; 这样怎么不对 。。。 %>_<% |