我自己开始学习Innosetup脚本.为此我创建了一个简单的C#控制台应用程序,它从配置文件中读取一个元素并输出到控制台.
<configuration>
<appSettings>
<add key ="Name" value="Brad Pitt"/>
</appSettings>
</configuration>
Run Code Online (Sandbox Code Playgroud)
例如:它应通过查询键属性"Name"来读取值.
我希望从Innosetup安装脚本中写入.config中的值.
即在安装过程中我将收集名称(在这种情况下为"Brad Pitt")并将其写入配置文件的值
<add key ="Name" value="Brad Pitt"/>
Run Code Online (Sandbox Code Playgroud)
问题是如何使用Pascal脚本或标准脚本实现此目的.
非常感谢任何指导
问候
跋蹉
你知道为什么在声明本地const变量时脚本无法编译吗?对不起,我知道很少帕斯卡尔,也无法弄清楚为什么这不起作用!
这个例子(参见CircleArea函数)显示我的语法应该没问题. http://www.tutorialspoint.com/pascal/pascal_quick_guide.htm
这就是我想要做的:
//---placed within [Code]
procedure MyLog(const _functionName, _msg: String);
begin
Log(_functionName + '(): ' + _msg);
end;
function MyExec(const _filename, _params, _dir: String): Boolean;
const // <--- compilation fails in this line!
MethodName = 'MyExec';
var
ResultCode: Integer;
begin
MyLog(MethodName, _filename);
// ... invoke Exec(), etc. ...
end;
//---
Run Code Online (Sandbox Code Playgroud) Inno Setup中Visual Studio安装程序升级代码的等价物是什么?我发现这篇文章如何使用InstallShield升级代码GUID在Inno Setup中卸载相关产品,以使用升级代码搜索产品.AppId与UpgradeCode相同吗?我是Inno设置的新手,有人可以帮助我吗?
我试图列出目录中名称的所有文件,但无法做到.有没有办法列出目录中名称的所有文件?
提前致谢.
我需要一个条件帮助[Run].如果可能......
我需要运行一个取决于条件的命令.
像这样:
if (UserPage.Values[0] = 'NC') then FileName: {sys}\inetsrv\appcmd.exe; Parameters: "set......"
Run Code Online (Sandbox Code Playgroud)
或其他方式来做到这一点.
问候.
这看起来不像Inno Setup问题,但实际上与其有用的Pascal脚本有关.
我编写了一个代码来进行浮点计算.
Height, DivisionOfHeightWidth, Width: Integer;
Height := 1080;
Width := 1920;
DivisionOfHeightWidth := Width / Height;
Log('The Division Of Height and Width: ' + IntToStr(DivisionOfHeightWidth));
Run Code Online (Sandbox Code Playgroud)
编译器日志给出输出:
The Division Of Height and Width: 1
Run Code Online (Sandbox Code Playgroud)
我希望这个编译器输出改为:
The Division Of Height and Width: 1.77
Run Code Online (Sandbox Code Playgroud)
我不能宣布Height与Width作为Extended , Single或Double因为他们正在返回为Integer在大多数情况下,所以我需要这两个整数转换为两场单打.
做完之后:
Height, Width: Integer;
HeightF, WidthF, DivisionOfHeightWidthF: Single;
Height := 1080;
Width := 1920;
HeightF := Height;
WidthF := Width;
DivisionOfHeightWidthF := WidthF / …Run Code Online (Sandbox Code Playgroud) 我想为我的安装程序(Inno Setup)自定义设置图标。我为此目的设置了这行代码:
SetupIconFile=C:\Users\Dale\Desktop\myapp.ico
Run Code Online (Sandbox Code Playgroud)
但是,当我编译安装程序时出现此错误:
这是什么意思,我该如何解决?
[Code]在生成安装可执行文件之前,有没有办法在 Inno Setup 编译器中运行过程或 PowerShell 脚本?
我有一个Inno安装脚本,其中所需的表单太复杂,无法完全在Inno Setup本身构建,所以我在.NET中创建了一个帮助器类库,其中包含一个WinForms窗口,其中包含我需要的东西.
我通过使用Robert Giesecke 的Unmanaged Exports NuGet公开方法在Inno Setup中打开这个WinForms窗口.
这在我运行Windows 10的开发计算机上运行良好.它也可以在运行Windows Server 2012和2016的测试服务器上运行.但是,当我尝试在Windows Server 2008R2计算机上运行安装程序时,出现以下错误:

Sytem.ArgumentException:Font'?' 无法找到.
这是我的Inno安装脚本:
#define MyAppName "InnoTest"
#define MyAppVersion "1.0"
#define MyAppPublisher "Test"
#define MyAppURL "http://inno.test"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\Admin\Desktop\test_inno
OutputBaseFilename=test_inno_setup_x64
Compression=lzma/Max
SolidCompression=true
[Files]
Source: "C:\Users\Admin\Documents\Visual Studio 2017\Projects\InnoTestNet\InnoTestNet\bin\Release\InnoTestNet.dll"; DestDir: "{tmp}"; Flags: dontcopy
[Code]
procedure ShowTestForm(); external 'ShowTestForm@files:InnoTestNet.dll stdcall';
procedure InitializeWizard();
begin
ShowTestForm();
end;
Run Code Online (Sandbox Code Playgroud)
和我的C#代码:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using RGiesecke.DllExport;
namespace InnoTestNet
{
public class InnoTestNet …Run Code Online (Sandbox Code Playgroud) inno-setup ×10
pascalscript ×10
c# ×1
const ×1
dllexport ×1
ico ×1
installation ×1
installer ×1
integer ×1
pascal ×1
powershell ×1
winforms ×1