在使用Inno Setup创建的安装过程中,我需要获取驱动器号的卷序列号.我知道DLL函数可以导入Inno,但我对它很新,并且在使它工作时遇到一些问题.我知道kernel32中的GetVolumeInformation函数可以做我需要的.有人可以告诉我如何在Inno脚本中导入和使用该功能来检索卷序列号吗?
谢谢!
我准备了简单的脚本,ProgressGauge在wpInstalling页面上的栏下显示图像.
但是......我需要更复杂的功能.
我需要的是多个图像显示,每个显示X(例如7)秒(安装时的循环时间超过X秒*图像数量)或每次安装后X(例如10%).我试图嵌入图像显示ProgressGauge.Position,但我失败了.
这是我有的:
procedure CurPageChanged(CurPageID: Integer);
var
BmpFile: TBitmapImage;
begin
ExtractTemporaryFile('01.bmp');
ExtractTemporaryFile('02.bmp');
ExtractTemporaryFile('03.bmp');
if CurPageID = wpInstalling then
begin
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\01.bmp'));
BmpFile.Width:= ScaleX(420);
BmpFile.Height:= ScaleY(180);
BmpFile.Left := WizardForm.ProgressGauge.Left + ScaleX(0);
BmpFile.Top := WizardForm.ProgressGauge.Top + ScaleY(35);
// BmpFile.Parent:= WizardForm.InstallingPage;
// BmpFile:= TBitmapImage.Create(WizardForm);
// BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\03.bmp'));
// BmpFile.Width:= ScaleX(420);
// BmpFile.Height:= ScaleY(400);
// BmpFile.Left := WizardForm.ProgressGauge.Left + ScaleX(0);
// BmpFile.Top := WizardForm.ProgressGauge.Top + ScaleY(35);
// BmpFile.Parent:= WizardForm.InstallingPage;
// BmpFile:= TBitmapImage.Create(WizardForm);
// BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\03.bmp'));
// BmpFile.Width:= ScaleX(420); …Run Code Online (Sandbox Code Playgroud) 德尔福部分:
我有一个关于事件的类,从那个事件我需要调用一个将接口对象传递给它的过程.它在Delphi中工作正常,但我在Pascal脚本中声明它有问题.
在后台 - IGPGraphics接口是一部分Delphi GDI+ library而没有方法定义如下:
type
IGdiplusBase = interface
['{24A5D3F5-4A9B-42A2-9F60-20825E2740F5}']
IGPGraphics = interface(IGdiPlusBase)
['{57F85BA4-CB01-4466-8441-948D03588F54}']
Run Code Online (Sandbox Code Playgroud)
以下是我在Pascal脚本中需要做的简化Delphi伪代码:
type
TRenderEvent = procedure(Sender: TObject; const GPGraphics: IGPGraphics) of object;
TRenderClass = class(TGraphicControl)
private
FOnRender: TRenderEvent;
public
property OnRender: TRenderEvent read FOnRender write FOnRender;
end;
// when the TRenderClass object instance fires its OnRender event I want to call
// the RenderObject procedure passing the IGPGraphics interfaced object to it; I
// hope I'm doing it right, I'm just a …Run Code Online (Sandbox Code Playgroud) 如何在安装期间加载和使用JSON配置文件?我可以从文件中读取字符串并写入它,但是如果我想在配置文件中更改某些值,我必须使用VBScript.RegExpCOM对象(这很好,但很难开发).
目前的方法:
ExtractTemporaryFile('config.json');
filename := ExpandConstant('{tmp}\config.json');
LoadStringFromFile(filename, conf);
objRegExp := CreateOleObject('VBScript.RegExp');
objRegExp.Pattern := 'test';
conf := objRegExp.Replace(conf, 'test_replace');
SaveStringToFile(filenameOut, conf, False);
Run Code Online (Sandbox Code Playgroud)
有一个更好的方法吗?我只需要替换JSON对象中的一些值,而不是额外的魔法.
我必须更改Inno安装脚本.但是我无法编译它(每次编译时,我都要等待将近1个小时才能完成构建).我需要知道如何编写C++伪代码中的以下表达式:
if ((A==B) || (A==C))
{
// do something
}
Run Code Online (Sandbox Code Playgroud)
问题是我应该如何在Inno Setup脚本中编写它,如果可能的话,你知道这个脚本语言是否特定于Inno Setup,或者我可以在某个地方找到指南吗?在官方网站上,很难以简单的方式得到你想要的东西,它相当混乱,我找不到简单的例子OR(例子非常基本).
我想知道是否可以以某种方式测试我的 [Code] 部分中的功能,而无需每次都编译整个安装程序并运行它。这将使功能的开发和测试变得更加容易。
\n\n非常感谢!\nS\xc3\xb6ren
\n我尝试制作安装文件来修补以前的程序。安装程序必须能够检查是否安装了以前的程序。
这是我无法使用的代码
[Code]
function GetHKLM() : Integer;
begin
if IsWin64 then
begin
Result := HKLM64;
end
else
begin
Result := HKEY_LOCAL_MACHINE;
end;
end;
function InitializeSetup(): Boolean;
var
V: string;
begin
if RegKeyExists(GetHKLM(), 'SOFTWARE\ABC\Option\Settings')
then
MsgBox('please install ABC first!!',mbError,MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)
我的条件是
RegKeyExists如何修改代码?
先感谢您。
**更新修复Wow6432Node问题。我尝试修改我的代码
[Code]
function InitializeSetup: Boolean;
begin
// allow the setup to continue initially
Result := True;
// if the registry key based on current OS bitness doesn't exist, …Run Code Online (Sandbox Code Playgroud) 是否有像returnC 中那样的命令/结构立即从 Inno Setup 脚本代码的函数退出并保留结果代码?
我想要一些东西
If k = false then
Begin
Result:=false;
Exit;
End;
Run Code Online (Sandbox Code Playgroud) 我之前曾成功使用Unmanaged Exports和DllExport与 Inno Setup 一起使用 .NET DLL 文件。
然而现在我正在尝试让它与DNNE一起工作。
我有以下针对 x86 的 C# 代码
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableDynamicLoading>true</EnableDynamicLoading>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DNNE" Version="1.0.31" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
using System.Runtime.InteropServices;
namespace DNNETest
{
internal static class NativeMethods
{
[DllImport("User32.dll", EntryPoint = "MessageBox",
CharSet = CharSet.Auto)]
internal static extern int MsgBox(
IntPtr hWnd, string lpText, string lpCaption, uint uType);
}
public class Class1
{
[UnmanagedCallersOnly(CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvStdcall) })]
public static …Run Code Online (Sandbox Code Playgroud) 我需要更改向导页面“信息”上文本框的字体和字体大小,在该文本框中显示通过InfoBeforeFile部分中的参数指定的文本[Languages]。更改字体的原因是文本框中显示的文件内容是使用等宽字体(如Courier New.
在Inno Setup 帮助中,我查看了支持类参考以找到答案,但没有成功。
谢谢你的帮助!
inno-setup ×10
pascalscript ×10
.net ×1
c# ×1
delphi ×1
delphi-2009 ×1
image ×1
installer ×1
remobjects ×1
return-value ×1
slideshow ×1
winapi ×1