Inno Setup dir失败并启动失败

时间:2015-03-20 16:34:55

标签: inno-setup

我在Inno Setup方面遇到了一些问题。

1:'Dirs'无法创建,但没有记录错误。

2:安装后应用程序无法运行,并且复选框选项未出现在任何设置页面中。

Inno脚本:

[Setup]
AppName=TestApp™
AppVersion=1.0.0.0
AppId={{3334B489-80D3-4741-87F2-17699CCDDDAC}
ChangesAssociations=yes
SetupIconFile=userdocs:Visual Studio 2013\Projects\TestApp\res\Icons\2001.ico
ShowLanguageDialog=no
UninstallDisplayName=TestApp
UninstallDisplayIcon={app}\TestApp.exe
VersionInfoVersion=1.0.0.0
VersionInfoCompany=MyCompany™
VersionInfoDescription=Test App
VersionInfoCopyright=© 2015 MyCompany™
VersionInfoProductName=TestApp™
VersionInfoProductVersion=1.0.0.0
SolidCompression=True
Compression=lzma2/ultra
InternalCompressLevel=ultra
MinVersion=0,5.01
DefaultDirName={pf}\TestApp
DefaultGroupName=TestApp
LicenseFile=C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\EULA.txt
OutputBaseFilename=TestApp v1
WizardImageBackColor=$00FF6633
AppCopyright=© 2015 MyCompany™
AppPublisher=MyCompany™
DisableStartupPrompt=False
UninstallDisplaySize=5000000
AlwaysShowGroupOnReadyPage=True
AlwaysShowDirOnReadyPage=True

[Dirs]
Name: "{localappdata}\TestApp";
Name: "{localappdata}\TestApp\Files";

[Registry]
Root: HKCR; Subkey: ".myext"; ValueType: string; ValueName: ""; ValueData: "TestApp"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "TestApp\Content Type"; ValueType: string; ValueName: ""; ValueData: "application/x-myext"
Root: HKCR; Subkey: "TestApp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: """{app}\TestApp.EXE"",0"
Root: HKCR; Subkey: "TestApp\shell"; ValueType: string; ValueName: ""; ValueData: "open"
Root: HKCR; Subkey: "TestApp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\TestApp.EXE"" ""%1"""

[Files]
Source: "Build\TestApp.exe"; DestDir: "{app}"
Source: "C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\TestApp.dll"; DestDir: "{app}"
Source: "C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\EULA.txt"; DestDir: "{app}"

[Icons]
Name: "{group}\TestApp"; Filename: "{app}\TestApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\TestApp.exe"; IconIndex: 0
Name: "{commondesktop}\TestApp"; Filename: "{app}\TestApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\"; IconIndex: 0

[Run]
Filename: "{app}\TestApp.EXE"; Description: "Launch application"; Flags: postinstall nowait skipifsilent unchecked

[ThirdParty]
CompileLogFile=C:\Users\Admin\Desktop\test.log

日志文件:

    Starting compile.  [Friday, March 20 2015 at 16:19:58]
    Compiling script with Inno Setup 5.5.5 (a) [ISDLLCompileScriptA]

    [PreCompile] Processing.
    [PreCompile] Processing is still being tested.
    [PreCompile] Processing finished.

    [ISPP] Preprocessing.
    [ISPP] Preprocessed.

    Parsing [Setup] section, line 2
    Parsing [Setup] section, line 3
    Parsing [Setup] section, line 4
    Parsing [Setup] section, line 5
    Parsing [Setup] section, line 6
    Parsing [Setup] section, line 7
    Parsing [Setup] section, line 8
    Parsing [Setup] section, line 9
    Parsing [Setup] section, line 10
    Parsing [Setup] section, line 11
    Parsing [Setup] section, line 12
    Parsing [Setup] section, line 13
    Parsing [Setup] section, line 14
    Parsing [Setup] section, line 15
    Parsing [Setup] section, line 16
    Parsing [Setup] section, line 17
    Parsing [Setup] section, line 18
    Parsing [Setup] section, line 19
    Parsing [Setup] section, line 20
    Parsing [Setup] section, line 21
    Parsing [Setup] section, line 23
    Parsing [Setup] section, line 24
    Parsing [Setup] section, line 25
    Parsing [Setup] section, line 26
    Parsing [Setup] section, line 27
    Parsing [Setup] section, line 28
    Parsing [Setup] section, line 29
    Parsing [Setup] section, line 30
    Parsing [Setup] section, line 31
    Reading file (LicenseFile)
    Reading file (WizardImageFile)
       File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNIMAGE.BMP
    Reading file (WizardSmallImageFile)
       File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNSMALLIMAGE.BMP
    Preparing Setup program executable
       Updating icons (SETUP.E32)
    Reading default messages from Default.isl
    Parsing [LangOptions], [Messages], and [CustomMessages] sections
       File: C:\Program Files (x86)\Inno Setup 5\Default.isl
       Messages in script file
    Reading [Code] section
    Parsing [Dirs] section, line 34
    Parsing [Dirs] section, line 35
    Parsing [Icons] section, line 50
    Parsing [Icons] section, line 51
    Parsing [Registry] section, line 38
    Parsing [Registry] section, line 39
    Parsing [Registry] section, line 40
    Parsing [Registry] section, line 41
    Parsing [Registry] section, line 42
    Parsing [Run] section, line 54
    Parsing [Files] section, line 45
       Reading version info: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\TestApp.exe
    Parsing [Files] section, line 46
       Reading version info: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\TestApp.dll
    Parsing [Files] section, line 47
       Reading version info: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\EULA.txt
    Deleting TestApp v1.exe from output directory
    Creating setup files
       Updating icons (SETUP.EXE)
       Compressing: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\TestApp.exe   (5.0.0.0)
       Compressing: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\TestApp.dll   (3.2.0.5)
       Compressing: C:\Users\Admin\Documents\Visual Studio 2013\Projects\TestApp\Build\EULA.txt
       Compressing Setup program executable
       Updating version info

    [PostCompile] Processing.

[PostCompile] Processing is still being tested.
[PostCompile] Processing finished.

Compile finished.  [Friday, March 20 2015 at 16:20:01]
Total compile time: 00:03.547

据我所知,代码应该来自手册,所以我错过了什么?

1 个答案:

答案 0 :(得分:0)

我刚刚编译并执行了你的脚本,它工作正常(除了我没有VisualStudio-Path的文件)。 但更重要的是,Dirs创建了!你确定他们不在吗?也许你只需刷新一个资源管理器视图 - 或者你看错了地方(%LOCALAPPDATA%有目录。)