-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fake 5 InnoSetup Module #1890
Merged
Merged
Fake 5 InnoSetup Module #1890
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Auto-Generated by FAKE; do not edit | ||
namespace System | ||
open System.Reflection | ||
|
||
[<assembly: AssemblyTitleAttribute("FAKE - F# Make Creating installers with InnoSetup")>] | ||
[<assembly: AssemblyProductAttribute("FAKE - F# Make")>] | ||
[<assembly: AssemblyVersionAttribute("5.0.0")>] | ||
[<assembly: AssemblyInformationalVersionAttribute("5.0.0-rc007")>] | ||
[<assembly: AssemblyFileVersionAttribute("5.0.0")>] | ||
do () | ||
|
||
module internal AssemblyVersionInformation = | ||
let [<Literal>] AssemblyTitle = "FAKE - F# Make Creating installers with InnoSetup" | ||
let [<Literal>] AssemblyProduct = "FAKE - F# Make" | ||
let [<Literal>] AssemblyVersion = "5.0.0" | ||
let [<Literal>] AssemblyInformationalVersion = "5.0.0-rc007" | ||
let [<Literal>] AssemblyFileVersion = "5.0.0" |
22 changes: 22 additions & 0 deletions
22
src/app/Fake.Installer.InnoSetup/Fake.Installer.InnoSetup.fsproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" | ||
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net46;netstandard1.6;netstandard2.0</TargetFrameworks> | ||
<AssemblyName>Fake.Installer.InnoSetup</AssemblyName> | ||
<OutputType>Library</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="AssemblyInfo.fs" /> | ||
<Compile Include="InnoSetup.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Fake.Core.Process\Fake.Core.Process.fsproj" /> | ||
<ProjectReference Include="..\Fake.Core.String\Fake.Core.String.fsproj" /> | ||
<ProjectReference Include="..\Fake.Core.Trace\Fake.Core.Trace.fsproj" /> | ||
<ProjectReference Include="..\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj" /> | ||
</ItemGroup> | ||
<Import Project="..\..\..\.paket\Paket.Restore.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
|
||
/// This module contains helper functions to create [Inno Setup](http://www.jrsoftware.org/isinfo.php) installers. | ||
[<RequireQualifiedAccess>] | ||
module Fake.Installer.InnoSetup | ||
|
||
open System | ||
open System.IO | ||
open Fake.Core | ||
open Fake.IO | ||
open Fake.IO.Globbing | ||
open Fake.IO.FileSystemOperators | ||
open System.Text | ||
|
||
let private toolPath = | ||
let innoExe = "ISCC.exe" | ||
let toolPath = Tools.findToolInSubPath innoExe (Directory.GetCurrentDirectory() @@ "tools" @@ "Tools.InnoSetup" @@ "tools") | ||
if File.exists toolPath then toolPath | ||
else | ||
match Process.tryFindFileOnPath innoExe with | ||
| Some inno when File.exists inno -> inno | ||
| _ -> toolPath | ||
|
||
let private timeout = TimeSpan.FromMinutes 5. | ||
|
||
/// Output verbosity | ||
type QuietMode = | ||
| Default /// Default output when compiling | ||
| Quiet /// Quiet compile (print error messages only) | ||
| QuietAndProgress /// Enable quiet compile while still displaying progress | ||
|
||
/// InnoSetup build parameters | ||
type InnoSetupParams = | ||
{ | ||
/// The tool path - FAKE tries to find ISCC.exe automatically in any sub folder. | ||
ToolPath : string | ||
|
||
/// Specify the process working directory | ||
WorkingDirectory : string | ||
|
||
/// Specify a timeout for ISCC. Default: 5 min. | ||
Timeout : TimeSpan | ||
|
||
/// Enable or disable output (overrides Output) | ||
EnableOutput : bool option | ||
|
||
/// Output files to specified path (overrides OutputDir) | ||
OutputFolder : string | ||
|
||
/// Overrides OutputBaseFilename with the specified filename | ||
OutputBaseFilename : string | ||
|
||
/// Specifies output mode when compiling | ||
QuietMode : QuietMode | ||
|
||
/// Emulate #define public <name> <value> | ||
Defines : Map<string,string> | ||
|
||
/// Additional parameters | ||
AdditionalParameters : string option | ||
|
||
/// Path to inno-script file | ||
ScriptFile : string | ||
} | ||
|
||
/// InnoSetup default parameters | ||
static member Create()= | ||
{ | ||
ToolPath = toolPath | ||
WorkingDirectory = "" | ||
Timeout = timeout | ||
ScriptFile = "innosetup.iss" | ||
EnableOutput = None | ||
OutputFolder = "" | ||
OutputBaseFilename = "" | ||
QuietMode = Default | ||
Defines = Map.empty | ||
AdditionalParameters = None | ||
} | ||
|
||
let private run toolPath workingDirectory timeout command = | ||
use __ = Trace.traceTask "InnoSetup" command | ||
if 0 <> Process.execSimple ((fun info -> | ||
{ info with | ||
FileName = toolPath | ||
WorkingDirectory = workingDirectory | ||
Arguments = command })) timeout | ||
then failwithf "InnoSetup command %s failed." command | ||
|
||
let private serializeInnoSetupParams p = | ||
let appendDefine (key,value) _ sb = | ||
if String.isNullOrEmpty value then | ||
StringBuilder.append (sprintf "/D%s" key) sb | ||
else | ||
StringBuilder.append (sprintf "/D%s=%s" key value) sb | ||
|
||
StringBuilder() | ||
|> StringBuilder.appendIfSome p.AdditionalParameters id | ||
|> StringBuilder.appendIfSome p.EnableOutput (fun enableOutput -> if enableOutput then "/O+" else "/O-") | ||
|> StringBuilder.appendIfNotNullOrEmpty p.OutputFolder "/O" | ||
|> StringBuilder.appendIfNotNullOrEmpty p.OutputBaseFilename "/F" | ||
|> StringBuilder.appendWithoutQuotes | ||
(match p.QuietMode with | ||
| Quiet -> "/Q" | ||
| QuietAndProgress -> "/Qp" | ||
|_ -> "") | ||
|> StringBuilder.forEach (p.Defines |> Map.toList) appendDefine "" | ||
|> StringBuilder.append p.ScriptFile | ||
|> StringBuilder.toText | ||
|
||
/// Builds the InnoSetup installer. | ||
/// ## Parameters | ||
/// - `setParams` - Function used to manipulate the default build parameters. See `InnoSetupParams.Create()` | ||
/// ## Sample | ||
/// | ||
/// InnoSetup.build (fun p -> | ||
/// { p with | ||
/// OutputFolder = "build" @@ "installer" | ||
/// ScriptFile = "installer" @@ "setup.iss" | ||
/// }) | ||
let build setParams = | ||
let p = InnoSetupParams.Create() |> setParams | ||
p | ||
|> serializeInnoSetupParams | ||
|> run p.ToolPath p.WorkingDirectory p.Timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
group netcore | ||
|
||
FSharp.Core | ||
NETStandard.Library |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will afaik be a dead link, but yeah