4

我想将游戏放在:C:\Program Files (x86)\test\Gone Home\,但 InnoSetup 会创建以下目录:C:\Program Files (x86)\test\Gone Home\Gone Home

因此,我的图标不起作用。

当我使用“添加文件、添加文件夹、添加目录”时,我得到了相同的结果。我正在使用 Inno Script Studio。

- 如果带有正确图标的 .exe 不在基本目录中,例如 C:\Program Files (x86)\test\Gone Home\binaries... 我必须在图标部分进行哪些更改?

会是这样吗:

Name: {commondesktop}\{#AppName}; Filename: {app}\binaries\{#AppExec}; WorkingDir: {app}; 

到目前为止,这是我的代码:

#define AppName "Gone Home"
#define AppPublisher "test"
#define AppVersion "1.0.0.0"
#define AppExec "GoneHome.exe"
#define SetupName "Setup"  
#define SetupOut "Output"

[Setup]
AppName={#AppName}
AppPublisher={#AppPublisher}
AppVersion={#AppVersion}
AppComments={#AppName}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}     
OutputBaseFilename={#SetupName}
OutputDir={#SetupOut}
InternalCompressLevel=none
DiskSpanning=True
DiskSliceSize=1566000000
SlicesPerDisk=3

[Icons]
Name: {group}\Uninstall {#AppName}; Filename: {app}\unins000.exe; WorkingDir: {app};
Name: {group}\{#AppName}; Filename: {app}\{#AppExec}; WorkingDir: {app}; 
Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExec}; WorkingDir: {app}; 

[Languages]
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"

[Dirs]
Name: "{app}\Gone Home\GoneHome_Data"
Name: "{app}\Gone Home\GoneHome_Data\Managed"
Name: "{app}\Gone Home\GoneHome_Data\Mono"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\1.0"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\Browsers"
Name: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\mconfig"
Name: "{app}\Gone Home\GoneHome_Data\Plugins"
Name: "{app}\Gone Home\GoneHome_Data\Resources"

[Files]
Source: "C:\Program Files (x86)\Gone Home\Attributions.txt"; DestDir: "{app}\Gone Home"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome.exe"; DestDir: "{app}\Gone Home"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\Localization-howto.txt"; DestDir: "{app}\Gone Home"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\uninstall.exe"; DestDir: "{app}\Gone Home"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\level0"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\mainData"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\output_log.txt"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\PlayerConnectionConfigFile"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\resources.assets"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\ScreenSelector.bmp"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\sharedassets0.assets"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\sharedassets1.assets"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Thumbs.db"; DestDir: "{app}\Gone Home\GoneHome_Data"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Assembly-CSharp-firstpass.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Assembly-CSharp.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Assembly-UnityScript-firstpass.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Assembly-UnityScript.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Boo.Lang.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\Mono.Security.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\mscorlib.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\System.Core.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\System.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\System.Xml.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\UnityEngine.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\UnityScript.Lang.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Managed\uScriptRuntime.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Managed"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\mono.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\browscap.ini"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\config"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\1.0\DefaultWsdlHelpGenerator.aspx"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\1.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\1.0\machine.config"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\1.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\DefaultWsdlHelpGenerator.aspx"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\machine.config"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\settings.map"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\web.config"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\Browsers\Compat.browser"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\2.0\Browsers"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Mono\etc\mono\mconfig\config.xml"; DestDir: "{app}\Gone Home\GoneHome_Data\Mono\etc\mono\mconfig"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Plugins\steam_api.dll"; DestDir: "{app}\Gone Home\GoneHome_Data\Plugins"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Gone Home\GoneHome_Data\Resources\unity default resources"; DestDir: "{app}\Gone Home\GoneHome_Data\Resources"; Flags: ignoreversion
4

1 回答 1

2

您已将 Dafault 文件夹(在代码中{app})定义为,DefaultDirName={pf}\{#AppPublisher}\{#AppName}但稍后您将其设置为。{#AppName}Gone HomeDestDir{app}\Gone Home

您应该将 DestDir 设置为 just {app},这将是C:\Program Files (x86)\test\Gone Home您的情况。

关于单独的 ICO 文件,您只需添加类似的IconFileName: "{app}\MySpecialAppIcon.ico"内容 - 您应该将您的图标指向那里。

您也不必为要复制的每个文件都写一行。您可以将通配符*与标志一起使用reateallsubdirs recursesubdirs。这会将所有文件和目录复制到目标目录。

[Files]
Source: "C:\Program Files (x86)\Gone Home\*"; DestDir: "{app}"; Flags: createallsubdirs recursesubdirs ignoreversion 
于 2013-09-10T14:34:09.960 回答