Inno设置无法启动exe

时间:2012-03-28 09:50:40

标签: vb.net vba inno-setup

我创建了在32位机器上运行的windows vb应用程序,并通过Inno Setup Compiler 5.4.2打包。一旦我成功地在机器中安装应用程序,它就不会启动应用程序,日志文件会显示所有依赖项都已成功安装。

任何人都可以帮我解决这个问题吗? 请仔细阅读Inno脚本

[Setup] 
AppId={{32558ED7-C211-4AB1-9D3F-9F36F214531E}
AppName=MyApplication
AppVerName=MyApplication 
DefaultDirName={pf}\MyApplication
DefaultGroupName=MyApplication
LicenseFile=F:\README.TXT
OutputDir=F:\setUp
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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


[Files]
Source: "MyApp4.0.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "XXX.DLL"; DestDir: "{app}\components"; Flags: ignoreversion
Source: "App.ocx"; DestDir: "{app}\components"; Flags: regserver restartreplace sharedfile 
Source: "MSCOMCTL.OCX"; DestDir: {sys}; Flags: regserver restartreplace sharedfile;
Source: "ui.swf"; DestDir: "{app}\ui\"; Flags: ignoreversion 
[Icons]
Name: "{group}\MyApplication"; Filename: "{app}\MyApp4.0.exe"
Name: "{commondesktop}\MyApplication"; Filename: "{app}\MyApp4.0.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\MyApp4.0.exe"; Description: "{cm:LaunchProgram,MyApplication}"; 

1 个答案:

答案 0 :(得分:0)

将您的[Run]部分更改为以下内容:

Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

其中#MyAppExeName.exe文件的名称。