merged from work
196
.editorconfig
Normal file
@ -0,0 +1,196 @@
|
||||
# Remove the line below if you want to inherit .editorconfig settings from higher directories
|
||||
root = true
|
||||
|
||||
# C# files
|
||||
[*.cs]
|
||||
|
||||
#### Core EditorConfig Options ####
|
||||
|
||||
# Indentation and spacing
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
tab_width = 4
|
||||
|
||||
# New line preferences
|
||||
end_of_line = crlf
|
||||
insert_final_newline = false
|
||||
|
||||
#### .NET Coding Conventions ####
|
||||
|
||||
# Organize usings
|
||||
dotnet_separate_import_directive_groups = false
|
||||
dotnet_sort_system_directives_first = false
|
||||
|
||||
# this. and Me. preferences
|
||||
dotnet_style_qualification_for_event = false:suggestion
|
||||
dotnet_style_qualification_for_field = false:silent
|
||||
dotnet_style_qualification_for_method = false:suggestion
|
||||
dotnet_style_qualification_for_property = false:suggestion
|
||||
|
||||
# Language keywords vs BCL types preferences
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
|
||||
dotnet_style_predefined_type_for_member_access = true:warning
|
||||
|
||||
# Parentheses preferences
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
|
||||
dotnet_style_parentheses_in_other_operators = always_for_clarity:suggestion
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
|
||||
|
||||
# Modifier preferences
|
||||
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
|
||||
|
||||
# Expression-level preferences
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_style_inlined_variable_declaration = true:suggestion
|
||||
csharp_style_throw_expression = true:suggestion
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_prefer_auto_properties = true:suggestion
|
||||
dotnet_style_prefer_compound_assignment = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||
|
||||
# Field preferences
|
||||
dotnet_style_readonly_field = true:suggestion
|
||||
|
||||
# Parameter preferences
|
||||
dotnet_code_quality_unused_parameters = all:suggestion
|
||||
|
||||
#### C# Coding Conventions ####
|
||||
|
||||
# var preferences
|
||||
csharp_style_var_elsewhere = true:suggestion
|
||||
csharp_style_var_for_built_in_types = true:suggestion
|
||||
csharp_style_var_when_type_is_apparent = true:suggestion
|
||||
|
||||
# Expression-bodied members
|
||||
csharp_style_expression_bodied_accessors = true:silent
|
||||
csharp_style_expression_bodied_constructors = false:silent
|
||||
csharp_style_expression_bodied_indexers = true:silent
|
||||
csharp_style_expression_bodied_lambdas = true:silent
|
||||
csharp_style_expression_bodied_local_functions = false:silent
|
||||
csharp_style_expression_bodied_methods = true:silent
|
||||
csharp_style_expression_bodied_operators = when_on_single_line:silent
|
||||
csharp_style_expression_bodied_properties = true:silent
|
||||
|
||||
# Pattern matching preferences
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
||||
|
||||
# Null-checking preferences
|
||||
csharp_style_conditional_delegate_call = true:suggestion
|
||||
|
||||
# Modifier preferences
|
||||
csharp_prefer_static_local_function = true:suggestion
|
||||
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
|
||||
|
||||
# Code-block preferences
|
||||
csharp_prefer_braces = true:silent
|
||||
csharp_prefer_simple_using_statement = false:suggestion
|
||||
|
||||
# Expression-level preferences
|
||||
csharp_prefer_simple_default_expression = true:suggestion
|
||||
csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
||||
csharp_style_prefer_index_operator = true:suggestion
|
||||
csharp_style_prefer_range_operator = true:suggestion
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||
|
||||
# 'using' directive preferences
|
||||
csharp_using_directive_placement = outside_namespace:warning
|
||||
|
||||
#### C# Formatting Rules ####
|
||||
|
||||
# New line preferences
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
|
||||
# Indentation preferences
|
||||
csharp_indent_block_contents = true
|
||||
csharp_indent_braces = false
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_case_contents_when_block = true
|
||||
csharp_indent_labels = no_change
|
||||
csharp_indent_switch_labels = true
|
||||
|
||||
# Space preferences
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_after_comma = true
|
||||
csharp_space_after_dot = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = true
|
||||
csharp_space_after_semicolon_in_for_statement = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_around_declaration_statements = false
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_before_comma = false
|
||||
csharp_space_before_dot = false
|
||||
csharp_space_before_open_square_brackets = false
|
||||
csharp_space_before_semicolon_in_for_statement = false
|
||||
csharp_space_between_empty_square_brackets = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = false
|
||||
csharp_space_between_square_brackets = false
|
||||
|
||||
# Wrapping preferences
|
||||
csharp_preserve_single_line_blocks = true
|
||||
csharp_preserve_single_line_statements = true
|
||||
|
||||
#### Naming styles ####
|
||||
|
||||
# Naming rules
|
||||
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||
|
||||
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||
|
||||
# Symbol specifications
|
||||
|
||||
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal
|
||||
dotnet_naming_symbols.interface.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal
|
||||
dotnet_naming_symbols.types.required_modifiers =
|
||||
|
||||
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal
|
||||
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||
|
||||
# Naming styles
|
||||
|
||||
dotnet_naming_style.pascal_case.required_prefix =
|
||||
dotnet_naming_style.pascal_case.required_suffix =
|
||||
dotnet_naming_style.pascal_case.word_separator =
|
||||
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||
|
||||
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||
dotnet_naming_style.begins_with_i.required_suffix =
|
||||
dotnet_naming_style.begins_with_i.word_separator =
|
||||
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
5
.gitignore
vendored
@ -111,3 +111,8 @@ UpgradeLog*.XML
|
||||
.vs
|
||||
*.DotSettings
|
||||
/Creator/SetupTmpl.cs
|
||||
nsis/*
|
||||
/Creator/SetupTemplate1.cs
|
||||
/KattekerCreator/contrib/AppStub.exe
|
||||
/KattekerCreator/contrib/AppStub.exe.config
|
||||
/.idea
|
||||
|
27
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/KattekerCreator/bin/Debug/netcoreapp3.0/KattekerCreator.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/KattekerCreator",
|
||||
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
36
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/KattekerCreator/KattekerCreator.csproj"
|
||||
],
|
||||
"problemMatcher": "$tsc"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/KattekerCreator/KattekerCreator.csproj"
|
||||
],
|
||||
"problemMatcher": "$tsc"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/KattekerCreator/KattekerCreator.csproj"
|
||||
],
|
||||
"problemMatcher": "$tsc"
|
||||
}
|
||||
]
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>AppStub</RootNamespace>
|
||||
<AssemblyName>AppStub</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
@ -19,7 +19,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<OutputPath>..\KattekerCreator\contrib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@ -29,7 +29,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<OutputPath>..\KattekerCreator\contrib\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
@ -60,7 +60,7 @@ namespace AppStub
|
||||
|
||||
private static void DeleteOldVersionDirectories(IEnumerable<KeyValuePair<SemVersion, FileInfo>> dirEntries)
|
||||
{
|
||||
#if !DEBUG
|
||||
if (Debugger.IsAttached) return;
|
||||
foreach (var directoryInfo in dirEntries)
|
||||
{
|
||||
try
|
||||
@ -72,7 +72,6 @@ namespace AppStub
|
||||
// silently ignore
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NuGet.Frameworks" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.4" newVersion="4.5.0.4" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NuGet.Versioning" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.4" newVersion="4.5.0.4" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NuGet.Packaging" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.4" newVersion="4.5.0.4" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace KattekerCreator.Helper
|
||||
{
|
||||
public class TemporaryDirectory : IDisposable
|
||||
{
|
||||
public string Path { get; }
|
||||
|
||||
public TemporaryDirectory(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
System.IO.Directory.Delete(Path, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
//ignore.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{53D065EB-8818-4F60-9EBE-75705E1BB00D}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>KattekerCreator</RootNamespace>
|
||||
<AssemblyName>KattekerCreator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="McMaster.Extensions.CommandLineUtils, Version=2.2.5.0, Culture=neutral, PublicKeyToken=6f71cb76b82f055d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\McMaster.Extensions.CommandLineUtils.2.2.5\lib\net45\McMaster.Extensions.CommandLineUtils.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ResourceLib, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Vestris.ResourceLib.2.0.0\lib\net45\ResourceLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyFileInfo.cs" />
|
||||
<Compile Include="Helper\Log.cs" />
|
||||
<Compile Include="Helper\TemporaryDirectory.cs" />
|
||||
<Compile Include="IconExtractor\IconExtractor.cs" />
|
||||
<Compile Include="IconExtractor\IconUtil.cs" />
|
||||
<Compile Include="IconExtractor\NativeMethods.cs" />
|
||||
<Compile Include="Helper\Minimatcher.cs" />
|
||||
<Compile Include="PathFragments.cs" />
|
||||
<Compile Include="PhysicalFile.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Program.Arguments.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Helper\Utils.cs" />
|
||||
<Compile Include="SetupTmpl.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>SetupTmpl.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SetupTmplCode.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="contrib\LoadingBar_Icon.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="contrib\uninstall.ico">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="SetupTmpl.tt">
|
||||
<Generator>TextTemplatingFilePreprocessor</Generator>
|
||||
<LastGenOutput>SetupTmpl.cs</LastGenOutput>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj">
|
||||
<Project>{a45e1c59-ba9e-452c-a5e2-50de49d53e92}</Project>
|
||||
<Name>Katteker</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@ -1,55 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using McMaster.Extensions.CommandLineUtils;
|
||||
|
||||
namespace KattekerCreator
|
||||
{
|
||||
[Command(Name = "KattekerCreator", Description = "Creates Installation and Update packages.")]
|
||||
[HelpOption("-?")]
|
||||
public partial class Program
|
||||
{
|
||||
private string _changeLog;
|
||||
private string _programFile;
|
||||
private string _outputDir;
|
||||
|
||||
[Argument(0, Description = "Path to the program file")]
|
||||
[FileExists]
|
||||
[Required]
|
||||
private string ProgramFile
|
||||
{
|
||||
get => _programFile;
|
||||
set => _programFile = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-L|--changelog", Description = "Path of the changelog file")]
|
||||
private string ChangeLog
|
||||
{
|
||||
get => _changeLog;
|
||||
set => _changeLog = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-C|--channel", Description = "Channel of releasing")]
|
||||
private string Channel { get; set; }
|
||||
|
||||
[Option("-O|--output", Description = "Directory for the output")]
|
||||
[Required]
|
||||
private string OutputDir
|
||||
{
|
||||
get => _outputDir;
|
||||
set => _outputDir = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-P|--publish", Description = "Path for output from the point of view of the application")]
|
||||
private string PublishDir { get; set; }
|
||||
|
||||
[Option("-V|--version", Description = "Override version number of the application")]
|
||||
private string Version { get; set; }
|
||||
|
||||
[Option("-F|--filter", Description = "Filter parameter. Use minimatch pattern.")]
|
||||
private string FilterAsString { get; set; }
|
||||
|
||||
private IEnumerable<string> Filter => string.IsNullOrWhiteSpace(FilterAsString) ? Enumerable.Empty<string>() : FilterAsString.Split(';');
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("KattekerCreator")]
|
||||
[assembly: AssemblyDescription("Creates Installation and Update packages.")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Holger Börchers")]
|
||||
[assembly: AssemblyProduct("KattekerCreator")]
|
||||
[assembly: AssemblyCopyright("Copyright © Holger Börchers")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("ef6af08f-1e5f-44c5-9be8-973b130f8086")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.1.0")]
|
||||
|
@ -1,103 +0,0 @@
|
||||
!define APPNAME "Shutdown8"
|
||||
!define EXECUTABLE "Shutdown8.exe"
|
||||
!define COMPANYNAME "Bandisoft.com"
|
||||
!define DESCRIPTION "NoDescription"
|
||||
!define VERSION 1.8.0
|
||||
!define HELPURL https://srv-lsimctrl01.enercon.de
|
||||
!define INSTALLSIZE 155573
|
||||
!define ISMANAGED 1
|
||||
; exampleCmd: makensis.exe /DVERSION=1.0.0.5 /DNAME=WpfApp1 Setup.nsi
|
||||
|
||||
Name "${APPNAME}"
|
||||
OutFile "${APPNAME}-${VERSION}.exe"
|
||||
InstallDir "$LOCALAPPDATA\${APPNAME}"
|
||||
RequestExecutionLevel user
|
||||
SetCompressor /SOLID lzma
|
||||
SilentUnInstall silent
|
||||
; Subcaption 3 " "
|
||||
XPStyle on
|
||||
AutoCloseWindow true
|
||||
ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"
|
||||
Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis3-install.ico"
|
||||
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis3-uninstall.ico"
|
||||
ShowInstDetails nevershow
|
||||
ShowUninstDetails nevershow
|
||||
BrandingText "${COMPANYNAME}"
|
||||
|
||||
;--------------------------------
|
||||
; The stuff to install
|
||||
Section "install" ;No components page, name is not important
|
||||
DetailPrint 'Installing ${APPNAME}. Please wait...'
|
||||
SetShellVarContext current
|
||||
SetDetailsPrint None
|
||||
SetOutPath $INSTDIR\app-${VERSION}
|
||||
; Put file there
|
||||
File /r /x *.pdb /x *.obj /x *.pch /x *.vshost.exe /x *.vshost.exe.* Release\*.*
|
||||
SetOutPath $INSTDIR
|
||||
File "/oname=${Executable}" AppStub.exe
|
||||
File Rabbit.Shared.dll
|
||||
WriteINIStr $INSTDIR\app.ini Main Executable "${EXECUTABLE}"
|
||||
WriteINIStr $INSTDIR\app.ini Main AppName "${APPNAME}"
|
||||
WriteINIStr $INSTDIR\app.ini Main IsManaged ${ISMANAGED}
|
||||
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
; Desktop
|
||||
CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${Executable}"
|
||||
|
||||
# Start Menu
|
||||
CreateDirectory "$SMPROGRAMS\${COMPANYNAME}"
|
||||
CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\${Executable}"
|
||||
|
||||
# Update pinned Taskbar
|
||||
IfFileExists "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\${APPNAME}.lnk" 0 +2
|
||||
CreateShortCut "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\${APPNAME}.lnk" "$INSTDIR\${Executable}"
|
||||
SetOutPath $INSTDIR\app-${VERSION}
|
||||
StrCpy $0 ${EXECUTABLE} -4
|
||||
IfFileExists "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\$0.lnk" 0 +2
|
||||
CreateShortCut "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\$0.lnk" "$INSTDIR\app-${VERSION}\${EXECUTABLE}"
|
||||
|
||||
# Registry information for add/remove programs
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "InstallLocation" "$\"$INSTDIR$\""
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$\"$INSTDIR\app-${VERSION}\${EXECUTABLE}$\""
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${COMPANYNAME}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "HelpLink" "${HELPURL}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}"
|
||||
# There is no option for modifying or repairing the install
|
||||
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" 1
|
||||
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" 1
|
||||
# Set the INSTALLSIZE constant (!defined at the top of this script) so Add/Remove Programs can accurately report the size
|
||||
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "EstimatedSize" ${INSTALLSIZE}
|
||||
SectionEnd ; end the section
|
||||
|
||||
Function .onInstSuccess
|
||||
IfSilent +2
|
||||
Exec '"$INSTDIR\${Executable}"'
|
||||
FunctionEnd
|
||||
|
||||
Section "uninstall"
|
||||
DetailPrint 'Please wait...'
|
||||
SetShellVarContext current
|
||||
SetDetailsPrint None
|
||||
SetAutoClose true
|
||||
|
||||
# Remove Start Menu launcher
|
||||
Delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk"
|
||||
Delete "$DESKTOP\${APPNAME}.lnk"
|
||||
StrCpy $0 ${EXECUTABLE} -4
|
||||
Delete "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\${APPNAME}.lnk"
|
||||
Delete "$APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\$0.lnk"
|
||||
# Try to remove the Start Menu folder - this will only happen if it is empty
|
||||
RMDir "$SMPROGRAMS\${COMPANYNAME}"
|
||||
|
||||
# Always delete uninstaller as the last action
|
||||
delete $INSTDIR\uninstall.exe
|
||||
|
||||
# Try to remove the install directory - this will only happen if it is empty
|
||||
RMDir /r /REBOOTOK $INSTDIR
|
||||
|
||||
# Remove uninstaller information from the registry
|
||||
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
|
||||
sectionEnd
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="McMaster.Extensions.CommandLineUtils" version="2.2.5" targetFramework="net462" />
|
||||
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net462" developmentDependency="true" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
<package id="Vestris.ResourceLib" version="2.0.0" targetFramework="net462" />
|
||||
</packages>
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>$id$</id>
|
||||
<version>$version$</version>
|
||||
<title>$id$</title>
|
||||
<authors>$author$</authors>
|
||||
<owners>$author$</owners>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>$description$</description>
|
||||
<copyright>$copyright$</copyright>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="bin\$configuration$\*.dll" target="lib\net45" />
|
||||
<file src="bin\$configuration$\*.config" target="lib\net45" exclude="bin\$configuration$\*.vshost.exe.config" />
|
||||
<file src="bin\$configuration$\*.exe" target="lib\net45" exclude="bin\$configuration$\*.vshost.exe" />
|
||||
<file src="..\packages\squirrel.windows.0.99.1.1\tools\Squirrel.exe" target="lib\net45" />
|
||||
</files>
|
||||
</package>
|
@ -29,6 +29,7 @@ using System;
|
||||
// ReSharper disable IntroduceOptionalParameters.Global
|
||||
// ReSharper disable MemberCanBeProtected.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable once CheckNamespace
|
||||
|
||||
namespace JetBrains.Annotations
|
||||
{
|
||||
|
@ -9,6 +9,14 @@
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.8.1.0" newVersion="4.8.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Prism" publicKeyToken="40ee6c3a2184dc59" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.1422" newVersion="7.2.0.1422" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Prism.Wpf" publicKeyToken="40ee6c3a2184dc59" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.2.0.1422" newVersion="7.2.0.1422" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@ -13,9 +13,6 @@ namespace Example
|
||||
//nothing
|
||||
}
|
||||
|
||||
protected override Window CreateShell()
|
||||
{
|
||||
return this.Container.Resolve<MainWindow>();
|
||||
}
|
||||
protected override Window CreateShell() => Container.Resolve<MainWindow>();
|
||||
}
|
||||
}
|
||||
|
@ -46,32 +46,40 @@
|
||||
<StartupObject>Example.App</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonServiceLocator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonServiceLocator.2.0.4\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||
<Reference Include="CommonServiceLocator, Version=2.0.5.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0">
|
||||
<HintPath>..\packages\CommonServiceLocator.2.0.5\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="DryIoc, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DryIoc.dll.3.0.2\lib\net45\DryIoc.dll</HintPath>
|
||||
<Reference Include="DryIoc, Version=4.0.7.0, Culture=neutral, PublicKeyToken=dfbf2bd50fcf7768">
|
||||
<HintPath>..\packages\DryIoc.dll.4.0.7\lib\net45\DryIoc.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MaterialDesignColors, Version=1.1.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MaterialDesignColors.1.1.3\lib\net45\MaterialDesignColors.dll</HintPath>
|
||||
<Reference Include="MaterialDesignColors, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\packages\MaterialDesignColors.1.2.1\lib\net45\MaterialDesignColors.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MaterialDesignThemes.Wpf, Version=2.5.0.1205, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MaterialDesignThemes.2.5.0.1205\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
|
||||
<Reference Include="MaterialDesignThemes.Wpf, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MaterialDesignThemes.3.0.0\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Prism, Version=7.1.0.431, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.Core.7.1.0.431\lib\net45\Prism.dll</HintPath>
|
||||
<Reference Include="Prism, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.Core.7.2.0.1422\lib\net45\Prism.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.DryIoc.Wpf, Version=7.1.0.431, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.DryIoc.7.1.0.431\lib\net45\Prism.DryIoc.Wpf.dll</HintPath>
|
||||
<Reference Include="Prism.DryIoc.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\packages\Prism.DryIoc.7.2.0.1422\lib\net45\Prism.DryIoc.Wpf.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Wpf, Version=7.1.0.431, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.Wpf.7.1.0.431\lib\net45\Prism.Wpf.dll</HintPath>
|
||||
<Reference Include="Prism.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\Prism.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Prism.Wpf.7.1.0.431\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
<HintPath>..\packages\Prism.Wpf.7.2.0.1422\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -138,7 +146,7 @@
|
||||
<Name>Katteker.UserInterface</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj">
|
||||
<Project>{a45e1c59-ba9e-452c-a5e2-50de49d53e92}</Project>
|
||||
<Project>{4cd50166-c3ab-4cc4-9694-951a3f33addb}</Project>
|
||||
<Name>Katteker</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
@ -151,5 +159,7 @@
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MaterialDesignThemes.3.0.0\build\MaterialDesignThemes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MaterialDesignThemes.3.0.0\build\MaterialDesignThemes.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MaterialDesignThemes.3.0.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.3.0.0\build\MaterialDesignThemes.targets')" />
|
||||
</Project>
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using Katteker;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
@ -17,7 +18,7 @@ namespace Example
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
//_updateManager = UpdateManager.Create();
|
||||
UpdateManager.TryCreate(out _updateManager);
|
||||
UpdateCommand = new DelegateCommand<string>(async x => await UpdateAsync(x).ConfigureAwait(false));
|
||||
RestartAppDialogCommand = new DelegateCommand<object>(RestartApp);
|
||||
}
|
||||
@ -34,6 +35,12 @@ namespace Example
|
||||
|
||||
private async Task UpdateAsync(string startup)
|
||||
{
|
||||
var openFile = new FolderBrowserDialog();
|
||||
if (openFile.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
MessageBox.Show(openFile.SelectedPath, "Example Core");
|
||||
}
|
||||
|
||||
var silent = bool.Parse(startup);
|
||||
try
|
||||
{
|
||||
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CommonServiceLocator" version="2.0.4" targetFramework="net45" />
|
||||
<package id="DryIoc.dll" version="3.0.2" targetFramework="net45" />
|
||||
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net45" />
|
||||
<package id="MaterialDesignThemes" version="2.5.0.1205" targetFramework="net45" />
|
||||
<package id="CommonServiceLocator" version="2.0.5" targetFramework="net45" />
|
||||
<package id="DryIoc.dll" version="4.0.7" targetFramework="net45" />
|
||||
<package id="MaterialDesignColors" version="1.2.1" targetFramework="net45" />
|
||||
<package id="MaterialDesignThemes" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Prism.Core" version="7.1.0.431" targetFramework="net45" />
|
||||
<package id="Prism.DryIoc" version="7.1.0.431" targetFramework="net45" />
|
||||
<package id="Prism.Wpf" version="7.1.0.431" targetFramework="net45" />
|
||||
<package id="Prism.Core" version="7.2.0.1422" targetFramework="net45" />
|
||||
<package id="Prism.DryIoc" version="7.2.0.1422" targetFramework="net45" />
|
||||
<package id="Prism.Wpf" version="7.2.0.1422" targetFramework="net45" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
|
||||
</packages>
|
1065
ExampleCore/Annotations.cs
Normal file
15
ExampleCore/App.xaml
Normal file
@ -0,0 +1,15 @@
|
||||
<dryioc:PrismApplication x:Class="ExampleCore.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:dryioc="http://prismlibrary.com/">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</dryioc:PrismApplication>
|
18
ExampleCore/App.xaml.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Prism.Ioc;
|
||||
using System.Windows;
|
||||
|
||||
namespace ExampleCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App
|
||||
{
|
||||
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
//nothing
|
||||
}
|
||||
|
||||
protected override Window CreateShell() => Container.Resolve<MainWindow>();
|
||||
}
|
||||
}
|
52
ExampleCore/ExampleCore.csproj
Normal file
@ -0,0 +1,52 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ApplicationIcon>nsis3-install.ico</ApplicationIcon>
|
||||
<Version>1.1.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="nsis3-install.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommonServiceLocator" Version="2.0.5" />
|
||||
<PackageReference Include="DryIoc.dll" Version="4.0.7" />
|
||||
<PackageReference Include="MaterialDesignColors" Version="1.2.1" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="3.0.0" />
|
||||
<PackageReference Include="Prism.Core" Version="7.2.0.1233-pre" />
|
||||
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1233-pre" />
|
||||
<PackageReference Include="Prism.Wpf" Version="7.2.0.1233-pre" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="nsis3-install.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Update="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="changelog.md">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
105
ExampleCore/MainWindow.xaml
Normal file
@ -0,0 +1,105 @@
|
||||
<Window x:Class="ExampleCore.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:local="clr-namespace:ExampleCore"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
Title="MainWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||
TextElement.FontSize="13"
|
||||
TextElement.FontWeight="Regular"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
TextOptions.TextFormattingMode="Ideal"
|
||||
TextOptions.TextRenderingMode="Auto"
|
||||
mc:Ignorable="d">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="ContentRendered">
|
||||
<i:InvokeCommandAction Command="{Binding UpdateCommand}" CommandParameter="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<md:DialogHost IsOpen="{Binding ShowRestartAppDialog}">
|
||||
<md:DialogHost.DialogContent>
|
||||
<Grid Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Text="The update was installed successful. Do you want to restart?" />
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Command="{Binding RestartAppDialogCommand}"
|
||||
IsCancel="False"
|
||||
Style="{StaticResource MaterialDesignFlatButton}">
|
||||
<Button.CommandParameter>
|
||||
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
True
|
||||
</system:Boolean>
|
||||
</Button.CommandParameter>
|
||||
YES
|
||||
</Button>
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Command="{Binding RestartAppDialogCommand}"
|
||||
IsCancel="True"
|
||||
Style="{StaticResource MaterialDesignFlatButton}">
|
||||
<Button.CommandParameter>
|
||||
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
False
|
||||
</system:Boolean>
|
||||
</Button.CommandParameter>
|
||||
NO
|
||||
</Button>
|
||||
</Grid>
|
||||
</md:DialogHost.DialogContent>
|
||||
<DockPanel>
|
||||
<md:Snackbar
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
DockPanel.Dock="Bottom"
|
||||
MessageQueue="{Binding MessageQueue}" />
|
||||
<StackPanel>
|
||||
<Button
|
||||
Height="45"
|
||||
Margin="10"
|
||||
Command="{Binding UpdateCommand}"
|
||||
CommandParameter="False"
|
||||
Content="Update"
|
||||
FontSize="24" />
|
||||
<Button Content="Open File Dialog" Command="{Binding OpenFileDialogCommand}" />
|
||||
<TextBlock
|
||||
Margin="20"
|
||||
HorizontalAlignment="Center"
|
||||
FontSize="60"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Text=":-)">
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform />
|
||||
<SkewTransform />
|
||||
<RotateTransform Angle="90" />
|
||||
<TranslateTransform />
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</md:DialogHost>
|
||||
</Window>
|
13
ExampleCore/MainWindow.xaml.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace ExampleCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
102
ExampleCore/MainWindowViewModel.cs
Normal file
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using Katteker;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
|
||||
namespace ExampleCore
|
||||
{
|
||||
[JetBrains.Annotations.UsedImplicitly]
|
||||
public class MainWindowViewModel : BindableBase, IDisposable
|
||||
{
|
||||
private bool _showRestartAppDialog;
|
||||
private readonly UpdateManager _updateManager;
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
|
||||
UpdateManager.TryCreate(out _updateManager);
|
||||
UpdateCommand = new DelegateCommand<string>(async x => await UpdateAsync(x).ConfigureAwait(false));
|
||||
RestartAppDialogCommand = new DelegateCommand<object>(RestartApp);
|
||||
OpenFileDialogCommand = new DelegateCommand(OpenFileCommand);
|
||||
}
|
||||
|
||||
private void OpenFileCommand()
|
||||
{
|
||||
var openFile = new FolderBrowserDialog();
|
||||
if (openFile.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
MessageBox.Show(openFile.SelectedPath, "Example Core");
|
||||
}
|
||||
}
|
||||
|
||||
private void RestartApp(object obj)
|
||||
{
|
||||
if (obj is bool restart && restart)
|
||||
{
|
||||
_updateManager.RestartApp();
|
||||
}
|
||||
|
||||
ShowRestartAppDialog = false;
|
||||
}
|
||||
|
||||
private async Task UpdateAsync(string startup)
|
||||
{
|
||||
if (_updateManager == null) return;
|
||||
var silent = bool.Parse(startup);
|
||||
try
|
||||
{
|
||||
var releases = (await _updateManager.CheckForUpdateAsync().ConfigureAwait(false)).ToList();
|
||||
if (releases.Any())
|
||||
{
|
||||
MessageQueue.Enqueue("Update available", "Update now", ActionHandler);
|
||||
}
|
||||
else if (!silent)
|
||||
{
|
||||
MessageQueue.Enqueue("No Update available.", true);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (silent)
|
||||
{
|
||||
MessageQueue.Enqueue(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void ActionHandler()
|
||||
{
|
||||
if (await _updateManager.UpdateAppAsync().ConfigureAwait(false))
|
||||
{
|
||||
ShowRestartAppDialog = true;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand UpdateCommand { get; }
|
||||
|
||||
public SnackbarMessageQueue MessageQueue { get; } = new SnackbarMessageQueue();
|
||||
|
||||
public bool ShowRestartAppDialog
|
||||
{
|
||||
get => _showRestartAppDialog;
|
||||
set => SetProperty(ref _showRestartAppDialog, value);
|
||||
}
|
||||
|
||||
public ICommand RestartAppDialogCommand { get; }
|
||||
|
||||
public ICommand OpenFileDialogCommand
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MessageQueue?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
16
ExampleCore/Properties/PublishProfiles/FolderProfile.pubxml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<PublishDir>bin\Release\netcoreapp3.0\publish\</PublishDir>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
<_IsPortable>false</_IsPortable>
|
||||
</PropertyGroup>
|
||||
</Project>
|
5
ExampleCore/changelog.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Hello World
|
BIN
ExampleCore/nsis3-install.ico
Normal file
After Width: | Height: | Size: 11 KiB |
@ -10,12 +10,13 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Katteker</RootNamespace>
|
||||
<AssemblyName>Katteker.UserInterface</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@ -78,7 +79,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj">
|
||||
<Project>{a45e1c59-ba9e-452c-a5e2-50de49d53e92}</Project>
|
||||
<Project>{4cd50166-c3ab-4cc4-9694-951a3f33addb}</Project>
|
||||
<Name>Katteker</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
@ -35,7 +35,7 @@ namespace Katteker
|
||||
/// <summary>
|
||||
/// Set Process API aware
|
||||
/// </summary>
|
||||
[DllImport("user32.dll")]
|
||||
[DllImport("User32.dll")]
|
||||
internal static extern bool SetProcessDPIAware();
|
||||
}
|
||||
}
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1.4")]
|
||||
[assembly: AssemblyFileVersion("1.1.4")]
|
||||
[assembly: AssemblyVersion("1.1.5")]
|
||||
[assembly: AssemblyFileVersion("1.1.5")]
|
||||
|
48
Katteker.Gui/Properties/Resources.Designer.cs
generated
@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@ -13,13 +13,13 @@ namespace Katteker.Properties {
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
@ -33,7 +33,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
@ -47,8 +47,8 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
@ -61,7 +61,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Could not update your application. ähnelt.
|
||||
/// Looks up a localized string similar to Could not update your application..
|
||||
/// </summary>
|
||||
internal static string CouldNotUpdateYourApplication {
|
||||
get {
|
||||
@ -70,7 +70,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Installed new Version! Would you like to restart the Application? ähnelt.
|
||||
/// Looks up a localized string similar to Installed new Version! Would you like to restart the Application?.
|
||||
/// </summary>
|
||||
internal static string Installed_new_Version {
|
||||
get {
|
||||
@ -79,7 +79,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die New Version ähnelt.
|
||||
/// Looks up a localized string similar to New Version.
|
||||
/// </summary>
|
||||
internal static string New_Version {
|
||||
get {
|
||||
@ -88,7 +88,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die No update available. ähnelt.
|
||||
/// Looks up a localized string similar to No update available..
|
||||
/// </summary>
|
||||
internal static string No_update_available {
|
||||
get {
|
||||
@ -97,7 +97,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Can't find configuration File. Ask your local distributor. ähnelt.
|
||||
/// Looks up a localized string similar to Can't find configuration File. Ask your local distributor..
|
||||
/// </summary>
|
||||
internal static string SquirrelWrapper_CheckForUpdate {
|
||||
get {
|
||||
@ -106,7 +106,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Ask your local distributor. ähnelt.
|
||||
/// Looks up a localized string similar to Ask your local distributor..
|
||||
/// </summary>
|
||||
internal static string SquirrelWrapper_CheckForUpdate_AskYourLocalDistributor {
|
||||
get {
|
||||
@ -115,7 +115,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Error with Configuration-File ähnelt.
|
||||
/// Looks up a localized string similar to Error with Configuration-File.
|
||||
/// </summary>
|
||||
internal static string SquirrelWrapper_CheckForUpdate_Error {
|
||||
get {
|
||||
@ -124,7 +124,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Error with Update ähnelt.
|
||||
/// Looks up a localized string similar to Error with Update.
|
||||
/// </summary>
|
||||
internal static string SquirrelWrapper_CheckForUpdate_ErrorWithUpdate {
|
||||
get {
|
||||
@ -133,7 +133,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Updater ähnelt.
|
||||
/// Looks up a localized string similar to Updater.
|
||||
/// </summary>
|
||||
internal static string Updater {
|
||||
get {
|
||||
@ -142,7 +142,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die You can update to Version: ähnelt.
|
||||
/// Looks up a localized string similar to You can update to Version: .
|
||||
/// </summary>
|
||||
internal static string You_can_update_to_Version {
|
||||
get {
|
||||
@ -151,7 +151,7 @@ namespace Katteker.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die You're up to date. ähnelt.
|
||||
/// Looks up a localized string similar to You're up to date..
|
||||
/// </summary>
|
||||
internal static string You_re_up_to_date {
|
||||
get {
|
||||
|
@ -1,23 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NuGet.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.8.50926.602" newVersion="2.8.50926.602" />
|
||||
<assemblyIdentity name="NuGet.Core" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.8.50926.602" newVersion="2.8.50926.602"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Mono.Cecil" publicKeyToken="0738eb9f132ed756" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.9.5.0" newVersion="0.9.5.0" />
|
||||
<assemblyIdentity name="Mono.Cecil" publicKeyToken="0738eb9f132ed756" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.9.5.0" newVersion="0.9.5.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.19.2.0" newVersion="0.19.2.0" />
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.19.2.0" newVersion="0.19.2.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||
|
37
Katteker.Lib.sln
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.421
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker", "Katteker\Katteker.csproj", "{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker.UserInterface", "Katteker.Gui\Katteker.UserInterface.csproj", "{07E2DE31-80A0-43DA-B307-1CA47CD930A1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker.Test", "Katteker.Test\Katteker.Test.csproj", "{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{07E2DE31-80A0-43DA-B307-1CA47CD930A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{07E2DE31-80A0-43DA-B307-1CA47CD930A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{07E2DE31-80A0-43DA-B307-1CA47CD930A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{07E2DE31-80A0-43DA-B307-1CA47CD930A1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {EAAA54E0-C857-4C5C-BD5D-14A21D462081}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" />
|
||||
<Import Project="..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" />
|
||||
<Import Project="..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" />
|
||||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -43,8 +43,8 @@
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.framework, Version=3.11.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -103,16 +103,6 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Creator\KattekerCreator.csproj">
|
||||
<Project>{53d065eb-8818-4f60-9ebe-75705e1bb00d}</Project>
|
||||
<Name>KattekerCreator</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj">
|
||||
<Project>{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}</Project>
|
||||
<Name>Katteker</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
@ -132,6 +122,12 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj">
|
||||
<Project>{4cd50166-c3ab-4cc4-9694-951a3f33addb}</Project>
|
||||
<Name>Katteker</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
@ -139,7 +135,7 @@
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.11.0\build\NUnit.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.11.2\build\net35\NUnit3TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props'))" />
|
||||
</Target>
|
||||
</Project>
|
@ -56,12 +56,5 @@ namespace Katteker.Test
|
||||
var expected = Utility.GetLocalAppDataDirectory();
|
||||
Assert.IsTrue(expected.Contains("AppData\\Local\\Programs"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestEnumerateFiles()
|
||||
{
|
||||
var list = KattekerCreator.Helper.Utils.EnumerateFiles(ExamplePath, new[] {"*.xml"});
|
||||
Assert.AreEqual(13, list.Count);
|
||||
}
|
||||
}
|
||||
}
|
@ -16,4 +16,4 @@ using System.Runtime.InteropServices;
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net462" developmentDependency="true" />
|
||||
<package id="NUnit" version="3.11.0" targetFramework="net462" />
|
||||
<package id="NUnit3TestAdapter" version="3.11.2" targetFramework="net462" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net462" />
|
||||
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net462" />
|
||||
</packages>
|
42
Katteker.sln
@ -1,12 +1,8 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2036
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28606.126
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KattekerCreator", "Creator\KattekerCreator.csproj", "{53D065EB-8818-4F60-9EBE-75705E1BB00D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker", "Katteker\Katteker.csproj", "{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppStub", "AppStub\AppStub.csproj", "{E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{DE9CFDEB-40B8-447D-9959-31BA78512CED}"
|
||||
@ -15,20 +11,26 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker.UserInterface", "K
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Katteker.Test", "Katteker.Test\Katteker.Test.csproj", "{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KattekerCreator", "KattekerCreator\KattekerCreator.csproj", "{0B728D86-CAB8-4259-925B-3CB37BE111ED}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B} = {E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{148E4735-4CF1-4A24-B689-063DCD6B9A5B}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Katteker", "Katteker\Katteker.csproj", "{4CD50166-C3AB-4CC4-9694-951A3F33ADDB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleCore", "ExampleCore\ExampleCore.csproj", "{39AF52DA-AD79-46DD-87FC-A19D13CEB2AB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{53D065EB-8818-4F60-9EBE-75705E1BB00D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{53D065EB-8818-4F60-9EBE-75705E1BB00D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{53D065EB-8818-4F60-9EBE-75705E1BB00D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{53D065EB-8818-4F60-9EBE-75705E1BB00D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E746AE0F-BEEA-4C18-9ED8-2E708ED00A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@ -45,6 +47,18 @@ Global
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{76E9E47E-C810-4C13-BAC3-1F53CF4BCB92}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0B728D86-CAB8-4259-925B-3CB37BE111ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0B728D86-CAB8-4259-925B-3CB37BE111ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0B728D86-CAB8-4259-925B-3CB37BE111ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0B728D86-CAB8-4259-925B-3CB37BE111ED}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4CD50166-C3AB-4CC4-9694-951A3F33ADDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4CD50166-C3AB-4CC4-9694-951A3F33ADDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4CD50166-C3AB-4CC4-9694-951A3F33ADDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4CD50166-C3AB-4CC4-9694-951A3F33ADDB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{39AF52DA-AD79-46DD-87FC-A19D13CEB2AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{39AF52DA-AD79-46DD-87FC-A19D13CEB2AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{39AF52DA-AD79-46DD-87FC-A19D13CEB2AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{39AF52DA-AD79-46DD-87FC-A19D13CEB2AB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -19,7 +19,7 @@ namespace Semver
|
||||
public sealed class SemVersion : IComparable<SemVersion>, IComparable, ISerializable
|
||||
#endif
|
||||
{
|
||||
static Regex parseEx =
|
||||
static Regex _parseEx =
|
||||
new Regex(@"^(?<major>\d+)" +
|
||||
@"(\.(?<minor>\d+))?" +
|
||||
@"(\.(?<patch>\d+))?" +
|
||||
@ -40,7 +40,7 @@ namespace Semver
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private SemVersion(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
if (info == null) throw new ArgumentNullException("info");
|
||||
if (info == null) throw new ArgumentNullException(nameof(info));
|
||||
var semVersion = Parse(info.GetString("SemVersion"));
|
||||
Major = semVersion.Major;
|
||||
Minor = semVersion.Minor;
|
||||
@ -76,7 +76,7 @@ namespace Semver
|
||||
public SemVersion(Version version)
|
||||
{
|
||||
if (version == null)
|
||||
throw new ArgumentNullException("version");
|
||||
throw new ArgumentNullException(nameof(version));
|
||||
|
||||
this.Major = version.Major;
|
||||
this.Minor = version.Minor;
|
||||
@ -86,7 +86,7 @@ namespace Semver
|
||||
this.Patch = version.Revision;
|
||||
}
|
||||
|
||||
this.Prerelease = String.Empty;
|
||||
this.Prerelease = string.Empty;
|
||||
|
||||
if (version.Build > 0)
|
||||
{
|
||||
@ -94,7 +94,7 @@ namespace Semver
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Build = String.Empty;
|
||||
this.Build = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,9 +107,9 @@ namespace Semver
|
||||
/// <exception cref="System.InvalidOperationException">When a invalid version string is passed.</exception>
|
||||
public static SemVersion Parse(string version, bool strict = false)
|
||||
{
|
||||
var match = parseEx.Match(version);
|
||||
var match = _parseEx.Match(version);
|
||||
if (!match.Success)
|
||||
throw new ArgumentException("Invalid version.", "version");
|
||||
throw new ArgumentException("Invalid version.", nameof(version));
|
||||
|
||||
#if NETSTANDARD
|
||||
var major = int.Parse(match.Groups["major"].Value);
|
||||
@ -118,7 +118,7 @@ namespace Semver
|
||||
#endif
|
||||
|
||||
var minorMatch = match.Groups["minor"];
|
||||
int minor = 0;
|
||||
var minor = 0;
|
||||
if (minorMatch.Success)
|
||||
{
|
||||
#if NETSTANDARD
|
||||
@ -133,7 +133,7 @@ namespace Semver
|
||||
}
|
||||
|
||||
var patchMatch = match.Groups["patch"];
|
||||
int patch = 0;
|
||||
var patch = 0;
|
||||
if (patchMatch.Success)
|
||||
{
|
||||
#if NETSTANDARD
|
||||
@ -229,7 +229,7 @@ namespace Semver
|
||||
/// <value>
|
||||
/// The major version.
|
||||
/// </value>
|
||||
public int Major { get; private set; }
|
||||
public int Major { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the minor version.
|
||||
@ -237,7 +237,7 @@ namespace Semver
|
||||
/// <value>
|
||||
/// The minor version.
|
||||
/// </value>
|
||||
public int Minor { get; private set; }
|
||||
public int Minor { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the patch version.
|
||||
@ -245,7 +245,7 @@ namespace Semver
|
||||
/// <value>
|
||||
/// The patch version.
|
||||
/// </value>
|
||||
public int Patch { get; private set; }
|
||||
public int Patch { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pre-release version.
|
||||
@ -253,7 +253,7 @@ namespace Semver
|
||||
/// <value>
|
||||
/// The pre-release version.
|
||||
/// </value>
|
||||
public string Prerelease { get; private set; }
|
||||
public string Prerelease { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the build version.
|
||||
@ -261,7 +261,7 @@ namespace Semver
|
||||
/// <value>
|
||||
/// The build version.
|
||||
/// </value>
|
||||
public string Build { get; private set; }
|
||||
public string Build { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a <see cref="System.String" /> that represents this instance.
|
||||
@ -272,9 +272,9 @@ namespace Semver
|
||||
public override string ToString()
|
||||
{
|
||||
var version = "" + Major + "." + Minor + "." + Patch;
|
||||
if (!String.IsNullOrEmpty(Prerelease))
|
||||
if (!string.IsNullOrEmpty(Prerelease))
|
||||
version += "-" + Prerelease;
|
||||
if (!String.IsNullOrEmpty(Build))
|
||||
if (!string.IsNullOrEmpty(Build))
|
||||
version += "+" + Build;
|
||||
return version;
|
||||
}
|
||||
@ -362,10 +362,10 @@ namespace Semver
|
||||
return r;
|
||||
}
|
||||
|
||||
static int CompareComponent(string a, string b, bool lower = false)
|
||||
private static int CompareComponent(string a, string b, bool lower = false)
|
||||
{
|
||||
var aEmpty = String.IsNullOrEmpty(a);
|
||||
var bEmpty = String.IsNullOrEmpty(b);
|
||||
var aEmpty = string.IsNullOrEmpty(a);
|
||||
var bEmpty = string.IsNullOrEmpty(b);
|
||||
if (aEmpty && bEmpty)
|
||||
return 0;
|
||||
|
||||
@ -378,13 +378,12 @@ namespace Semver
|
||||
var bComps = b.Split('.');
|
||||
|
||||
var minLen = Math.Min(aComps.Length, bComps.Length);
|
||||
for (int i = 0; i < minLen; i++)
|
||||
for (var i = 0; i < minLen; i++)
|
||||
{
|
||||
var ac = aComps[i];
|
||||
var bc = bComps[i];
|
||||
int anum, bnum;
|
||||
var isanum = Int32.TryParse(ac, out anum);
|
||||
var isbnum = Int32.TryParse(bc, out bnum);
|
||||
var isanum = int.TryParse(ac, out var anum);
|
||||
var isbnum = int.TryParse(bc, out var bnum);
|
||||
int r;
|
||||
if (isanum && isbnum)
|
||||
{
|
||||
@ -397,7 +396,7 @@ namespace Semver
|
||||
return -1;
|
||||
if (isbnum)
|
||||
return 1;
|
||||
r = String.CompareOrdinal(ac, bc);
|
||||
r = string.CompareOrdinal(ac, bc);
|
||||
if (r != 0)
|
||||
return r;
|
||||
}
|
||||
@ -440,11 +439,11 @@ namespace Semver
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
int result = this.Major.GetHashCode();
|
||||
result = result * 31 + this.Minor.GetHashCode();
|
||||
result = result * 31 + this.Patch.GetHashCode();
|
||||
result = result * 31 + this.Prerelease.GetHashCode();
|
||||
result = result * 31 + this.Build.GetHashCode();
|
||||
var result = Major.GetHashCode();
|
||||
result = (result * 31) + Minor.GetHashCode();
|
||||
result = (result * 31) + Patch.GetHashCode();
|
||||
result = (result * 31) + Prerelease.GetHashCode();
|
||||
result = (result * 31) + Build.GetHashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -453,7 +452,7 @@ namespace Semver
|
||||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
|
||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
{
|
||||
if (info == null) throw new ArgumentNullException("info");
|
||||
if (info == null) throw new ArgumentNullException(nameof(info));
|
||||
info.AddValue("SemVersion", ToString());
|
||||
}
|
||||
#endif
|
||||
@ -465,7 +464,7 @@ namespace Semver
|
||||
/// <returns>The SemVersion object.</returns>
|
||||
public static implicit operator SemVersion(string version)
|
||||
{
|
||||
return SemVersion.Parse(version);
|
||||
return Parse(version);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -476,7 +475,7 @@ namespace Semver
|
||||
/// <returns>If left is equal to right <c>true</c>, else <c>false</c>.</returns>
|
||||
public static bool operator ==(SemVersion left, SemVersion right)
|
||||
{
|
||||
return SemVersion.Equals(left, right);
|
||||
return Equals(left, right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -487,7 +486,7 @@ namespace Semver
|
||||
/// <returns>If left is not equal to right <c>true</c>, else <c>false</c>.</returns>
|
||||
public static bool operator !=(SemVersion left, SemVersion right)
|
||||
{
|
||||
return !SemVersion.Equals(left, right);
|
||||
return !Equals(left, right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -498,7 +497,7 @@ namespace Semver
|
||||
/// <returns>If left is greater than right <c>true</c>, else <c>false</c>.</returns>
|
||||
public static bool operator >(SemVersion left, SemVersion right)
|
||||
{
|
||||
return SemVersion.Compare(left, right) > 0;
|
||||
return Compare(left, right) > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -520,7 +519,7 @@ namespace Semver
|
||||
/// <returns>If left is less than right <c>true</c>, else <c>false</c>.</returns>
|
||||
public static bool operator <(SemVersion left, SemVersion right)
|
||||
{
|
||||
return SemVersion.Compare(left, right) < 0;
|
||||
return Compare(left, right) < 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
9
Katteker/GlobalSuppressions.cs
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0046:Convert to conditional expression", Justification = "<Pending>", Scope = "member", Target = "~M:Katteker.ReleaseEntry.CompareTo(Katteker.ReleaseEntry)~System.Int32")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0046:Convert to conditional expression", Justification = "<Pending>", Scope = "member", Target = "~M:Katteker.VersionUtils.GetCurrentVersion(System.Reflection.Assembly)~Semver.SemVersion")]
|
||||
|
@ -1,69 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A45E1C59-BA9E-452C-A5E2-50DE49D53E92}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Katteker</RootNamespace>
|
||||
<AssemblyName>Katteker</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Debug\Katteker.xml</DocumentationFile>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>1.1.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml" />
|
||||
<PackageReference Include="Microsoft.Net.Compilers" Version="2.10.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ChangelogHelper.cs" />
|
||||
<Compile Include="Common\SemVersion.cs" />
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="KattekerConfig.cs" />
|
||||
<Compile Include="Common\MarkdownSharp.cs" />
|
||||
<Compile Include="KattekerUpdateException.cs" />
|
||||
<Compile Include="UpdateInfo.cs" />
|
||||
<Compile Include="UpdateManager.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReleaseEntry.cs" />
|
||||
<Compile Include="Releases.cs" />
|
||||
<Compile Include="Utility.cs" />
|
||||
<Compile Include="VersionUtils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />
|
||||
</Target>
|
||||
</Project>
|
@ -1,37 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("Katteker")]
|
||||
[assembly: AssemblyDescription("Katteker Client")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Holger Börchers")]
|
||||
[assembly: AssemblyProduct("Katteker")]
|
||||
[assembly: AssemblyCopyright("Copyright © Holger Börchers 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("a45e1c59-ba9e-452c-a5e2-50de49d53e92")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1.1")]
|
||||
[assembly: AssemblyFileVersion("1.1.1")]
|
||||
[assembly: InternalsVisibleTo("Katteker.Test")]
|
@ -14,16 +14,16 @@ namespace Katteker
|
||||
{
|
||||
private const string FilenameRegex = @"(^.*)-((?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?).*-(full|delta)";
|
||||
|
||||
private const char Seperator = '|';
|
||||
private const char Separator = '|';
|
||||
|
||||
/// <summary>
|
||||
/// Creat an instance of <see cref="ReleaseEntry"/>.
|
||||
/// Creates an instance of <see cref="ReleaseEntry"/>.
|
||||
/// </summary>
|
||||
public ReleaseEntry(string filename, SemVersion version, long fileSize, bool isDelta, string sha1)
|
||||
{
|
||||
Filename = filename;
|
||||
Version = version;
|
||||
Filesize = fileSize;
|
||||
FileSize = fileSize;
|
||||
IsDelta = isDelta;
|
||||
SHA1 = sha1;
|
||||
}
|
||||
@ -37,7 +37,7 @@ namespace Katteker
|
||||
public ReleaseEntry(string line)
|
||||
{
|
||||
if (line == null) throw new ArgumentNullException(nameof(line));
|
||||
var elements = line.Split(Seperator);
|
||||
var elements = line.Split(Separator);
|
||||
if (elements.Length != 3)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(line), elements.Length, "The release entry has not the right format.");
|
||||
@ -45,7 +45,7 @@ namespace Katteker
|
||||
|
||||
SHA1 = elements[0];
|
||||
Filename = elements[1];
|
||||
Filesize = long.Parse(elements[2]);
|
||||
FileSize = long.Parse(elements[2]);
|
||||
var fileSegments = Regex.Match(Filename, FilenameRegex);
|
||||
if (fileSegments.Groups.Count < 3) throw new FileLoadException("Filename is not compilant.");
|
||||
ApplicationName = fileSegments.Groups[1].Value;
|
||||
@ -82,7 +82,7 @@ namespace Katteker
|
||||
/// <summary>
|
||||
/// Size of the file.
|
||||
/// </summary>
|
||||
public long Filesize { get; }
|
||||
public long FileSize { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Is true if the update is delta file. False otherwise.
|
||||
@ -97,7 +97,7 @@ namespace Katteker
|
||||
/// <summary>
|
||||
/// Format the release entry as line for release file.
|
||||
/// </summary>
|
||||
public string EntryAsString => $"{SHA1}{Seperator}{Filename}{Seperator}{Filesize}";
|
||||
public string EntryAsString => $"{SHA1}{Separator}{Filename}{Separator}{FileSize}";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => $"{ApplicationName} {Version}";
|
||||
@ -125,7 +125,7 @@ namespace Katteker
|
||||
/// <returns></returns>
|
||||
protected bool Equals(ReleaseEntry other)
|
||||
{
|
||||
return Equals(Version, other.Version) && string.Equals(SHA1, other.SHA1) && string.Equals(Filename, other.Filename) && Filesize == other.Filesize && IsDelta == other.IsDelta;
|
||||
return Equals(Version, other.Version) && string.Equals(SHA1, other.SHA1) && string.Equals(Filename, other.Filename) && FileSize == other.FileSize && IsDelta == other.IsDelta;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -133,10 +133,10 @@ namespace Katteker
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = (Version != null ? Version.GetHashCode() : 0);
|
||||
var hashCode = Version != null ? Version.GetHashCode() : 0;
|
||||
hashCode = (hashCode * 397) ^ (SHA1 != null ? SHA1.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ (Filename != null ? Filename.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ Filesize.GetHashCode();
|
||||
hashCode = (hashCode * 397) ^ FileSize.GetHashCode();
|
||||
hashCode = (hashCode * 397) ^ IsDelta.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using Semver;
|
||||
|
||||
namespace Katteker
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// This class represents the release file which will published.
|
||||
/// </summary>
|
||||
|
@ -71,6 +71,7 @@ namespace Katteker
|
||||
public static bool TryCreate(out UpdateManager manager, string urlOrPath = null, string applicationName = null,
|
||||
string rootDirectory = null)
|
||||
{
|
||||
manager = default;
|
||||
try
|
||||
{
|
||||
manager = Create(urlOrPath, applicationName, rootDirectory);
|
||||
@ -78,7 +79,6 @@ namespace Katteker
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
manager = default(UpdateManager);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,10 @@ namespace Katteker
|
||||
/// <param name="arguments"></param>
|
||||
public void RestartApp(string exeToStart = null, string arguments = null)
|
||||
{
|
||||
exeToStart = exeToStart ?? Path.GetFileName(Assembly.GetEntryAssembly().Location);
|
||||
//TODO DOTNET Core compatibility
|
||||
|
||||
exeToStart = exeToStart ?? Path.GetFileName(Assembly.GetEntryAssembly()?.Location);
|
||||
exeToStart = Path.ChangeExtension(exeToStart, "exe");
|
||||
var program = Path.Combine(_rootAppDirectory, exeToStart);
|
||||
if (!File.Exists(program)) throw new FileNotFoundException(program);
|
||||
Process.Start(program, arguments);
|
||||
@ -149,9 +152,12 @@ namespace Katteker
|
||||
{
|
||||
var url = urlOrPath.TrimEnd('/');
|
||||
url += "/" + Constants.Release;
|
||||
var content = await new WebClient().DownloadStringTaskAsync(url).ConfigureAwait(false);
|
||||
var lines = content.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
return new Releases(lines);
|
||||
using (var wc = new WebClient())
|
||||
{
|
||||
var content = await wc.DownloadStringTaskAsync(url).ConfigureAwait(false);
|
||||
var lines = content.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
return new Releases(lines);
|
||||
}
|
||||
}
|
||||
|
||||
private static Releases GetFromFilesystem(string urlOrPath) => new Releases(urlOrPath);
|
||||
@ -173,7 +179,7 @@ namespace Katteker
|
||||
{
|
||||
foreach (var process in Process.GetProcessesByName(_applicationName))
|
||||
{
|
||||
var path = Path.GetDirectoryName(process.MainModule.FileName);
|
||||
var path = Path.GetDirectoryName(process.MainModule?.FileName);
|
||||
if (!_rootAppDirectory.Equals(path)) continue;
|
||||
process.Kill();
|
||||
return Task.Delay(100);
|
||||
@ -190,7 +196,10 @@ namespace Katteker
|
||||
{
|
||||
var url = UrlOrPath.TrimEnd('/');
|
||||
url += "/" + filename;
|
||||
await new WebClient().DownloadFileTaskAsync(new Uri(url), targetFile).ConfigureAwait(false);
|
||||
using (var wc = new WebClient())
|
||||
{
|
||||
await wc.DownloadFileTaskAsync(new Uri(url), targetFile).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -198,27 +207,36 @@ namespace Katteker
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> UpdateAppImplAsync(ReleaseEntry lastEntry, IProgress<int> progress)
|
||||
private async Task<bool> UpdateAppImplAsync(ReleaseEntry lastEntry, IProgress<int> progress = default)
|
||||
{
|
||||
if (lastEntry == null) throw new ArgumentNullException(nameof(lastEntry));
|
||||
var targetFile = Path.Combine(_packageDir, lastEntry.Filename);
|
||||
//download file.
|
||||
await PutFileInPackageFolderAsync(lastEntry.Filename).ConfigureAwait(false);
|
||||
progress?.Report(60);
|
||||
|
||||
if (!VerifyFileChecksum(targetFile, lastEntry.SHA1)) throw new FileLoadException("Checksum missmatch.");
|
||||
progress?.Report(70);
|
||||
|
||||
await KillAppStubAsync().ConfigureAwait(false);
|
||||
progress?.Report(80);
|
||||
|
||||
using (var updater = Process.Start(targetFile, "/S"))
|
||||
try
|
||||
{
|
||||
updater?.WaitForExit();
|
||||
}
|
||||
if (lastEntry == null) throw new ArgumentNullException(nameof(lastEntry));
|
||||
var targetFile = Path.Combine(_packageDir, lastEntry.Filename);
|
||||
//download file.
|
||||
await PutFileInPackageFolderAsync(lastEntry.Filename).ConfigureAwait(false);
|
||||
progress?.Report(60);
|
||||
|
||||
progress?.Report(100);
|
||||
return true;
|
||||
if (!VerifyFileChecksum(targetFile, lastEntry.SHA1)) throw new FileLoadException("Checksum missmatch.");
|
||||
progress?.Report(70);
|
||||
|
||||
await KillAppStubAsync().ConfigureAwait(false);
|
||||
progress?.Report(80);
|
||||
|
||||
using (var updater = new Process())
|
||||
{
|
||||
updater.StartInfo = new ProcessStartInfo(targetFile, "/S");
|
||||
updater.Start();
|
||||
updater.WaitForExit();
|
||||
}
|
||||
|
||||
progress?.Report(100);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
[assembly: InternalsVisibleTo("Katteker.Test")]
|
||||
namespace Katteker
|
||||
{
|
||||
/// <summary>
|
||||
@ -35,15 +37,13 @@ namespace Katteker
|
||||
/// <returns>Returns the hash as base64 string</returns>
|
||||
internal static string ComputeFileHash(string filename)
|
||||
{
|
||||
string sha1;
|
||||
var fileInfo = new FileInfo(filename);
|
||||
|
||||
using (var sha1Managed = new SHA1Managed())
|
||||
using (var fileStream = fileInfo.OpenRead())
|
||||
{
|
||||
sha1 = Convert.ToBase64String(sha1Managed.ComputeHash(fileStream));
|
||||
return Convert.ToBase64String(sha1Managed.ComputeHash(fileStream));
|
||||
}
|
||||
return sha1;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
24
KattekerCreator/Exceptions/KattekerCreatorException.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace KattekerCreator.Exceptions
|
||||
{
|
||||
internal class KattekerCreatorException : Exception
|
||||
{
|
||||
public KattekerCreatorException()
|
||||
{
|
||||
}
|
||||
|
||||
public KattekerCreatorException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public KattekerCreatorException(string message, Exception innerException) : base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
protected KattekerCreatorException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using KattekerCreator.Exceptions;
|
||||
using Minimatch;
|
||||
using Vestris.ResourceLib;
|
||||
|
||||
@ -19,19 +21,6 @@ namespace KattekerCreator.Helper
|
||||
return false;
|
||||
}
|
||||
|
||||
public static TemporaryDirectory CreateTempDirectory()
|
||||
{
|
||||
string result;
|
||||
do
|
||||
{
|
||||
result = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp", Environment.UserName,
|
||||
Path.GetRandomFileName());
|
||||
} while (Directory.Exists(result));
|
||||
|
||||
Directory.CreateDirectory(result);
|
||||
return new TemporaryDirectory(result);
|
||||
}
|
||||
|
||||
public static bool IsFilesizeWrong(string filename)
|
||||
{
|
||||
var file = new FileInfo(filename);
|
||||
@ -59,6 +48,30 @@ namespace KattekerCreator.Helper
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the signtool.exe command line. Returns "" if no certificate string is provided.
|
||||
/// </summary>
|
||||
/// <param name="certificate"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="filename"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetSignToolCommandLine(string certificate, string password, string filename)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(certificate)
|
||||
? string.Empty
|
||||
: $"\"{GetSignTool()}\" {GetSignToolParameters(certificate, password, filename)}";
|
||||
}
|
||||
|
||||
public static string GetSignToolParameters(string certificate, string password, string filename)
|
||||
{
|
||||
return $"sign /fd SHA256 /t http://timestamp.digicert.com /f \"{certificate}\" /p {password} {filename}";
|
||||
}
|
||||
|
||||
public static string GetSignTool()
|
||||
{
|
||||
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "contrib", "signtool.exe");
|
||||
}
|
||||
|
||||
|
||||
public static void DeleteTempDir(string tempDir)
|
||||
{
|
||||
@ -67,7 +80,7 @@ namespace KattekerCreator.Helper
|
||||
{
|
||||
Directory.Delete(tempDir, true);
|
||||
}
|
||||
catch (Exception)
|
||||
catch
|
||||
{
|
||||
//silently ignore
|
||||
}
|
||||
@ -78,7 +91,7 @@ namespace KattekerCreator.Helper
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException(nameof(path));
|
||||
var result = new DirectoryInfo(path).EnumerateFiles("*.*", SearchOption.AllDirectories).ToList();
|
||||
var minimatchOptions = new Options {AllowWindowsPaths = true};
|
||||
var minimatchOptions = new Options { AllowWindowsPaths = true };
|
||||
foreach (var pattern in FileExclusions(userdefinedFileExclusions))
|
||||
{
|
||||
var matcher = new Minimatcher(pattern, minimatchOptions);
|
||||
@ -110,5 +123,35 @@ namespace KattekerCreator.Helper
|
||||
yield return fileExclusion;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SignExecutable(string certificate, string password, string filename)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(certificate))
|
||||
{
|
||||
var exitCode = ExecuteProcess(GetSignTool(), GetSignToolParameters(certificate, password, filename));
|
||||
if (exitCode != 0) throw new KattekerCreatorException("AppStub could not signed.");
|
||||
}
|
||||
}
|
||||
|
||||
public static int ExecuteProcess(string executable, string arguments)
|
||||
{
|
||||
int exitCode;
|
||||
using (var p = new Process())
|
||||
{
|
||||
p.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = executable,
|
||||
Arguments = arguments,
|
||||
UseShellExecute = false
|
||||
};
|
||||
var sw = Stopwatch.StartNew();
|
||||
p.Start();
|
||||
p.WaitForExit();
|
||||
exitCode = p.ExitCode;
|
||||
Log.WriteInfoLine($"{Path.GetFileName(executable)} has exited with exit code: {exitCode} (Took: {sw.ElapsedMilliseconds}ms)");
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
}
|
||||
}
|
@ -153,7 +153,7 @@ namespace TsudaKageyu
|
||||
|
||||
var tmpData = new List<byte[]>();
|
||||
|
||||
ENUMRESNAMEPROC callback = (h, t, name, l) =>
|
||||
bool callback(IntPtr h, IntPtr t, IntPtr name, IntPtr l)
|
||||
{
|
||||
// Refer to the following URL for the data structures used here:
|
||||
// http://msdn.microsoft.com/en-us/library/ms997538.aspx
|
||||
@ -204,7 +204,7 @@ namespace TsudaKageyu
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
}
|
||||
NativeMethods.EnumResourceNames(hModule, RT_GROUP_ICON, callback, IntPtr.Zero);
|
||||
|
||||
iconData = tmpData.ToArray();
|
75
KattekerCreator/KattekerCreator.csproj
Normal file
@ -0,0 +1,75 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<ApplicationIcon>app.ico</ApplicationIcon>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="nsis\**\*.*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="contrib\AppStub.exe.config" />
|
||||
<None Remove="contrib\AppStub.pdb" />
|
||||
<None Remove="SetupTemplate.tt" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="SetupTemplate.tt">
|
||||
<LastGenOutput>SetupTemplate.cs</LastGenOutput>
|
||||
<Generator>TextTemplatingFilePreprocessor</Generator>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.4.4" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
|
||||
<PackageReference Include="Vestris.ResourceLib" Version="2.1.0" />
|
||||
<PackageReference Include="YamlDotNet.NetCore" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Katteker\Katteker.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="SetupTemplate.cs">
|
||||
<DependentUpon>SetupTemplate.tt</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="contrib\AppStub.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="contrib\LoadingBar_Icon.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="contrib\signtool.exe">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="contrib\uninstall.ico">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
4
KattekerCreator/KattekerCreatorCore.csproj
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
@ -1,35 +1,40 @@
|
||||
using System;
|
||||
using Katteker;
|
||||
using KattekerCreator.Helper;
|
||||
using KattekerCreator.Types;
|
||||
using McMaster.Extensions.CommandLineUtils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Katteker;
|
||||
using KattekerCreator.Helper;
|
||||
using McMaster.Extensions.CommandLineUtils;
|
||||
|
||||
namespace KattekerCreator
|
||||
{
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public partial class Program
|
||||
internal class Program : ProgramArguments
|
||||
{
|
||||
private const string MakeNsis = @"C:\Program Files (x86)\NSIS\makensis.exe";
|
||||
private readonly string _baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
//private string MakeNsis => Path.Combine(_baseDirectory, "NSIS", "makensis.exe");
|
||||
private static readonly string BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
private static string MakeNsis => Path.Combine(BaseDirectory, "nsis", "makensis.exe");
|
||||
private AssemblyFileInfo _assemblyFileInfo;
|
||||
private TemporaryDirectory _tempDir;
|
||||
private Releases _releases;
|
||||
|
||||
private static int Main(string[] args) => CommandLineApplication.Execute<Program>(args);
|
||||
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private int OnExecute(CommandLineApplication app)
|
||||
static int Main(string[] args)
|
||||
{
|
||||
//Create tempdir
|
||||
using (_tempDir = Utils.CreateTempDirectory())
|
||||
return CommandLineApplication.Execute<Program>(args);
|
||||
}
|
||||
|
||||
protected override int OnExecute(CommandLineApplication app)
|
||||
{
|
||||
//Override commandline arguments, if 'ConfigurationPath' is set.
|
||||
if (TryReadConfigFile(ConfigurationPath, out var dictionary))
|
||||
{
|
||||
OverridePropertyValues(this, dictionary);
|
||||
}
|
||||
|
||||
//Create temp-dir
|
||||
using (_tempDir = TemporaryDirectory.Create())
|
||||
{
|
||||
_releases = new Releases(OutputDir);
|
||||
|
||||
// TODO parser.ShowProgramArguments();
|
||||
|
||||
//Modify AppStub
|
||||
var appStubFile = ModifyAppStub();
|
||||
//Acquire infos from Executable.
|
||||
@ -45,6 +50,8 @@ namespace KattekerCreator
|
||||
var templateFile = GenerateNsisTemplate(additionalFiles);
|
||||
//Start makensis.exe
|
||||
var setupFilePath = CompileSetupScript(templateFile);
|
||||
//TODO Sign setup
|
||||
Utils.SignExecutable(CertificatePath, CertificatePassword, setupFilePath);
|
||||
//Copy to Output-Folder
|
||||
CopyToOutputFolder(setupFilePath);
|
||||
//Create/Modify RELEASE File
|
||||
@ -55,29 +62,6 @@ namespace KattekerCreator
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyAsSetup(string setupFilePath, ReleaseEntry releaseEntry)
|
||||
{
|
||||
if (!_releases.IsLatestEntry(releaseEntry)) return;
|
||||
var target = Path.Combine(OutputDir, Constants.SetupFile);
|
||||
File.Delete(target);
|
||||
File.Copy(setupFilePath, target);
|
||||
}
|
||||
|
||||
private ReleaseEntry AddPackageToReleaseFile(string setupFilePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = _releases.Add(setupFilePath, _assemblyFileInfo.AssemblyVersion);
|
||||
_releases.WriteReleaseFile();
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.WriteErrorLine(e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyToOutputFolder(string setupFilePath)
|
||||
{
|
||||
if (setupFilePath == null) throw new ArgumentNullException(nameof(setupFilePath));
|
||||
@ -95,27 +79,15 @@ namespace KattekerCreator
|
||||
File.Copy(setupFilePath, Path.Combine(OutputDir, setupFile), true);
|
||||
}
|
||||
|
||||
private static string CompileSetupScript(string templateFile)
|
||||
{
|
||||
if (!File.Exists(MakeNsis)) throw new FileNotFoundException("NSIS not installed properly.");
|
||||
int exitcode;
|
||||
using (var p = new Process())
|
||||
{
|
||||
p.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = MakeNsis,
|
||||
Arguments = $"\"{templateFile}\"",
|
||||
UseShellExecute = false
|
||||
};
|
||||
var sw = Stopwatch.StartNew();
|
||||
p.Start();
|
||||
p.WaitForExit();
|
||||
exitcode = p.ExitCode;
|
||||
Log.WriteInfoLine($"{Path.GetFileName(MakeNsis)} has exited with Exitcode: {exitcode} (Took: {sw.ElapsedMilliseconds}ms)");
|
||||
}
|
||||
|
||||
if (exitcode != 0) throw new Exception($"{Path.GetFileName(MakeNsis)} has exited with Exitcode: {exitcode}");
|
||||
return Path.ChangeExtension(templateFile, "exe");
|
||||
private string ModifyAppStub()
|
||||
{
|
||||
var baseFile = Path.Combine(BaseDirectory, "contrib", Constants.ExecutionStub);
|
||||
var targetFile = Path.Combine(_tempDir.Path, Constants.ExecutionStub);
|
||||
File.Copy(baseFile, targetFile);
|
||||
Utils.CopyResources(ProgramFile, targetFile);
|
||||
Utils.SignExecutable(CertificatePath, CertificatePassword, targetFile);
|
||||
return targetFile;
|
||||
}
|
||||
|
||||
private string CreateConfigFile()
|
||||
@ -125,47 +97,42 @@ namespace KattekerCreator
|
||||
{
|
||||
Publish = PublishDir ?? OutputDir,
|
||||
Changelog = Path.GetFileName(ChangeLog),
|
||||
Channel = Channel
|
||||
Channel = Channel
|
||||
};
|
||||
kattekerConfig.WriteToFile(pathToFile);
|
||||
return pathToFile;
|
||||
}
|
||||
|
||||
private string ModifyAppStub()
|
||||
{
|
||||
var baseFile = new FileInfo(Path.Combine(_baseDirectory, Constants.ExecutionStub));
|
||||
var targetFile = baseFile.CopyTo(Path.Combine(_tempDir.Path, Constants.ExecutionStub));
|
||||
Utils.CopyResources(ProgramFile, targetFile.FullName);
|
||||
return targetFile.FullName;
|
||||
}
|
||||
|
||||
private static string GenerateFilename(string name, string version, string extension, bool isDelta = false) => $"{name}-{version}-{(isDelta ? "delta" : "full")}.{extension}";
|
||||
|
||||
|
||||
private string GenerateNsisTemplate(IEnumerable<PhysicalFile> additionalFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
var outFile = Path.Combine(_tempDir.Path, GenerateFilename(_assemblyFileInfo.ProductName, _assemblyFileInfo.AssemblyVersion.ToString(), "nsi"));
|
||||
var setupTmpl = new SetupTmpl
|
||||
var assemblyName = Path.GetFileNameWithoutExtension(_assemblyFileInfo.FileInfo.Name);
|
||||
var outFile = Path.Combine(_tempDir.Path, GenerateFilename(assemblyName, _assemblyFileInfo.AssemblyVersion.ToString(), "nsi"));
|
||||
var setupTemplate = new SetupTemplate
|
||||
{
|
||||
Executable = _assemblyFileInfo.FileInfo.Name,
|
||||
AssemblyName = assemblyName,
|
||||
AppName = _assemblyFileInfo.ProductName,
|
||||
CompanyName = _assemblyFileInfo.Company,
|
||||
Description = _assemblyFileInfo.Description,
|
||||
IconPath = _assemblyFileInfo.AssemblyIconPath,
|
||||
Version = _assemblyFileInfo.AssemblyVersion,
|
||||
HelpUrl = "http://example.org", //Not used at the moment.
|
||||
UserInterface = Path.Combine(_baseDirectory, "contrib", "LoadingBar_Icon.exe"),
|
||||
UninstallIcon = Path.Combine(_baseDirectory, "contrib", "uninstall.ico"),
|
||||
UserInterface = Path.Combine(BaseDirectory, "contrib", "LoadingBar_Icon.exe"),
|
||||
UninstallIcon = Path.Combine(BaseDirectory, "contrib", "uninstall.ico"),
|
||||
OutFile = Path.GetFileName(Path.ChangeExtension(outFile, "exe")),
|
||||
ReleaseChannel = Channel
|
||||
};
|
||||
var path = Path.GetDirectoryName(ProgramFile) ?? string.Empty;
|
||||
setupTmpl.Files.AddRange(additionalFiles);
|
||||
setupTemplate.Files.AddRange(additionalFiles);
|
||||
var files = Utils.EnumerateFiles(path, Filter).ToArray();
|
||||
setupTmpl.InstallSize = (long) Math.Floor(files.Sum(x => x.Length) / 1024f);
|
||||
setupTmpl.Files.AddRange(files.Select(x => new PhysicalFile(x.FullName, x.FullName.Replace(path, $"app-{_assemblyFileInfo.AssemblyVersion}"))));
|
||||
var transformText = setupTmpl.TransformText();
|
||||
setupTemplate.InstallSize = (long)Math.Floor(files.Sum(x => x.Length) / 1024f);
|
||||
setupTemplate.Files.AddRange(files.Select(x => new PhysicalFile(x.FullName, x.FullName.Replace(path, $"app-{_assemblyFileInfo.AssemblyVersion}"))));
|
||||
var transformText = setupTemplate.TransformText();
|
||||
File.WriteAllText(outFile, transformText);
|
||||
return outFile;
|
||||
}
|
||||
@ -175,5 +142,37 @@ namespace KattekerCreator
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private static string CompileSetupScript(string templateFile)
|
||||
{
|
||||
if (!File.Exists(MakeNsis)) throw new FileNotFoundException("NSIS not installed properly.");
|
||||
var exitCode = Utils.ExecuteProcess(MakeNsis, $"\"{templateFile}\"");
|
||||
|
||||
if (exitCode != 0) throw new Exception($"{Path.GetFileName(MakeNsis)} has exited with exit code: {exitCode}");
|
||||
return Path.ChangeExtension(templateFile, "exe");
|
||||
}
|
||||
|
||||
private ReleaseEntry AddPackageToReleaseFile(string setupFilePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = _releases.Add(setupFilePath, _assemblyFileInfo.AssemblyVersion);
|
||||
_releases.WriteReleaseFile();
|
||||
return result;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.WriteErrorLine(e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyAsSetup(string setupFilePath, ReleaseEntry releaseEntry)
|
||||
{
|
||||
if (!_releases.IsLatestEntry(releaseEntry)) return;
|
||||
var target = Path.Combine(OutputDir, Constants.SetupFile);
|
||||
File.Delete(target);
|
||||
File.Copy(setupFilePath, target);
|
||||
}
|
||||
}
|
||||
}
|
94
KattekerCreator/ProgramArguments.cs
Normal file
@ -0,0 +1,94 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using McMaster.Extensions.CommandLineUtils;
|
||||
|
||||
namespace KattekerCreator
|
||||
{
|
||||
[Command(Name = "KattekerCreator", Description = "Creates Installation and Update packages.")]
|
||||
[HelpOption("-?")]
|
||||
public abstract class ProgramArguments
|
||||
{
|
||||
private string _changeLog;
|
||||
private string _programFile;
|
||||
private string _outputDir;
|
||||
|
||||
[Argument(0, Description = "Path to the program file")]
|
||||
[FileExists]
|
||||
[Required]
|
||||
public string ProgramFile
|
||||
{
|
||||
get => _programFile;
|
||||
set => _programFile = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-L|--changelog", Description = "Path of the changelog file")]
|
||||
[FileExists]
|
||||
public string ChangeLog
|
||||
{
|
||||
get => _changeLog;
|
||||
set => _changeLog = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-C|--channel", Description = "Channel of releasing")]
|
||||
public string Channel { get; set; }
|
||||
|
||||
[Option("-O|--output", Description = "Directory for the output")]
|
||||
public string OutputDir
|
||||
{
|
||||
get => _outputDir;
|
||||
set => _outputDir = Path.GetFullPath(value);
|
||||
}
|
||||
|
||||
[Option("-P|--publish", Description = "Path for output from the point of view of the application")]
|
||||
public string PublishDir { get; set; }
|
||||
|
||||
[Option("-V|--version", Description = "Override version number of the application")]
|
||||
public string Version { get; set; }
|
||||
|
||||
[Option("-F|--filter", Description = "Filter parameter. Supports minimatch pattern. (see: https://bit.ly/2EhFoP7)")]
|
||||
public string FilterAsString { get; set; }
|
||||
|
||||
[Option("-S|--sign", Description = "Sign setup with certificate")]
|
||||
public string CertificatePath { get; set; }
|
||||
|
||||
[Option("-Sp|--signPassword", Description = "Password for certificate, if necessary")]
|
||||
public string CertificatePassword { get; set; }
|
||||
|
||||
[Option("-G|--config", Description = "Path to the configuration file. Configured settings in file will override all other settings.")]
|
||||
[FileExists]
|
||||
protected string ConfigurationPath { get; set; }
|
||||
|
||||
protected abstract int OnExecute(CommandLineApplication app);
|
||||
|
||||
protected IEnumerable<string> Filter => string.IsNullOrWhiteSpace(FilterAsString) ? Enumerable.Empty<string>() : FilterAsString.Split(';');
|
||||
|
||||
public static void OverridePropertyValues(object obj, IDictionary<string, string> dictionary)
|
||||
{
|
||||
var properties = obj.GetType().GetProperties().Where(x => x.CustomAttributes.Any(y => y.AttributeType == typeof(OptionAttribute)));
|
||||
foreach (var property in properties)
|
||||
{
|
||||
if (dictionary.TryGetValue(property.Name, out var value))
|
||||
{
|
||||
property.SetValue(obj, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool TryReadConfigFile(string configurationPath, out IDictionary<string, string> args)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(configurationPath) && File.Exists(configurationPath))
|
||||
{
|
||||
var contents = File.ReadAllText(configurationPath);
|
||||
var deserializer = new YamlDotNet.Serialization.DeserializerBuilder().Build();
|
||||
args = deserializer.Deserialize<Dictionary<string, string>>(contents);
|
||||
return true;
|
||||
}
|
||||
|
||||
args = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<PublishDir>\\srv-et01\e$\BuildTools\Katteker</PublishDir>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
<_IsPortable>false</_IsPortable>
|
||||
</PropertyGroup>
|
||||
</Project>
|
8
KattekerCreator/Properties/launchSettings.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"KattekerCreator": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "\"E:\\BuildTools\\Katteker\\KattekerCreator.exe\" \"$(build.artifactstagingdirectory)\\bin\\$(BuildConfiguration)\\TfsMigrationTool.exe\" -O \"\\\\srv-lsimctrl01\\Squirrel\\TfsMigrationTool\" -P \"https://srv-lsimctrl01.enercon.de/squirrel/TfsMigrationTool\" -F \"**\\*.xml\" -S \"E:\\BuildTools\\certificate\\WRD_Code_Signing_Certificate_2019.pfx\" -Sp dpLRlzn7.Q,S"
|
||||
}
|
||||
}
|
||||
}
|
@ -2,15 +2,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Katteker;
|
||||
using KattekerCreator.Types;
|
||||
using Semver;
|
||||
|
||||
namespace KattekerCreator
|
||||
{
|
||||
public partial class SetupTmpl
|
||||
public partial class SetupTemplate
|
||||
{
|
||||
public string AppName
|
||||
{
|
||||
get => string.IsNullOrWhiteSpace(ReleaseChannel) ? _appName : $"{_appName}_{ReleaseChannel}";
|
||||
get => _appName + ReleaseChannel;
|
||||
set => _appName = value;
|
||||
}
|
||||
|
||||
@ -30,6 +31,7 @@ namespace KattekerCreator
|
||||
public string OutFile { get; set; }
|
||||
public string UninstallIcon { get; set; }
|
||||
public string ReleaseChannel { get; set; }
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
private readonly List<PathFragments> _directoriesList = new List<PathFragments>();
|
||||
private string _appName;
|
516
KattekerCreator/SetupTemplate.cs
Normal file
@ -0,0 +1,516 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 16.0.0.0
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
namespace KattekerCreator
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Class to produce the template output
|
||||
/// </summary>
|
||||
|
||||
#line 1 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
|
||||
public partial class SetupTemplate : SetupTemplateBase
|
||||
{
|
||||
#line hidden
|
||||
/// <summary>
|
||||
/// Create the template output
|
||||
/// </summary>
|
||||
public virtual string TransformText()
|
||||
{
|
||||
this.Write("Unicode true\r\nManifestDPIAware true\r\n!define APPNAME \"");
|
||||
|
||||
#line 8 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(AppName));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\n!define EXECUTABLE \"");
|
||||
|
||||
#line 9 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(Executable));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\n!define COMPANYNAME \"");
|
||||
|
||||
#line 10 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(CompanyName));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\n!define DESCRIPTION \"");
|
||||
|
||||
#line 11 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(Description));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\n!define ASSEMBLYNAME \"");
|
||||
|
||||
#line 12 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(AssemblyName));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\n!define VERSION ");
|
||||
|
||||
#line 13 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(Version.ToString()));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n!define HELPURL ");
|
||||
|
||||
#line 14 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(HelpUrl));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n!define INSTALLSIZE ");
|
||||
|
||||
#line 15 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(InstallSize));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n!define ISMANAGED ");
|
||||
|
||||
#line 16 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(IsManaged ? 1 : 0));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n; exampleCmd: makensis.exe /DVERSION=1.0.0.5 /DNAME=WpfApp1 Setup.nsi\r\n\r\nName \"" +
|
||||
"${APPNAME}\"\r\nOutFile \"");
|
||||
|
||||
#line 20 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(OutFile));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\nInstallDir \"$LOCALAPPDATA\\Programs\\${ASSEMBLYNAME}\"\r\nRequestExecutionLevel use" +
|
||||
"r\r\nSetCompressor /SOLID lzma\r\nSilentUnInstall silent\r\n; Subcaption 3 \" \"\r\nXPStyl" +
|
||||
"e on\r\nAutoCloseWindow true\r\nChangeUI all \"");
|
||||
|
||||
#line 28 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(UserInterface));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\nIcon \"");
|
||||
|
||||
#line 29 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(IconPath));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\"\r\nUninstallIcon \"${NSISDIR}\\Contrib\\Graphics\\Icons\\nsis3-uninstall.ico\"\r\nShowIns" +
|
||||
"tDetails nevershow \r\nShowUninstDetails nevershow \r\nBrandingText \"${COMPANYNAME}\"" +
|
||||
"\r\n\r\nVIProductVersion ");
|
||||
|
||||
#line 35 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(LegacyVersion.ToString(4)));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write(@"
|
||||
VIAddVersionKey ProductName ""${APPNAME}""
|
||||
VIAddVersionKey Comments """"
|
||||
VIAddVersionKey CompanyName ""${COMPANYNAME}""
|
||||
VIAddVersionKey LegalCopyright ""${COMPANYNAME}""
|
||||
VIAddVersionKey FileDescription ""${DESCRIPTION}""
|
||||
VIAddVersionKey FileVersion ""${VERSION}""
|
||||
VIAddVersionKey ProductVersion ""${VERSION}""
|
||||
VIAddVersionKey OriginalFilename """);
|
||||
|
||||
#line 43 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture(OutFile));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write(@"""
|
||||
|
||||
;--------------------------------
|
||||
; The stuff to install
|
||||
Section ""install"" ;No components page, name is not important
|
||||
DetailPrint 'Installing ${APPNAME}. Please wait...'
|
||||
SetShellVarContext current
|
||||
SetDetailsPrint None
|
||||
IfSilent +2
|
||||
RMDir /r $INSTDIR
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
; Create sub-directories
|
||||
");
|
||||
|
||||
#line 56 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
foreach(var directory in Directories) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 56 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture($" CreateDirectory \"$INSTDIR\\{directory}\"{Environment.NewLine}"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 56 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n ; Put file there\r\n");
|
||||
|
||||
#line 59 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
foreach(var file in Files) {
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 59 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
this.Write(this.ToStringHelper.ToStringWithCulture($" File \"/oname={file.Target}\" \"{file.Source}\"{Environment.NewLine}"));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 59 "C:\Strukturberechnung_del\Repos\Katteker\KattekerCreator\SetupTemplate.tt"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
this.Write("\r\n WriteUninstaller \"$INSTDIR\\uninstall.exe\"\r\n ; Desktop\r\n CreateShortCu" +
|
||||
"t \"$DESKTOP\\${APPNAME}.lnk\" \"$INSTDIR\\${EXECUTABLE}\"\r\n \r\n # Start Menu\r\n " +
|
||||
" CreateDirectory \"$SMPROGRAMS\\${COMPANYNAME}\"\r\n CreateShortCut \"$SMPROGRAMS\\" +
|
||||
"${COMPANYNAME}\\${APPNAME}.lnk\" \"$INSTDIR\\${EXECUTABLE}\"\r\n\r\n # Update pinned T" +
|
||||
"askbar\r\n IfFileExists \"$APPDATA\\Microsoft\\Internet Explorer\\Quick Launch\\User" +
|
||||
" Pinned\\TaskBar\\${APPNAME}.lnk\" 0 +2\r\n CreateShortCut \"$APPDATA\\Microsoft\\Int" +
|
||||
"ernet Explorer\\Quick Launch\\User Pinned\\TaskBar\\${APPNAME}.lnk\" \"$INSTDIR\\${EXEC" +
|
||||
"UTABLE}\"\r\n SetOutPath $INSTDIR\\app-${VERSION}\r\n StrCpy $0 ${EXECUTABLE} -4" +
|
||||
"\r\n IfFileExists \"$APPDATA\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinne" +
|
||||
"d\\TaskBar\\$0.lnk\" 0 +2\r\n CreateShortCut \"$APPDATA\\Microsoft\\Internet Explorer" +
|
||||
"\\Quick Launch\\User Pinned\\TaskBar\\$0.lnk\" \"$INSTDIR\\app-${VERSION}\\${EXECUTABLE}" +
|
||||
"\"\r\n \r\n # Registry information for add/remove programs\r\n WriteRegStr HKC" +
|
||||
"U \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"DisplayName\"" +
|
||||
" \"${APPNAME}\"\r\n WriteRegStr HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\U" +
|
||||
"ninstall\\${APPNAME}\" \"UninstallString\" \"$\\\"$INSTDIR\\uninstall.exe$\\\"\"\r\n Write" +
|
||||
"RegStr HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"Qu" +
|
||||
"ietUninstallString\" \"$\\\"$INSTDIR\\uninstall.exe$\\\" /S\"\r\n WriteRegStr HKCU \"Sof" +
|
||||
"tware\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"InstallLocation\" \"" +
|
||||
"$\\\"$INSTDIR$\\\"\"\r\n WriteRegStr HKCU \"Software\\Microsoft\\Windows\\CurrentVersion" +
|
||||
"\\Uninstall\\${APPNAME}\" \"DisplayIcon\" \"$\\\"$INSTDIR\\app-${VERSION}\\${EXECUTABLE}$\\" +
|
||||
"\"\"\r\n WriteRegStr HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${" +
|
||||
"APPNAME}\" \"Publisher\" \"${COMPANYNAME}\"\r\n ; WriteRegStr HKCU \"Software\\Microso" +
|
||||
"ft\\Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"HelpLink\" \"${HELPURL}\"\r\n Wri" +
|
||||
"teRegStr HKCU \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"" +
|
||||
"DisplayVersion\" \"${VERSION}\"\r\n # There is no option for modifying or repairin" +
|
||||
"g the install\r\n WriteRegDWORD HKCU \"Software\\Microsoft\\Windows\\CurrentVersion" +
|
||||
"\\Uninstall\\${APPNAME}\" \"NoModify\" 1\r\n WriteRegDWORD HKCU \"Software\\Microsoft\\" +
|
||||
"Windows\\CurrentVersion\\Uninstall\\${APPNAME}\" \"NoRepair\" 1\r\n # Set the INSTALL" +
|
||||
"SIZE constant (!defined at the top of this script) so Add/Remove Programs can ac" +
|
||||
"curately report the size\r\n WriteRegDWORD HKCU \"Software\\Microsoft\\Windows\\Cur" +
|
||||
"rentVersion\\Uninstall\\${APPNAME}\" \"EstimatedSize\" ${INSTALLSIZE}\r\nSectionEnd ; e" +
|
||||
"nd the section\r\n\r\nFunction .onInstSuccess\r\n IfSilent +2\r\n Exec \'\"$INSTDIR\\" +
|
||||
"${EXECUTABLE}\"\'\r\nFunctionEnd\r\n\r\nSection \"uninstall\"\r\n DetailPrint \'Please wai" +
|
||||
"t...\'\r\n SetShellVarContext current\r\n SetDetailsPrint None\r\n SetAutoClos" +
|
||||
"e true\r\n \r\n # Remove Start Menu launcher\r\n Delete \"$SMPROGRAMS\\${COMPAN" +
|
||||
"YNAME}\\${APPNAME}.lnk\"\r\n Delete \"$DESKTOP\\${APPNAME}.lnk\"\r\n StrCpy $0 ${EX" +
|
||||
"ECUTABLE} -4\r\n Delete \"$APPDATA\\Microsoft\\Internet Explorer\\Quick Launch\\User" +
|
||||
" Pinned\\TaskBar\\${APPNAME}.lnk\"\r\n Delete \"$APPDATA\\Microsoft\\Internet Explore" +
|
||||
"r\\Quick Launch\\User Pinned\\TaskBar\\$0.lnk\"\r\n # Try to remove the Start Menu f" +
|
||||
"older - this will only happen if it is empty\r\n RMDir \"$SMPROGRAMS\\${COMPANYNA" +
|
||||
"ME}\"\r\n\r\n # Always delete uninstaller as the last action\r\n delete $INSTDIR\\" +
|
||||
"uninstall.exe\r\n\r\n # Try to remove the install directory - this will only happ" +
|
||||
"en if it is empty\r\n RMDir /r /REBOOTOK $INSTDIR\r\n\r\n # Remove uninstaller i" +
|
||||
"nformation from the registry\r\n DeleteRegKey HKCU \"Software\\Microsoft\\Windows\\" +
|
||||
"CurrentVersion\\Uninstall\\${APPNAME}\"\r\nsectionEnd");
|
||||
return this.GenerationEnvironment.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#region Base class
|
||||
/// <summary>
|
||||
/// Base class for this transformation
|
||||
/// </summary>
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
|
||||
public class SetupTemplateBase
|
||||
{
|
||||
#region Fields
|
||||
private global::System.Text.StringBuilder generationEnvironmentField;
|
||||
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
|
||||
private global::System.Collections.Generic.List<int> indentLengthsField;
|
||||
private string currentIndentField = "";
|
||||
private bool endsWithNewline;
|
||||
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
|
||||
#endregion
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// The string builder that generation-time code is using to assemble generated output
|
||||
/// </summary>
|
||||
protected System.Text.StringBuilder GenerationEnvironment
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.generationEnvironmentField == null))
|
||||
{
|
||||
this.generationEnvironmentField = new global::System.Text.StringBuilder();
|
||||
}
|
||||
return this.generationEnvironmentField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.generationEnvironmentField = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The error collection for the generation process
|
||||
/// </summary>
|
||||
public System.CodeDom.Compiler.CompilerErrorCollection Errors
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.errorsField == null))
|
||||
{
|
||||
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
|
||||
}
|
||||
return this.errorsField;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// A list of the lengths of each indent that was added with PushIndent
|
||||
/// </summary>
|
||||
private System.Collections.Generic.List<int> indentLengths
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((this.indentLengthsField == null))
|
||||
{
|
||||
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
|
||||
}
|
||||
return this.indentLengthsField;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the current indent we use when adding lines to the output
|
||||
/// </summary>
|
||||
public string CurrentIndent
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currentIndentField;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Current transformation session
|
||||
/// </summary>
|
||||
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sessionField;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.sessionField = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Transform-time helpers
|
||||
/// <summary>
|
||||
/// Write text directly into the generated output
|
||||
/// </summary>
|
||||
public void Write(string textToAppend)
|
||||
{
|
||||
if (string.IsNullOrEmpty(textToAppend))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// If we're starting off, or if the previous text ended with a newline,
|
||||
// we have to append the current indent first.
|
||||
if (((this.GenerationEnvironment.Length == 0)
|
||||
|| this.endsWithNewline))
|
||||
{
|
||||
this.GenerationEnvironment.Append(this.currentIndentField);
|
||||
this.endsWithNewline = false;
|
||||
}
|
||||
// Check if the current text ends with a newline
|
||||
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
|
||||
{
|
||||
this.endsWithNewline = true;
|
||||
}
|
||||
// This is an optimization. If the current indent is "", then we don't have to do any
|
||||
// of the more complex stuff further down.
|
||||
if ((this.currentIndentField.Length == 0))
|
||||
{
|
||||
this.GenerationEnvironment.Append(textToAppend);
|
||||
return;
|
||||
}
|
||||
// Everywhere there is a newline in the text, add an indent after it
|
||||
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
|
||||
// If the text ends with a newline, then we should strip off the indent added at the very end
|
||||
// because the appropriate indent will be added when the next time Write() is called
|
||||
if (this.endsWithNewline)
|
||||
{
|
||||
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.GenerationEnvironment.Append(textToAppend);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Write text directly into the generated output
|
||||
/// </summary>
|
||||
public void WriteLine(string textToAppend)
|
||||
{
|
||||
this.Write(textToAppend);
|
||||
this.GenerationEnvironment.AppendLine();
|
||||
this.endsWithNewline = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Write formatted text directly into the generated output
|
||||
/// </summary>
|
||||
public void Write(string format, params object[] args)
|
||||
{
|
||||
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
|
||||
}
|
||||
/// <summary>
|
||||
/// Write formatted text directly into the generated output
|
||||
/// </summary>
|
||||
public void WriteLine(string format, params object[] args)
|
||||
{
|
||||
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
|
||||
}
|
||||
/// <summary>
|
||||
/// Raise an error
|
||||
/// </summary>
|
||||
public void Error(string message)
|
||||
{
|
||||
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
|
||||
error.ErrorText = message;
|
||||
this.Errors.Add(error);
|
||||
}
|
||||
/// <summary>
|
||||
/// Raise a warning
|
||||
/// </summary>
|
||||
public void Warning(string message)
|
||||
{
|
||||
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
|
||||
error.ErrorText = message;
|
||||
error.IsWarning = true;
|
||||
this.Errors.Add(error);
|
||||
}
|
||||
/// <summary>
|
||||
/// Increase the indent
|
||||
/// </summary>
|
||||
public void PushIndent(string indent)
|
||||
{
|
||||
if ((indent == null))
|
||||
{
|
||||
throw new global::System.ArgumentNullException("indent");
|
||||
}
|
||||
this.currentIndentField = (this.currentIndentField + indent);
|
||||
this.indentLengths.Add(indent.Length);
|
||||
}
|
||||
/// <summary>
|
||||
/// Remove the last indent that was added with PushIndent
|
||||
/// </summary>
|
||||
public string PopIndent()
|
||||
{
|
||||
string returnValue = "";
|
||||
if ((this.indentLengths.Count > 0))
|
||||
{
|
||||
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
|
||||
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
|
||||
if ((indentLength > 0))
|
||||
{
|
||||
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
|
||||
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
/// <summary>
|
||||
/// Remove any indentation
|
||||
/// </summary>
|
||||
public void ClearIndent()
|
||||
{
|
||||
this.indentLengths.Clear();
|
||||
this.currentIndentField = "";
|
||||
}
|
||||
#endregion
|
||||
#region ToString Helpers
|
||||
/// <summary>
|
||||
/// Utility class to produce culture-oriented representation of an object as a string.
|
||||
/// </summary>
|
||||
public class ToStringInstanceHelper
|
||||
{
|
||||
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
|
||||
/// <summary>
|
||||
/// Gets or sets format provider to be used by ToStringWithCulture method.
|
||||
/// </summary>
|
||||
public System.IFormatProvider FormatProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.formatProviderField ;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((value != null))
|
||||
{
|
||||
this.formatProviderField = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
|
||||
/// </summary>
|
||||
public string ToStringWithCulture(object objectToConvert)
|
||||
{
|
||||
if ((objectToConvert == null))
|
||||
{
|
||||
throw new global::System.ArgumentNullException("objectToConvert");
|
||||
}
|
||||
System.Type t = objectToConvert.GetType();
|
||||
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
|
||||
typeof(System.IFormatProvider)});
|
||||
if ((method == null))
|
||||
{
|
||||
return objectToConvert.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((string)(method.Invoke(objectToConvert, new object[] {
|
||||
this.formatProviderField })));
|
||||
}
|
||||
}
|
||||
}
|
||||
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
|
||||
/// <summary>
|
||||
/// Helper to produce culture-oriented representation of an object as a string
|
||||
/// </summary>
|
||||
public ToStringInstanceHelper ToStringHelper
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.toStringHelperField;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
@ -7,9 +7,9 @@ Unicode true
|
||||
ManifestDPIAware true
|
||||
!define APPNAME "<#= AppName #>"
|
||||
!define EXECUTABLE "<#= Executable #>"
|
||||
!define SOURCEPATH "<#= SourcePath #>"
|
||||
!define COMPANYNAME "<#= CompanyName #>"
|
||||
!define DESCRIPTION "<#= Description #>"
|
||||
!define ASSEMBLYNAME "<#= AssemblyName #>"
|
||||
!define VERSION <#= Version.ToString() #>
|
||||
!define HELPURL <#= HelpUrl #>
|
||||
!define INSTALLSIZE <#= InstallSize #>
|
||||
@ -18,7 +18,7 @@ ManifestDPIAware true
|
||||
|
||||
Name "${APPNAME}"
|
||||
OutFile "<#= OutFile #>"
|
||||
InstallDir "$LOCALAPPDATA\Programs\${APPNAME}"
|
||||
InstallDir "$LOCALAPPDATA\Programs\${ASSEMBLYNAME}"
|
||||
RequestExecutionLevel user
|
||||
SetCompressor /SOLID lzma
|
||||
SilentUnInstall silent
|
28
KattekerCreator/T4Extensions.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace KattekerCreator
|
||||
{
|
||||
internal static class T4Extensions
|
||||
{
|
||||
public static MethodInfo GetMethod(this Type type, string method, params Type[] parameters)
|
||||
{
|
||||
return type.GetRuntimeMethod(method, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.CodeDom.Compiler
|
||||
{
|
||||
public class CompilerErrorCollection : List<CompilerError>
|
||||
{
|
||||
}
|
||||
|
||||
public class CompilerError
|
||||
{
|
||||
public string ErrorText { get; set; }
|
||||
|
||||
public bool IsWarning { get; set; }
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ using Semver;
|
||||
using TsudaKageyu;
|
||||
using Vestris.ResourceLib;
|
||||
|
||||
namespace KattekerCreator
|
||||
namespace KattekerCreator.Types
|
||||
{
|
||||
public class AssemblyFileInfo
|
||||
{
|
||||
@ -18,25 +18,23 @@ namespace KattekerCreator
|
||||
public AssemblyFileInfo(string programFile, string version, string tempDir)
|
||||
{
|
||||
FileInfo = new FileInfo(programFile);
|
||||
using (var resourceInfo = new ResourceInfo())
|
||||
{
|
||||
resourceInfo.Load(programFile);
|
||||
if (resourceInfo.ResourceTypes.All(x => x.ResourceType != Kernel32.ResourceTypes.RT_VERSION)) return;
|
||||
var versionResource = (VersionResource) resourceInfo[Kernel32.ResourceTypes.RT_VERSION][0];
|
||||
var stringFileInfo = ((StringFileInfo) versionResource[nameof(StringFileInfo)]).Strings
|
||||
.FirstOrDefault().Value;
|
||||
AssemblyIconPath = GetAssemblyIcon(programFile, tempDir);
|
||||
if (stringFileInfo.Strings.ContainsKey("CompanyName"))
|
||||
_company = stringFileInfo.Strings["CompanyName"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("FileDescription"))
|
||||
_description = stringFileInfo.Strings["FileDescription"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("LegalCopyright"))
|
||||
_copyright = stringFileInfo.Strings["LegalCopyright"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("ProductName"))
|
||||
_productName = stringFileInfo.Strings["ProductName"].StringValue.TrimEnd('\0');
|
||||
if (!stringFileInfo.Strings.ContainsKey("ProductVersion")) return;
|
||||
AssemblyVersion = version != null ? GetSemanticVersion(version) : GetSemanticVersion(stringFileInfo.Strings["ProductVersion"].StringValue.TrimEnd('\0'));
|
||||
}
|
||||
using var resourceInfo = new ResourceInfo();
|
||||
resourceInfo.Load(programFile);
|
||||
if (resourceInfo.ResourceTypes.All(x => x.ResourceType != Kernel32.ResourceTypes.RT_VERSION)) return;
|
||||
var versionResource = (VersionResource)resourceInfo[Kernel32.ResourceTypes.RT_VERSION][0];
|
||||
var stringFileInfo = ((StringFileInfo)versionResource[nameof(StringFileInfo)]).Strings
|
||||
.FirstOrDefault().Value;
|
||||
AssemblyIconPath = GetAssemblyIcon(programFile, tempDir);
|
||||
if (stringFileInfo.Strings.ContainsKey("CompanyName"))
|
||||
_company = stringFileInfo.Strings["CompanyName"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("FileDescription"))
|
||||
_description = stringFileInfo.Strings["FileDescription"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("LegalCopyright"))
|
||||
_copyright = stringFileInfo.Strings["LegalCopyright"].StringValue.TrimEnd('\0');
|
||||
if (stringFileInfo.Strings.ContainsKey("ProductName"))
|
||||
_productName = stringFileInfo.Strings["ProductName"].StringValue.TrimEnd('\0');
|
||||
if (!stringFileInfo.Strings.ContainsKey("ProductVersion")) return;
|
||||
AssemblyVersion = version != null ? GetSemanticVersion(version) : GetSemanticVersion(stringFileInfo.Strings["ProductVersion"].StringValue.TrimEnd('\0'));
|
||||
}
|
||||
|
||||
public string AssemblyIconPath { get; }
|
||||
@ -64,17 +62,13 @@ namespace KattekerCreator
|
||||
try
|
||||
{
|
||||
var ie = new IconExtractor(programFile);
|
||||
using (var icon = ie.GetIcon(0))
|
||||
{
|
||||
icon?.Save(fileStream);
|
||||
}
|
||||
using var icon = ie.GetIcon(0);
|
||||
icon?.Save(fileStream);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
using (var icon = Icon.ExtractAssociatedIcon(programFile))
|
||||
{
|
||||
icon?.Save(fileStream);
|
||||
}
|
||||
using var icon = Icon.ExtractAssociatedIcon(programFile);
|
||||
icon?.Save(fileStream);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
// ReSharper disable All
|
||||
|
||||
namespace Minimatch
|
||||
{
|
||||
@ -482,7 +483,7 @@ namespace Minimatch
|
||||
: options.Dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))"
|
||||
: "(?!\\.)";
|
||||
|
||||
Action clearStateChar = () =>
|
||||
void clearStateChar()
|
||||
{
|
||||
if (stateChar != null)
|
||||
{
|
||||
@ -504,7 +505,7 @@ namespace Minimatch
|
||||
}
|
||||
stateChar = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
for (var i = 0; i < pattern.Length; i++)
|
||||
{
|
@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace KattekerCreator
|
||||
namespace KattekerCreator.Types
|
||||
{
|
||||
public struct PathFragments
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace KattekerCreator
|
||||
|
||||
public override bool Equals(object obj) => string.Equals(ToString(), obj?.ToString());
|
||||
|
||||
public override int GetHashCode() => (_fragments != null ? _fragments.GetHashCode() : 0);
|
||||
public override int GetHashCode() => _fragments != null ? _fragments.GetHashCode() : 0;
|
||||
|
||||
public override string ToString() => string.Join(Path.DirectorySeparatorChar.ToString(), _fragments.Take(_fragments.Length - 1));
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace KattekerCreator
|
||||
namespace KattekerCreator.Types
|
||||
{
|
||||
public struct PhysicalFile
|
||||
{
|
42
KattekerCreator/Types/TemporaryDirectory.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace KattekerCreator.Types
|
||||
{
|
||||
public class TemporaryDirectory : IDisposable
|
||||
{
|
||||
public string Path { get; }
|
||||
|
||||
public TemporaryDirectory(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
try
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
Directory.Delete(Path, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Try it, catch it, forget it.
|
||||
}
|
||||
}
|
||||
|
||||
public static TemporaryDirectory Create()
|
||||
{
|
||||
string result;
|
||||
do
|
||||
{
|
||||
result = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "temp", Environment.UserName,
|
||||
System.IO.Path.GetRandomFileName());
|
||||
} while (Directory.Exists(result));
|
||||
|
||||
Directory.CreateDirectory(result);
|
||||
return new TemporaryDirectory(result);
|
||||
}
|
||||
}
|
||||
}
|
BIN
KattekerCreator/app.ico
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
KattekerCreator/contrib/signtool.exe
Normal file
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
144
KattekerCreator/nsis/COPYING
Normal file
@ -0,0 +1,144 @@
|
||||
COPYRIGHT
|
||||
---------
|
||||
|
||||
Copyright (C) 1999-2018 Contributors
|
||||
|
||||
More detailed copyright information can be found in the individual source code files.
|
||||
|
||||
APPLICABLE LICENSES
|
||||
-------------------
|
||||
|
||||
* All NSIS source code, plug-ins, documentation, examples, header files and graphics, with the exception of the compression modules and where otherwise noted, are licensed under the zlib/libpng license.
|
||||
|
||||
* The zlib compression module for NSIS is licensed under the zlib/libpng license.
|
||||
|
||||
* The bzip2 compression module for NSIS is licensed under the bzip2 license.
|
||||
|
||||
* The LZMA compression module for NSIS is licensed under the Common Public License version 1.0.
|
||||
|
||||
ZLIB/LIBPNG LICENSE
|
||||
-------------------
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
BZIP2 LICENSE
|
||||
-------------
|
||||
|
||||
This program, "bzip2" and associated library "libbzip2", are copyright (C) 1996-2000 Julian R Seward. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Julian Seward, Cambridge, UK.
|
||||
|
||||
jseward@acm.org
|
||||
|
||||
COMMON PUBLIC LICENSE VERSION 1.0
|
||||
---------------------------------
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
||||
|
||||
SPECIAL EXCEPTION FOR LZMA COMPRESSION MODULE
|
||||
---------------------------------------------
|
||||
|
||||
Igor Pavlov and Amir Szekely, the authors of the LZMA compression module for NSIS, expressly permit you to statically or dynamically link your code (or bind by name) to the files from the LZMA compression module for NSIS without subjecting your linked code to the terms of the Common Public license version 1.0. Any modifications or additions to files from the LZMA compression module for NSIS, however, are subject to the terms of the Common Public License version 1.0.
|
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/big.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/classic-cross.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/classic.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/colorful.bmp
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/grey-cross.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/grey.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/modern.bmp
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/red-round.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/red.bmp
Normal file
After Width: | Height: | Size: 886 B |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/simple-round.bmp
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/simple-round2.bmp
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Checks/simple.bmp
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis-r.bmp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis.bmp
Normal file
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 25 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis3-branding.bmp
Normal file
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 8.7 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis3-grey.bmp
Normal file
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 25 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis3-metro.bmp
Normal file
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 8.8 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/nsis3-vintage.bmp
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/orange-nsis.bmp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
KattekerCreator/nsis/Contrib/Graphics/Header/orange-r-nsis.bmp
Normal file
After Width: | Height: | Size: 9.5 KiB |