0
是否可以在运行时更改WizardImageFile?我希望这张照片可以在某些情况下改变。无法在代码中更改它,{code:GetGraphics}也无法在WizardImageFile参数中使用。 有没有人在运行时成功改变它?也许有另一种方法来设置WizardForm.WizardBitmapImage的图片?Inno安装程序,在运行时更改WizardImageFile
是否可以在运行时更改WizardImageFile?我希望这张照片可以在某些情况下改变。无法在代码中更改它,{code:GetGraphics}也无法在WizardImageFile参数中使用。 有没有人在运行时成功改变它?也许有另一种方法来设置WizardForm.WizardBitmapImage的图片?Inno安装程序,在运行时更改WizardImageFile
以下脚本显示了如何有条件地显示两个图像中的一个,具体取决于它是早上还是下午。这些图像仅用于此目的,并且在向导窗体初始化时被提取到安装程序使用的临时目录。因为你试图使用一个代码段来改变WizardImageFile
指令值(这是不可能的),你会用WizardForm
的WizardBitmapImage
图像的工作:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "Image1.bmp"; Flags: dontcopy
Source: "Image2.bmp"; Flags: dontcopy
[Code]
procedure InitializeWizard;
var
FileName: string;
begin
if StrToInt(GetDateTimeString('h', #0, #0)) < 12 then
FileName := 'Image1.bmp'
else
FileName := 'Image2.bmp';
ExtractTemporaryFile(FileName);
WizardForm.WizardBitmapImage.Bitmap.LoadFromFile(
ExpandConstant('{tmp}\' + FileName));
end;
当你需要设置图片这不仅有利于有一次,我需要在安装过程中将它从一个更改为另一个 – 2013-02-23 12:36:55
对不起,但图像'WizardImageFile'指令只影响欢迎页面左侧的图像,不是吗?那么您想更改哪张图片(理想情况下显示在屏幕截图上)?无论如何,在安装过程中没有事件发生,所以这是不可能的,没有使用一些扩展(也许你想[这样的事情](http://stackoverflow.com/q/10130184/960757),很难说)。 – TLama 2013-02-23 12:41:25
不仅欢迎页面,也完成了页面。我无法创建可能看起来像finisehd页面的自定义页面,所以我在NextButtonClick中执行Result:= False,然后将完成的页面内容更改为下一页。但我无法更改左侧图片 – 2013-02-23 13:19:14