Inno Setup怎么调用外部程序(100分)

  • 主题发起人 主题发起人 liujiaqi
  • 开始时间 开始时间
L

liujiaqi

Unregistered / Unconfirmed
GUEST, unregistred user!
我在卸载软件时(在删除所有文件之前)要调用一个外部小程序(这个小程序就在程序的目录下)来注销掉注册在注册表中的键值,请问怎么调用外部程序呢,下面是我的代码。
;
脚本由韦斯特·金汉化的 Inno Setup 脚本向导 生成!
;
有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!

[Setup]
AppName=优优智能客户关系管理软件
AppVerName=优优智能客户关系管理软件(标准版V5.0)
AppPublisher=杭州优优信息科技有限公司
AppPublisherURL=http://www.uuinfo.com
AppSupportURL=http://www.uuinfo.com
AppUpdatesURL=http://www.uuinfo.com
DefaultDirName={pf}/优优智能客户关系管理软件
DefaultGroupName=优优智能客户关系管理软件
AllowNoIcons=yes
OutputBaseFilename=UUCRMSetupSP5.0.0623
Compression=lzma
SolidCompression=yes

[Languages]
Name: "chinese";
MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon";
Description: "{cm:CreateDesktopIcon}";
GroupDescription: "{cm:AdditionalIcons}";
Flags: unchecked
[Files]
Source: "E:/UUSoft/Product/UUCRM/Release/Standard/UUCRM.exe";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Standard/Config.sys";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Update.exe";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/DBUpdate.exe";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Register.exe";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/FileUpdate.exe";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/公司主页.url";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/技术支持.url";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Reg.dll";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/ntwdblib.DLL";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/qtintf70.dll";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Common.dll";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/DBSQL.sys";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/CRMDB.mdb";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/wallpaper.bmp";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/CardBG.bmp";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/TipOfDay.ini";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/CRMHELP.CHM";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Readme.txt";
DestDir: "{app}";
Flags: ignoreversion
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Report/*";
DestDir: "{app}/Report";
Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Config/*";
DestDir: "{app}/Config";
Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Skins/*";
DestDir: "{app}/Skins";
Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:/UUSoft/Product/UUCRM/Release/Common/Database/*";
DestDir: "{app}/Skins";
Flags: ignoreversion recursesubdirs createallsubdirs
;
注意: 不要在任何共享软件文件上使用“Flags: ignoreversion”
[INI]
Filename: "{app}/UUCRM.url";
Section: "InternetShortcut";
Key: "URL";
String: "http://www.uuinfo.com"
[Icons]
Name: "{group}/优优智能客户关系管理软件";
Filename: "{app}/UUCRM.exe"
Name: "{group}/{cm:ProgramOnTheWeb,优优智能客户关系管理软件}";
Filename: "{app}/UUCRM.url"
Name: "{group}/{cm:UninstallProgram,优优智能客户关系管理软件}";
Filename: "{uninstallexe}"
Name: "{userdesktop}/优优智能客户关系管理软件";
Filename: "{app}/UUCRM.exe";
Tasks: desktopicon
[Run]
Filename: "{app}/UUCRM.exe";
Description: "{cm:LaunchProgram,优优智能客户关系管理软件}";
Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files;
Name: "{app}/UUCRM.url"
 
好久没来这了[:D]

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
Retcode: Integer;
begin
if CurUninstallStep = usUninstall then
begin
Exec(ExpandConstant('{app}') + '/MyProg.exe', '', '', SW_SHOW, ewWaitUntilTerminated, RetCode);
end;
end;

MyProg.exe 是需要执行的程序名称
SW_SHOW,表示执行时显示窗口,也可以使用SW_HIDE
:)
 
谢谢你,老大[:)]
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
646
import
I
后退
顶部