From be052fde811d5c41ac6fb36441aafa3e6b7ad80f Mon Sep 17 00:00:00 2001
From: elzik <23397871+elzik@users.noreply.github.com>
Date: Sun, 15 Oct 2023 20:29:51 +0100
Subject: [PATCH] Installer improvements
---
...ous-integration.ps1 => build-and-test.ps1} | 4 +---
Build/build-windows-installer.ps1 | 20 +++++++++++++++++++
Elzik.FmSync.sln | 11 ++++------
.../ConsoleComponentGroup.wxs | 4 ++--
.../Elzik.FmSync.WindowsInstaller.wixproj | 2 +-
.../Elzik.FmSync.WindowsInstaller/Folders.wxs | 0
.../Elzik.FmSync.WindowsInstaller/LICENSE.rtf | 0
.../Package.en-us.wxl | 0
.../Elzik.FmSync.WindowsInstaller/Package.wxs | 0
.../WorkerComponentGroup.wxs | 4 ++--
Publish/local-install.ps1 | 18 -----------------
Publish/publish.ps1 | 18 -----------------
12 files changed, 30 insertions(+), 51 deletions(-)
rename Build/{continuous-integration.ps1 => build-and-test.ps1} (88%)
create mode 100644 Build/build-windows-installer.ps1
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs (78%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj (78%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/Folders.wxs (100%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/LICENSE.rtf (100%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/Package.en-us.wxl (100%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/Package.wxs (100%)
rename {Publish => Installer}/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs (86%)
delete mode 100644 Publish/local-install.ps1
delete mode 100644 Publish/publish.ps1
diff --git a/Build/continuous-integration.ps1 b/Build/build-and-test.ps1
similarity index 88%
rename from Build/continuous-integration.ps1
rename to Build/build-and-test.ps1
index 8988891..f0919c8 100644
--- a/Build/continuous-integration.ps1
+++ b/Build/build-and-test.ps1
@@ -1,7 +1,5 @@
-dotnet build $PSScriptRoot\..\Elzik.FmSync.sln
-
dotnet test `
- --no-build `
+ -c Release `
--verbosity normal `
-p:CollectCoverage=true `
-p:CoverletOutput=TestResults/coverage.opencover.xml `
diff --git a/Build/build-windows-installer.ps1 b/Build/build-windows-installer.ps1
new file mode 100644
index 0000000..12490e7
--- /dev/null
+++ b/Build/build-windows-installer.ps1
@@ -0,0 +1,20 @@
+dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Worker\Elzik.FmSync.Worker.csproj `
+ --runtime win-x64 `
+ --self-contained true `
+ --configuration Release `
+ -p:Platform=x64 `
+ -p:PublishSingleFile=true
+
+dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Console\Elzik.FmSync.Console.csproj `
+ --runtime win-x64 `
+ --self-contained true `
+ --configuration Release `
+ -p:Platform=x64 `
+ -p:PublishSingleFile=true
+
+dotnet build $PSScriptRoot\..\Installer\Elzik.FmSync.WindowsInstaller\Elzik.FmSync.WindowsInstaller.wixproj `
+ --runtime win-x64 `
+ --self-contained true `
+ --configuration Release `
+ -p:Platform=x64 `
+ -p:PublishSingleFile=true
diff --git a/Elzik.FmSync.sln b/Elzik.FmSync.sln
index 2a0b1b2..d118feb 100644
--- a/Elzik.FmSync.sln
+++ b/Elzik.FmSync.sln
@@ -26,16 +26,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{0FE56BA0-BDDF-4291-9BDD-A6D512610FAE}"
ProjectSection(SolutionItems) = preProject
- Build\continuous-integration.ps1 = Build\continuous-integration.ps1
+ Build\build-and-test.ps1 = Build\build-and-test.ps1
+ Build\build-windows-installer.ps1 = Build\build-windows-installer.ps1
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Publish", "Publish", "{069FD2C8-3AFB-4D61-A19A-3257331FC223}"
- ProjectSection(SolutionItems) = preProject
- Publish\local-install.ps1 = Publish\local-install.ps1
- Publish\publish.ps1 = Publish\publish.ps1
- EndProjectSection
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installer", "Installer", "{069FD2C8-3AFB-4D61-A19A-3257331FC223}"
EndProject
-Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Elzik.FmSync.WindowsInstaller", "Publish\Elzik.FmSync.WindowsInstaller\Elzik.FmSync.WindowsInstaller.wixproj", "{534679A3-D29B-4D63-882B-C09F4D0EA8CB}"
+Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Elzik.FmSync.WindowsInstaller", "Installer\Elzik.FmSync.WindowsInstaller\Elzik.FmSync.WindowsInstaller.wixproj", "{534679A3-D29B-4D63-882B-C09F4D0EA8CB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs b/Installer/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs
similarity index 78%
rename from Publish/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs
rename to Installer/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs
index 6ed1ec1..094b821 100644
--- a/Publish/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs
+++ b/Installer/Elzik.FmSync.WindowsInstaller/ConsoleComponentGroup.wxs
@@ -3,7 +3,7 @@
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj b/Installer/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj
similarity index 78%
rename from Publish/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj
rename to Installer/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj
index a69efc4..1ee09aa 100644
--- a/Publish/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj
+++ b/Installer/Elzik.FmSync.WindowsInstaller/Elzik.FmSync.WindowsInstaller.wixproj
@@ -1,12 +1,12 @@
-
+
\ No newline at end of file
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/Folders.wxs b/Installer/Elzik.FmSync.WindowsInstaller/Folders.wxs
similarity index 100%
rename from Publish/Elzik.FmSync.WindowsInstaller/Folders.wxs
rename to Installer/Elzik.FmSync.WindowsInstaller/Folders.wxs
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/LICENSE.rtf b/Installer/Elzik.FmSync.WindowsInstaller/LICENSE.rtf
similarity index 100%
rename from Publish/Elzik.FmSync.WindowsInstaller/LICENSE.rtf
rename to Installer/Elzik.FmSync.WindowsInstaller/LICENSE.rtf
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/Package.en-us.wxl b/Installer/Elzik.FmSync.WindowsInstaller/Package.en-us.wxl
similarity index 100%
rename from Publish/Elzik.FmSync.WindowsInstaller/Package.en-us.wxl
rename to Installer/Elzik.FmSync.WindowsInstaller/Package.en-us.wxl
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/Package.wxs b/Installer/Elzik.FmSync.WindowsInstaller/Package.wxs
similarity index 100%
rename from Publish/Elzik.FmSync.WindowsInstaller/Package.wxs
rename to Installer/Elzik.FmSync.WindowsInstaller/Package.wxs
diff --git a/Publish/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs b/Installer/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs
similarity index 86%
rename from Publish/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs
rename to Installer/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs
index 68e49e7..cefb062 100644
--- a/Publish/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs
+++ b/Installer/Elzik.FmSync.WindowsInstaller/WorkerComponentGroup.wxs
@@ -6,7 +6,7 @@
@@ -28,7 +28,7 @@
diff --git a/Publish/local-install.ps1 b/Publish/local-install.ps1
deleted file mode 100644
index 2ca9b3c..0000000
--- a/Publish/local-install.ps1
+++ /dev/null
@@ -1,18 +0,0 @@
-# Install console app
-robocopy $PSScriptRoot\output\Elzik.FmSync.Console\win-x64 "c:\program files\fmsync\console" /e
-
-# Install worker service
-Stop-Service -Name 'fmsync'
-Remove-Service -Name 'fmsync'
-
-robocopy $PSScriptRoot\output\Elzik.FmSync.Worker\win-x64 "c:\program files\fmsync\worker" /e
-
-(get-content "c:\program files\fmsync\worker\appSettings.json") `
- | foreach-object {$_ -replace '"WatchedDirectoryPaths": \[\]', '"WatchedDirectoryPaths": ["C:\\Users\\justin.elzik\\Obsidian"]'}
- | foreach-object {$_ -replace '"MinimumLevel": "Information"', '"MinimumLevel": "Debug"'} `
- | set-content "c:\program files\fmsync\worker\appSettings.json"
-
-New-Service -Name 'fmsync' `
- -BinaryPathName 'c:\program files\fmsync\worker\Elzik.FmSync.Worker.exe' `
- -StartupType Automatic
-Start-Service -Name 'fmsync'
\ No newline at end of file
diff --git a/Publish/publish.ps1 b/Publish/publish.ps1
deleted file mode 100644
index 00cb163..0000000
--- a/Publish/publish.ps1
+++ /dev/null
@@ -1,18 +0,0 @@
-$runtimes = "win-x64", "osx-x64"
-
-foreach ($runtime in $runtimes)
-{
- dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Worker\Elzik.FmSync.Worker.csproj `
- -r $runtime `
- --self-contained true `
- -c Release `
- -o $PSScriptRoot\output\Elzik.FmSync.Worker\$runtime `
- -p:PublishSingleFile=true
-
- dotnet publish $PSScriptRoot\..\src\Elzik.FmSync.Console\Elzik.FmSync.Console.csproj `
- -r $runtime `
- --self-contained true `
- -c Release `
- -o $PSScriptRoot\output\Elzik.FmSync.Console\$runtime `
- -p:PublishSingleFile=true
-}