Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi inno安装程序背景图像问题与磁盘扩展_Delphi_Background Image_Inno Setup - Fatal编程技术网

Delphi inno安装程序背景图像问题与磁盘扩展

Delphi inno安装程序背景图像问题与磁盘扩展,delphi,background-image,inno-setup,Delphi,Background Image,Inno Setup,我正在使用inno安装程序为Windows创建安装程序。我正在尝试为我的安装程序设置背景图像 我使用磁盘扩展将设置拆分为三个磁盘 我创建了安装程序,将每个安装文件放在一个单独的文件夹(1,2,3,4)中,并使用setup.exe运行安装程序 当我单击setup.exe时,出现消息:“请插入disk4”(这是最后一张磁盘)。然后我浏览到disk4,安装程序加载了背景图像 单击“下一步”,启动安装过程时,更改磁盘消息再次出现,并要求disk1启动安装 我不明白为什么我的背景图像跳回到上次的磁盘设置。

我正在使用inno安装程序为Windows创建安装程序。我正在尝试为我的安装程序设置背景图像

我使用磁盘扩展将设置拆分为三个磁盘

我创建了安装程序,将每个安装文件放在一个单独的文件夹(1,2,3,4)中,并使用
setup.exe
运行安装程序

当我单击
setup.exe
时,出现消息:“请插入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;

background.bmp
是列表中的最后一个文件。因此,它自然被放在最后一个磁盘片上。将其移动到顶部,使其位于第一个切片中

这个没有文件,只有背景图片的简单脚本真的再现了这个问题吗?是的,我尝试了这个没有背景代码的脚本,一切都很好。跨越没有问题,安装也很好。当我添加背景代码时,它只有一个问题。如果你强制一个安装程序使用一个人为的小切片大小,一个文件只能跨三个磁盘,那么文件存储(至少部分)在最后一个磁盘上就不足为奇了。你还希望它存储在哪里?我不是用一个文件来存储在三个磁盘上,这是我使用的一个示例脚本。我的主文件是15GB,我想把它分成4个磁盘,每个磁盘有4GB。没有背景代码,安装程序就可以了,安装过程也没有任何问题。我想将我的背景图像存储在磁盘1上的第一个设置中,这就是为什么我问你问题中的示例脚本是否重现了这个问题。因此,事实并非如此。给我们看一个脚本,它可以重现问题!再次向我们展示你的最佳尝试。不是什么明显的错误。