InnoSetup.ScriptBuilder
7.1.0-rc01
dotnet add package InnoSetup.ScriptBuilder --version 7.1.0-rc01
NuGet\Install-Package InnoSetup.ScriptBuilder -Version 7.1.0-rc01
<PackageReference Include="InnoSetup.ScriptBuilder" Version="7.1.0-rc01" />
<PackageVersion Include="InnoSetup.ScriptBuilder" Version="7.1.0-rc01" />
<PackageReference Include="InnoSetup.ScriptBuilder" />
paket add InnoSetup.ScriptBuilder --version 7.1.0-rc01
#r "nuget: InnoSetup.ScriptBuilder, 7.1.0-rc01"
#:package InnoSetup.ScriptBuilder@7.1.0-rc01
#addin nuget:?package=InnoSetup.ScriptBuilder&version=7.1.0-rc01&prerelease
#tool nuget:?package=InnoSetup.ScriptBuilder&version=7.1.0-rc01&prerelease
InnoSetup.ScriptBuilder
This package is intended to build Inno Setup script files (*.iss) using a C# fluent API. You can find the official Inno Setup documentation on the Inno Setup website.
Installation
.NET CLI
dotnet add package InnoSetup.ScriptBuilder
Package Manager
Install-Package InnoSetup.ScriptBuilder
Examples
Creating a Builder
To generate a script that looks like this:
[Setup]
AppName=BimTools.Support
AppVersion=1.2.5.1634640046
DefaultDirName={userappdata}\SupportTools
UninstallDisplayIcon=ToolsIcon.ico
DisableDirPage=yes
PrivilegesRequired=lowest
OutputBaseFilename=Tools.Support_2021_1.2.5.1634640046
SetupIconFile=ToolsIcon.ico
SetupArchitecture=x64
WizardImageBackColor=none
WizardStyle=modern dynamic
[Files]
Source: "bin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "SupportTools.addin"; DestDir: "{userappdata}\Autodesk\Revit\Addins\2019";
Source: "bin\Fonts\GraphikLCG-Medium.ttf"; DestDir: "{autofonts}"; FontInstall: "Graphik LCG"; Flags: onlyifdestfileexists uninsneveruninstall;
Source: "bin\Fonts\GraphikLCG-Regular.ttf"; DestDir: "{autofonts}"; FontInstall: "Graphik LCG"; Flags: onlyifdestfileexists uninsneveruninstall;
Inherit your builder class from the IssBuilder base class:
public class DemoBuilder : IssBuilder
{
public DemoBuilder()
{
Setup.Create("BimTools.Support")
.AppVersion("1.2.5.1634640046")
.DefaultDirName(@"{userappdata}\SupportTools")
.PrivilegesRequired(PrivilegesRequired.Lowest)
.OutputBaseFilename("Tools.Support_2021_1.2.5.1634640046")
.SetupIconFile("ToolsIcon.ico")
.UninstallDisplayIcon("ToolsIcon.ico")
.SetupArchitecture(SetupArchitecture.X64)
.WizardStyle(WizardStyle.Modern | WizardStyle.Dynamic)
.WizardImageBackColor(IssColor.None)
.DisableDirPage(YesNo.Yes);
Files.CreateEntry(source: @"bin\*", destDir: InnoConstants.Directories.App)
.Flags(FileFlags.IgnoreVersion | FileFlags.RecurseSubdirs);
Files.CreateEntry(source: "SupportTools.addin", destDir: @"{userappdata}\Autodesk\Revit\Addins\2019");
Files.CreateEntry(source: @"bin\Fonts\GraphikLCG-Medium.ttf", destDir: InnoConstants.Auto.Fonts)
.FontInstall("Graphik LCG")
.Flags(FileFlags.OnlyIfDestFileExists | FileFlags.UninsNeverUninstall);
Files.CreateEntry(source: @"bin\Fonts\GraphikLCG-Regular.ttf", destDir: InnoConstants.Auto.Fonts)
.FontInstall("Graphik LCG")
.Flags(FileFlags.OnlyIfDestFileExists | FileFlags.UninsNeverUninstall);
}
}
or use BuilderUtils.CreateBuilder():
var builder = BuilderUtils.CreateBuilder(builder =>
{
builder.Setup.Create("BimTools.Support")
.AppVersion("1.2.5.1634640046")
.DefaultDirName(@"{userappdata}\SupportTools")
.PrivilegesRequired(PrivilegesRequired.Lowest)
.OutputBaseFilename("Tools.Support_2021_1.2.5.1634640046")
.SetupIconFile("ToolsIcon.ico")
.UninstallDisplayIcon("ToolsIcon.ico")
.SetupArchitecture(SetupArchitecture.X64)
.WizardStyle(WizardStyle.Modern | WizardStyle.Dynamic)
.WizardImageBackColor(IssColor.None)
.DisableDirPage(YesNo.Yes);
builder.Files.CreateEntry(source: @"bin\*", destDir: InnoConstants.Directories.App)
.Flags(FileFlags.IgnoreVersion | FileFlags.RecurseSubdirs);
builder.Files.CreateEntry(source: "SupportTools.addin", destDir: @"{userappdata}\Autodesk\Revit\Addins\2019");
builder.Files.CreateEntry(source: @"bin\Fonts\GraphikLCG-Medium.ttf", destDir: InnoConstants.Auto.Fonts)
.FontInstall("Graphik LCG")
.Flags(FileFlags.OnlyIfDestFileExists | FileFlags.UninsNeverUninstall);
builder.Files.CreateEntry(source: @"bin\Fonts\GraphikLCG-Regular.ttf", destDir: InnoConstants.Auto.Fonts)
.FontInstall("Graphik LCG")
.Flags(FileFlags.OnlyIfDestFileExists | FileFlags.UninsNeverUninstall);
});
Getting Results
String Result
var builder = new DemoBuilder();
var result = builder.ToString();
Script File
var builder = new DemoBuilder();
builder.Build("demo.iss");
// or
BuilderUtils.Build<DemoBuilder>("demo.iss");
// or
BuilderUtils.Build(
builder =>
{
builder.Setup.Create("BimTools.Support")
.AppVersion("1.2.5.1634640046")
.DefaultDirName(@"{userappdata}\SupportTools");
builder.Files.CreateEntry(@"bin\*", InnoConstants.Directories.App)
.Flags(FileFlags.IgnoreVersion | FileFlags.RecurseSubdirs);
},
"demo.iss");
Directives
You can insert preprocessor directives at the beginning of your script using the Directives section:
Directives
.Define("MyAppName", "My Program")
.Include(@"c:\dir\file.iss")
.Include("<file.iss>")
.FreeText(";comments")
.Undef("var1");
The FreeText() method allows you to insert any text into the script as is.
Custom Sections and Parameters
If a section you want to insert is not implemented out of the box, you can use either the
Sections.CreateKeyValueSection() or Sections.CreateParameterSection() methods.
To insert unsupported parameters or directives into any type of section, use the Parameter() method:
// For key-value sections
Sections.CreateKeyValueSection("Messages")
.CreateEntry()
.Parameter("BeveledLabel", @"Inno Setup")
.Parameter("HelpTextNote", @"/PORTABLE=1%nEnable portable mode.");
// For parameter sections
Sections.CreateParameterSection("Registry")
.CreateEntry()
.Parameter("Root", RegistryKeys.HKU)
.Parameter("Subkey", @"Software\My Company\My Program")
.Parameter("ValueName", "Name")
.Parameter("ValueType", ValueTypes.String)
.Parameter("ValueData", "Test app");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on InnoSetup.ScriptBuilder:
| Package | Downloads |
|---|---|
|
RxBim.Nuke
RxBim nuke plugin for building MSI |
|
|
ricaun.Nuke.PackageBuilder
Nuke PackageBuilder for Autodesk Application. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.0-rc01 | 85 | 11/17/2026 |
| 6.3.0 | 12,213 | 10/22/2024 |
| 1.3.1 | 13,147 | 9/22/2023 |
| 1.3.0 | 16,884 | 3/20/2023 |
| 1.3.0-rc02 | 316 | 3/17/2023 |
| 1.3.0-rc01 | 937 | 3/15/2023 |
| 1.3.0-dev05 | 327 | 3/15/2023 |
| 1.3.0-dev04 | 472 | 3/15/2023 |
| 1.3.0-dev03 | 442 | 7/28/2022 |
| 1.3.0-dev02 | 391 | 7/28/2022 |
| 1.3.0-dev01 | 398 | 7/27/2022 |
| 1.2.2 | 6,640 | 5/5/2022 |
| 1.2.1 | 2,996 | 3/21/2022 |
| 1.2.0 | 1,698 | 3/2/2022 |
| 1.1.0 | 2,178 | 2/5/2022 |
| 1.1.0-dev01 | 436 | 2/4/2022 |
| 1.0.1 | 1,473 | 1/28/2022 |
| 1.0.0 | 3,316 | 12/3/2021 |
| 0.1.4 | 572 | 11/29/2021 |
| 0.1.4-rc02 | 461 | 11/29/2021 |
Upgraded to Inno Setup 7.1.1