我正在使用inno-setup为Windows创建安装程序。我正在尝试为我的安装程序设置背景图像。
我使用磁盘跨越将设置拆分为三个磁盘。
我创建了我的安装程序,将每个安装文件放在一个单独的文件夹(1,2,3,4)中,然后使用setup.exe
运行安装程序。
当我点击setup.exe
时,会显示消息:“please insert disk4”(这是最后一张磁盘)。然后我浏览到了disk4,安装程序加载了背景图片。
当我单击下一步时,启动安装过程,再次出现更改磁盘消息,并要求disk1
开始安装。
我无法理解为什么我的背景图片跳回到最后一个磁盘设置。如何在第一个设置文件中设置背景图像?
以下是我正在使用的代码:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6FE5A065-8F6A-479A-BBC8-F0E56233B473}
AppName=Batman
AppVerName=Batman
AppPublisher=Warner Bros
DefaultDirName={pf}\Batman
DefaultGroupName=Batman
OutputDir=D:\
OutputBaseFilename=setup
SetupIconFile=D:\Inno Setup Project\Batman\icon.ico
WizardImageFile=D:\Inno Setup Project\Batman\big.bmp
WizardSmallImageFile=D:\Inno Setup Project\Batman\small.bmp
Compression=none
DiskSpanning=true
SlicesPerDisk=3
DiskSliceSize=1433403392
WindowVisible=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\Program Files (x86)\Batman\Launcher.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Program Files (x86)\Batman\BAA.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Program Files (x86)\Batman\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "background.bmp"; DestDir: "{tmp}"; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Batman"; Filename: "{app}\Launcher.exe"
Name: "{group}\{cm:UninstallProgram,Batman}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Batman"; Filename: "{app}\Launcher.exe"; Tasks: desktopicon
[Run]
Filename: {app}\_CommonRedist\DirectX\Jun2010\DXSETUP.exe; Description: {cm:LaunchProgram,DirectX}
Filename: {app}\_CommonRedist\vcredist\2010\vcredist_x86.exe; Description: {cm:LaunchProgram,VCRedist}
Filename: {app}\_CommonRedist\vcredist\2010\vcredist_x64.exe; Description: {cm:LaunchProgram,VCRedist}
Filename: "{app}\Launcher.exe"; Description: "{cm:LaunchProgram,Batman}"; Flags: nowait postinstall skipifsilent
[Code]
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeWizard();
var
width,height: Integer;
BackgroundBitmapImage: TBitmapImage;
s: string;
begin
ExtractTemporaryFile('background.bmp');
s:=ExpandConstant('{tmp}')+'\background.bmp';
WizardForm.Position:=poScreenCenter;
MainForm.BORDERSTYLE:=bsNone;
width:=GetSystemMetrics(0);
height:=GetSystemMetrics(1);
MainForm.Width:=width;
MainForm.Height:=height;
width:=MainForm.ClientWidth;
height:=MainForm.ClientHeight;
MainForm.Left := 0;
MainForm.Top := 0;
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Bitmap.LoadFromFile(s);
BackgroundBitmapImage.Align := alClient;
BackgroundBitmapImage.Parent := MainForm;
BackgroundBitmapImage.Stretch:=True;
MainForm.Visible:=True;
end;
答案 0 :(得分:0)
background.bmp
是列表中的最后一个文件。因此它自然地放在最后一个磁盘片上。将其移至顶部,以使其位于第一个切片中。