如何跳过在inno设置中选择的特定任务的启动消息?

时间:2011-10-18 15:50:59

标签: installer inno-setup

如果用户在安装期间检查相应的复选框(即; 2安装类型独立和服务),我想在安装后启动程序。我有一个用于service的复选框。所以只有一个任务。所以通常(默认情况下)它将作为独立安装,它将在安装后启动一个exe。但是当我选择服务时,它将显示安装后要执行的启动消息(即独立和服务)。那么如何解决这个问题呢?

这是我正在使用的代码

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkedonce
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

; Install for all users or current user only
Name: common; Description: &All users; GroupDescription: Install for:; Flags: exclusive unchecked
Name: local; Description: Just &me; GroupDescription: Install for:; Flags: exclusive
Name: Service; Description:Install as a Service; GroupDescription: Setup Type:; Flags: unchecked

[Run]
Filename: {app}\HMI.exe; Description: {cm:LaunchProgram,Runtimne Win32}; Flags: nowait postinstall skipifsilent;
Filename: {app}\ServiceTray.exe; Description: {cm:LaunchProgram,Runtimne Win32 as Service}; Flags: nowait postinstall skipifsilent runascurrentuser;Tasks: Service

在这通常我想启动程序(即运行时win32)如果用户选择服务它显示启动程序消息(即运行时win32和运行时win32作为服务)。我只使用一个任务,即服务; 那么除了使用2个任务之外还有其他解决方案吗?

1 个答案:

答案 0 :(得分:0)

如果要删除Launch Runtimne Win32安装后选项,请添加Task参数以排除服务任务:

Filename: {app}\HMI.exe; Description: {cm:LaunchProgram,Runtimne Win32}; Flags: nowait postinstall skipifsilent; Tasks: Not Service