diff --git a/HAClimateDeskband/HAClimateDeskband.csproj b/HAClimateDeskband/HAClimateDeskband.csproj index a0dddc4..dbd9015 100644 --- a/HAClimateDeskband/HAClimateDeskband.csproj +++ b/HAClimateDeskband/HAClimateDeskband.csproj @@ -26,7 +26,7 @@ pdbonly true - bin\Release\ + ..\HAClimateDeskBand-win-x64\ TRACE;DESKBAND_WINFORMS prompt 4 @@ -134,4 +134,15 @@ + + if $(ConfigurationName) == Release ( + $(ILMergeConsolePath) /out:$(OutDir)HAClimateDeskband-merged.dll $(OutDir)HAClimateDeskband.dll $(OutDir)Newtonsoft.Json.dll $(OutDir)OxyPlot.dll $(OutDir)OxyPlot.WindowsForms.dll + del /F /Q "$(OutDir)HAClimateDeskband.dll" + del /F /Q "$(OutDir)HAClimateDeskband.pdb" + del /F /Q "$(OutDir)Newtonsoft.Json.dll" + del /F /Q "$(OutDir)OxyPlot.dll" + del /F /Q "$(OutDir)OxyPlot.WindowsForms.dll" + del /F /Q "$(OutDir)HAClimateDeskband-merged.pdb" +) + \ No newline at end of file diff --git a/HAClimateDeskbandInstaller/HAClimateDeskbandInstaller.csproj b/HAClimateDeskbandInstaller/HAClimateDeskbandInstaller.csproj index 6712c8d..697b83d 100644 --- a/HAClimateDeskbandInstaller/HAClimateDeskbandInstaller.csproj +++ b/HAClimateDeskbandInstaller/HAClimateDeskbandInstaller.csproj @@ -27,7 +27,7 @@ AnyCPU pdbonly true - bin\Release\ + ..\HAClimateDeskBand-win-x64\ TRACE prompt 4 @@ -66,9 +66,9 @@ - - Resources\HAClimateDeskband.dll - + + Resources\HAClimateDeskband-merged.dll + @@ -78,4 +78,12 @@ + + + + + + + + \ No newline at end of file diff --git a/HAClimateDeskbandInstaller/Program.cs b/HAClimateDeskbandInstaller/Program.cs index 4b62376..29a37cf 100644 --- a/HAClimateDeskbandInstaller/Program.cs +++ b/HAClimateDeskbandInstaller/Program.cs @@ -11,7 +11,7 @@ namespace HAClimateDeskbandInstaller class Program { private const string InstallerExecutableName = "HAClimateDeskbandInstaller.exe"; - private const string DllName = "HAClimateDeskband.dll"; + private const string DllName = "HAClimateDeskband-merged.dll"; static Guid UninstallGuid = new Guid(@"2d0e746f-e2ae-4c2c-9040-5c5a715e7a8a"); class InstallInfo @@ -88,7 +88,7 @@ static void Install(InstallInfo info) // Register assemblies foreach (string filename in info.FilesToRegister) { - string targetFilePath = Path.Combine(info.TargetPath, filename); + string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty)); Console.Write($"Registering {filename}.. "); RegisterDLL(targetFilePath, true, false); Console.WriteLine("OK."); @@ -114,11 +114,11 @@ static void Install(InstallInfo info) private static void CopyFiles(InstallInfo info) { - foreach (string item in info.FilesToCopy) + foreach (string filename in info.FilesToCopy) { - string targetFilePath = Path.Combine(info.TargetPath, item); - Console.Write($"Copying {item}.. "); - WriteEmbeddedResourceToFile(item, targetFilePath); + string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty)); + Console.Write($"Copying {filename}.. "); + WriteEmbeddedResourceToFile(filename, targetFilePath); Console.WriteLine("OK."); } } @@ -141,7 +141,7 @@ static bool RollBack(InstallInfo info) // Unregister assembly foreach (string item in info.FilesToRegister) { - string targetFilePath = Path.Combine(info.TargetPath, item); + string targetFilePath = Path.Combine(info.TargetPath, item.Replace("-merged", string.Empty)); RegisterDLL(targetFilePath, false, true); RegisterDLL(targetFilePath, true, true); } @@ -151,13 +151,13 @@ static bool RollBack(InstallInfo info) restartExplorer.Execute(() => { // Remove files - foreach (string item in info.FilesToCopy) + foreach (string filename in info.FilesToCopy) { - string targetFilePath = Path.Combine(info.TargetPath, item); + string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty)); if (File.Exists(targetFilePath)) { - Console.Write($"Deleting {item}.. "); + Console.Write($"Deleting {filename}.. "); File.Delete(targetFilePath); Console.WriteLine("OK."); }