Skip to content

Commit

Permalink
Merge branch 'release/0.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
max-eroshkin committed Nov 29, 2021
2 parents d9c8f41 + 4af98ca commit 11cf31c
Show file tree
Hide file tree
Showing 17 changed files with 608 additions and 164 deletions.
5 changes: 5 additions & 0 deletions InnoSetup.ScriptBuilder.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,17 @@
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/EditorConfig/EnableStyleCopSupport/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/EditorConfig/ShowEditorConfigStatusBarIndicator/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ASLR/@EntryIndexedValue">ASLR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DCS/@EntryIndexedValue">DCS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DEP/@EntryIndexedValue">DEP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LZMA/@EntryIndexedValue">LZMA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OS/@EntryIndexedValue">OS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PSDCS/@EntryIndexedValue">PSDCS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PT/@EntryIndexedValue">PT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UCS/@EntryIndexedValue">UCS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UNC/@EntryIndexedValue">UNC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UTC/@EntryIndexedValue">UTC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WCS/@EntryIndexedValue">WCS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand Down
19 changes: 19 additions & 0 deletions source/BuilderTests/CodeTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace BuilderTests
{
using FluentAssertions;
using InnoSetup.ScriptBuilder;
using Xunit;

public class CodeTests
{
[Fact]
public void Test()
{
var iss = BuilderUtils.CreateBuilder(builder => builder.Code
.CreateEntry("code1")
.CreateEntry("code2"))
.ToString();
iss.Should().Be("\r\n[Code]\r\ncode1\r\ncode2\r\n");
}
}
}
26 changes: 26 additions & 0 deletions source/InnoSetup.ScriptBuilder/Builder/CodeBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace InnoSetup.ScriptBuilder
{
using System.IO;
using System.Text;

public class CodeBuilder : IBuilder
{
private readonly StringBuilder _data = new();

public string SectionName => "Code";

public CodeBuilder CreateEntry(string script)
{
_data.AppendLine(script);
return this;
}

public void Write(TextWriter writer)
{
if (_data.Length == 0)
return;
writer.WriteLine($"\r\n[{SectionName}]");
writer.Write(_data);
}
}
}
4 changes: 4 additions & 0 deletions source/InnoSetup.ScriptBuilder/Builder/IssBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public abstract class IssBuilder : IBuilder
private readonly RunBuilder _run = new("Run");
private readonly IconsBuilder _icons = new();
private readonly RunBuilder _uninstallRun = new("UninstallRun");
private readonly CodeBuilder _code = new();

public ISetupBuilder Setup => _setup;

Expand All @@ -36,6 +37,8 @@ public abstract class IssBuilder : IBuilder

public IRunBuilder UninstallRun => _uninstallRun;

public CodeBuilder Code => _code;

/* Sections to implement
Tasks
Ini
Expand Down Expand Up @@ -63,6 +66,7 @@ public void Write(TextWriter writer)
_run.Write(writer);
_uninstallRun.Write(writer);
Sections.Write(writer);
_code.Write(writer);
}

public override string ToString()
Expand Down
210 changes: 207 additions & 3 deletions source/InnoSetup.ScriptBuilder/Builder/SetupBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public SetupBuilder Create(string appName)
public SetupBuilder AppComments(string value) => SetPropertyValue(value);
public SetupBuilder AppModifyPath(string value) => SetPropertyValue(value);
public SetupBuilder CreateUninstallRegKey(string value) => SetPropertyValue(value);
public SetupBuilder Uninstallable(string value) => SetPropertyValue(value);
public SetupBuilder Uninstallable(YesNo value) => SetPropertyValue(value);
public SetupBuilder CloseApplicationsFilter(string value) => SetPropertyValue(value);
public SetupBuilder SetupMutex(string value) => SetPropertyValue(value);
public SetupBuilder ChangesEnvironment(string value) => SetPropertyValue(value);
public SetupBuilder ChangesAssociations(string value) => SetPropertyValue(value);
public SetupBuilder ChangesEnvironment(YesNo value) => SetPropertyValue(value);
public SetupBuilder ChangesAssociations(YesNo value) => SetPropertyValue(value);
public SetupBuilder InfoBeforeText(string value) => SetPropertyValue(value);
public SetupBuilder LicenseText(string value) => SetPropertyValue(value);
public SetupBuilder LicenseFile(string value) => SetPropertyValue(value);
Expand Down Expand Up @@ -87,6 +87,210 @@ public SetupBuilder PrivilegesRequiredOverridesAllowed(SetupPrivilegesRequiredOv
public SetupBuilder SetupIconFile(string value) => SetPropertyValue(value);
public SetupBuilder WizardImageFile(string value) => SetPropertyValue(value);
public SetupBuilder WizardSmallImageFile(string value) => SetPropertyValue(value);

public SetupBuilder AllowCancelDuringInstall(YesNo value) => SetPropertyValue(value);

public SetupBuilder AllowNetworkDrive(YesNo value) => SetPropertyValue(value);

public SetupBuilder AllowNoIcons(YesNo value) => SetPropertyValue(value);

public SetupBuilder AllowRootDirectory(YesNo value) => SetPropertyValue(value);

public SetupBuilder AllowUNCPath(YesNo value) => SetPropertyValue(value);

public SetupBuilder AlwaysRestart(YesNo value) => SetPropertyValue(value);

public SetupBuilder AlwaysShowComponentsList(YesNo value) => SetPropertyValue(value);

public SetupBuilder AlwaysShowDirOnReadyPage(YesNo value) => SetPropertyValue(value);

public SetupBuilder AlwaysShowGroupOnReadyPage(YesNo value) => SetPropertyValue(value);

public SetupBuilder AlwaysUsePersonalGroup(YesNo value) => SetPropertyValue(value);

public SetupBuilder AppendDefaultDirName(YesNo value) => SetPropertyValue(value);

public SetupBuilder AppendDefaultGroupName(YesNo value) => SetPropertyValue(value);

public SetupBuilder ArchitecturesAllowed(Architectures value) => SetPropertyValue(value);

public SetupBuilder ArchitecturesInstallIn64BitMode(ArchitecturesInstallIn64BitMode value) => SetPropertyValue(value);

public SetupBuilder ASLRCompatible(YesNo value) => SetPropertyValue(value);

public SetupBuilder BackColorDirection(BackColorDirection value) => SetPropertyValue(value);

public SetupBuilder BackSolid(YesNo value) => SetPropertyValue(value);

public SetupBuilder CloseApplications(CloseApplications value) => SetPropertyValue(value);

public SetupBuilder Compression(string value) => SetPropertyValue(value);

public SetupBuilder CompressionThreads(uint value) => SetPropertyValue(value);

public SetupBuilder CreateAppDir(YesNo value) => SetPropertyValue(value);

public SetupBuilder DefaultDialogFontName(string value) => SetPropertyValue(value);

public SetupBuilder DEPCompatible(YesNo value) => SetPropertyValue(value);

public SetupBuilder DisableFinishedPage(YesNo value) => SetPropertyValue(value);

public SetupBuilder DisableReadyMemo(YesNo value) => SetPropertyValue(value);

public SetupBuilder DisableReadyPage(YesNo value) => SetPropertyValue(value);

public SetupBuilder DisableStartupPrompt(YesNo value) => SetPropertyValue(value);

public SetupBuilder DiskClusterSize(uint value) => SetPropertyValue(value);

public SetupBuilder DiskSliceSize(uint value) => SetPropertyValue(value);

public SetupBuilder DiskSpanning(YesNo value) => SetPropertyValue(value);

public SetupBuilder EnableDirDoesntExistWarning(YesNo value) => SetPropertyValue(value);

public SetupBuilder Encryption(YesNo value) => SetPropertyValue(value);

public SetupBuilder FlatComponentsList(YesNo value) => SetPropertyValue(value);

public SetupBuilder InfoAfterFile(string value) => SetPropertyValue(value);

public SetupBuilder InfoBeforeFile(string value) => SetPropertyValue(value);

public SetupBuilder InternalCompressLevel(string value) => SetPropertyValue(value);

public SetupBuilder LanguageDetectionMethod(LanguageDetectionMethod value) => SetPropertyValue(value);

public SetupBuilder LZMAAlgorithm(uint value) => SetPropertyValue(value);

public SetupBuilder LZMABlockSize(uint value) => SetPropertyValue(value);

public SetupBuilder LZMADictionarySize(uint value) => SetPropertyValue(value);

public SetupBuilder LZMAMatchFinder(LzmaMatchFinder value) => SetPropertyValue(value);

public SetupBuilder LZMANumBlockThreads(uint value) => SetPropertyValue(value);

public SetupBuilder LZMANumFastBytes(uint value) => SetPropertyValue(value);

public SetupBuilder LZMAUseSeparateProcess(YesNo value) => SetPropertyValue(value);

public SetupBuilder MergeDuplicateFiles(YesNo value) => SetPropertyValue(value);

public SetupBuilder MinVersion(string value) => SetPropertyValue(value);

public SetupBuilder MissingMessagesWarning(YesNo value) => SetPropertyValue(value);

public SetupBuilder MissingRunOnceIdsWarning(YesNo value) => SetPropertyValue(value);

public SetupBuilder NotRecognizedMessagesWarning(YesNo value) => SetPropertyValue(value);

public SetupBuilder OnlyBelowVersion(string value) => SetPropertyValue(value);

public SetupBuilder Output(YesNo value) => SetPropertyValue(value);

public SetupBuilder Password(string value) => SetPropertyValue(value);

public SetupBuilder ReserveBytes(uint value) => SetPropertyValue(value);

public SetupBuilder RestartApplications(YesNo value) => SetPropertyValue(value);

public SetupBuilder RestartIfNeededByRun(YesNo value) => SetPropertyValue(value);

public SetupBuilder SetupLogging(YesNo value) => SetPropertyValue(value);

public SetupBuilder ShowComponentSizes(YesNo value) => SetPropertyValue(value);

public SetupBuilder ShowTasksTreeLines(YesNo value) => SetPropertyValue(value);

public SetupBuilder ShowUndisplayableLanguages(YesNo value) => SetPropertyValue(value);

public SetupBuilder SignedUninstaller(YesNo value) => SetPropertyValue(value);

public SetupBuilder SignedUninstallerDir(string value) => SetPropertyValue(value);

public SetupBuilder SignTool(string value) => SetPropertyValue(value);

public SetupBuilder SignToolMinimumTimeBetween(uint value) => SetPropertyValue(value);

public SetupBuilder SignToolRetryCount(uint value) => SetPropertyValue(value);

public SetupBuilder SignToolRetryDelay(uint value) => SetPropertyValue(value);

public SetupBuilder SignToolRunMinimized(YesNo value) => SetPropertyValue(value);

public SetupBuilder SolidCompression(YesNo value) => SetPropertyValue(value);

public SetupBuilder SourceDir(string value) => SetPropertyValue(value);

public SetupBuilder TerminalServicesAware(YesNo value) => SetPropertyValue(value);

public SetupBuilder TimeStampRounding(uint value) => SetPropertyValue(value);

public SetupBuilder TimeStampsInUTC(YesNo value) => SetPropertyValue(value);

public SetupBuilder TouchDate(string value) => SetPropertyValue(value);

public SetupBuilder TouchTime(string value) => SetPropertyValue(value);

public SetupBuilder UpdateUninstallLogAppName(YesNo value) => SetPropertyValue(value);

public SetupBuilder UninstallRestartComputer(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsedUserAreasWarning(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousAppDir(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousGroup(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousLanguage(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousPrivileges(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousSetupType(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousTasks(YesNo value) => SetPropertyValue(value);

public SetupBuilder UsePreviousUserInfo(YesNo value) => SetPropertyValue(value);

public SetupBuilder UseSetupLdr(YesNo value) => SetPropertyValue(value);

public SetupBuilder UserInfoPage(YesNo value) => SetPropertyValue(value);

public SetupBuilder VersionInfoCompany(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoCopyright(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoDescription(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoOriginalFileName(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoProductName(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoProductVersion(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoProductTextVersion(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoTextVersion(string value) => SetPropertyValue(value);

public SetupBuilder VersionInfoVersion(string value) => SetPropertyValue(value);

public SetupBuilder WindowResizable(YesNo value) => SetPropertyValue(value);

public SetupBuilder WindowShowCaption(YesNo value) => SetPropertyValue(value);

public SetupBuilder WindowStartMaximized(YesNo value) => SetPropertyValue(value);

public SetupBuilder WindowVisible(YesNo value) => SetPropertyValue(value);

public SetupBuilder WizardImageStretch(YesNo value) => SetPropertyValue(value);

public SetupBuilder WizardResizable(YesNo value) => SetPropertyValue(value);

public SetupBuilder WizardSizePercent(string value) => SetPropertyValue(value);

public SetupBuilder WizardStyle(WizardStyle value) => SetPropertyValue(value);

private SetupBuilder AppName(string value) => SetPropertyValue(value);
}
Expand Down
2 changes: 1 addition & 1 deletion source/InnoSetup.ScriptBuilder/Directory.Build.Props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.1.3</Version>
<Version>0.1.4</Version>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
Expand Down
26 changes: 25 additions & 1 deletion source/InnoSetup.ScriptBuilder/Model/IconsSection/IconEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@ public class IconEntry : CommonParameterSectionEntryBase, IHazComponentsAndTasks
* = 1 << 11
* = 1 << 12
* = 1 << 13
* = 1 << 14
* = 1 << 15
* = 1 << 16
* = 1 << 17
* = 1 << 18
* = 1 << 19
* = 1 << 20
* = 1 << 21
* = 1 << 22
* = 1 << 23
* = 1 << 24
* = 1 << 25
* = 1 << 26
* = 1 << 27
* = 1 << 28
* = 1 << 29
* = 1 << 30
* = 1 << 31
* = 1 << 32
* = 1 << 33
* = 1 << 34
* = 1 << 35
* = 1 << 36
* = 1 << 37
* = 1 << 38
* = 1 << 39
*/
}
13 changes: 13 additions & 0 deletions source/InnoSetup.ScriptBuilder/Model/SetupSection/Architectures.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace InnoSetup.ScriptBuilder.Model.SetupSection
{
using System;

[Flags]
public enum Architectures
{
X86 = 1,
X64 = 1 << 1,
Arm64 = 1 << 2,
Ia64 = 1 << 3,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace InnoSetup.ScriptBuilder.Model.SetupSection
{
using System;

[Flags]
public enum ArchitecturesInstallIn64BitMode
{
X64 = 1 << 1,
Arm64 = 1 << 2,
Ia64 = 1 << 3,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace InnoSetup.ScriptBuilder.Model.SetupSection
{
public enum BackColorDirection
{
TopToBottom,
LeftToRight
}
}
Loading

0 comments on commit 11cf31c

Please sign in to comment.