Skip to content

Commit

Permalink
Added installer and updated to .net 6
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed May 18, 2022
1 parent ba48a16 commit 78fc6c1
Show file tree
Hide file tree
Showing 9 changed files with 897 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,5 @@ obj/
# Additional files built by Visual Studio

# End of https://www.toptal.com/developers/gitignore/api/visualstudio,dotnetcore,csharp

build_installer
807 changes: 807 additions & 0 deletions CodeDependencies/CodeDependencies.iss

Large diffs are not rendered by default.

Binary file added CodeDependencies/netcorecheck_x64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Bartosz Cichecki
Copyright (c) 2022 Bartosz Cichecki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LenovoLegionToolkit.Lib/LenovoLegionToolkit.Lib.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion LenovoLegionToolkit.Lib/Utils/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Trace(FormattableString message,
{
var date = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
var fileName = Path.GetFileName(file);
var line = $"[{date}] [{Thread.CurrentThread.ManagedThreadId}] [{fileName}#{lineNumber}:{caller}] {message}";
var line = $"[{date}] [{Environment.CurrentManagedThreadId}] [{fileName}#{lineNumber}:{caller}] {message}";
File.AppendAllLines(_logPath, new[] { line });
}
}
Expand Down
5 changes: 3 additions & 2 deletions LenovoLegionToolkit.WPF/LenovoLegionToolkit.WPF.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<OutputType>WinExe</OutputType>
<ApplicationIcon>icon.ico</ApplicationIcon>
Expand All @@ -11,9 +11,10 @@
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishSingleFile>false</PublishSingleFile>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<PublishUrl>publish\</PublishUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand Down
18 changes: 17 additions & 1 deletion make.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
@echo off

IF "%1"=="" (
SET VERSION=0.0.1
) ELSE (
SET VERSION=%1
)


SET PATH=%PATH%;"C:\Program Files (x86)\Inno Setup 6"

rmdir /s /q build
rmdir /s /q build_installer

dotnet clean
dotnet publish LenovoLegionToolkit.WPF -c release -o build /p:DebugType=None /p:FileVersion=0.0.1 /p:Version=0.0.1
dotnet publish LenovoLegionToolkit.WPF -c release -o build /p:DebugType=None /p:FileVersion=%VERSION% /p:Version=%VERSION%

iscc make_installer.iss /DMyAppVersion=%VERSION%
65 changes: 65 additions & 0 deletions make_installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#define public Dependency_NoExampleSetup

#include "CodeDependencies\CodeDependencies.iss"

#define MyAppName "Lenovo Legion Toolkit"
#define MyAppNameCompact "LenovoLegionToolkit"
#define MyAppPublisher "Bartosz Cichecki"
#define MyAppURL "https://github.com/BartoszCichecki/LenovoLegionToolkit"
#define MyAppExeName "Lenovo Legion Toolkit.exe"

#ifndef MyAppVersion
#define MyAppVersion "0.0.1"
#endif

[Setup]
UsedUserAreasWarning=false
AppId={{0C37B9AC-9C3D-4302-8ABB-125C7C7D83D5}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppNameCompact}
DisableDirPage=yes
DisableProgramGroupPage=yes
LicenseFile=LICENSE.md
PrivilegesRequired=admin
OutputBaseFilename=LenovoLegionToolkitSetup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon={app}\{#MyAppExeName}
OutputDir=build_installer
ArchitecturesInstallIn64BitMode=x64

[Code]
function InitializeSetup: Boolean;
begin
Dependency_AddDotNet60Desktop;
Result := True;
end;
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "build\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "CodeDependencies\netcorecheck_x64.exe"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: runascurrentuser nowait postinstall skipifsilent

[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\{#MyAppNameCompact}"

[UninstallRun]
RunOnceId: "DelAutorun"; Filename: "schtasks"; Parameters: "/Delete /TN ""LenovoLegionToolkit_Autorun_6efcc882-924c-4cbc-8fec-f45c25696f98"" /F"; Flags: runhidden

0 comments on commit 78fc6c1

Please sign in to comment.