Skip to content

Commit

Permalink
- More changes to fix installer / builds
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaBear84 committed Mar 24, 2021
1 parent 8c7673e commit c69965a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
3 changes: 3 additions & 0 deletions HAClimateDeskband.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HAClimateDeskband", "HAClimateDeskband\HAClimateDeskband.csproj", "{4EE0B5C1-E49B-4CE8-AD43-75DB00104A00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HAClimateDeskbandInstaller", "HAClimateDeskbandInstaller\HAClimateDeskbandInstaller.csproj", "{01653002-E017-4F43-9961-5624D588EBE5}"
ProjectSection(ProjectDependencies) = postProject
{4EE0B5C1-E49B-4CE8-AD43-75DB00104A00} = {4EE0B5C1-E49B-4CE8-AD43-75DB00104A00}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
13 changes: 2 additions & 11 deletions HAClimateDeskband/HAClimateDeskband.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,6 @@
<Version>3.0.41</Version>
</PackageReference>
</ItemGroup>
<Target Name="ILMerge">
<!-- the ILMergePath property points to the location of ILMerge.exe console application -->
<Exec Command="$(ILMergeConsolePath) /out:$(OutDir)HAClimateDeskband-merged.dll $(OutDir)HAClimateDeskband.dll $(OutDir)Newtonsoft.Json.dll $(OutDir)OxyPlot.dll $(OutDir)OxyPlot.WindowsForms.dll" />
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskband.dll&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskband.pdb&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)Newtonsoft.Json.dll&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)OxyPlot.dll&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)OxyPlot.WindowsForms.dll&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskband-merged.pdb&quot;" />
<Exec Command="ren &quot;$(OutDir)HAClimateDeskband-merged.dll&quot; &quot;$(OutDir)HAClimateDeskband.dll&quot;" />
</Target>
<ItemGroup>
<None Include="Resources\Flame.png" />
</ItemGroup>
Expand All @@ -143,6 +132,8 @@
del /F /Q "$(OutDir)OxyPlot.dll"
del /F /Q "$(OutDir)OxyPlot.WindowsForms.dll"
del /F /Q "$(OutDir)HAClimateDeskband-merged.pdb"
copy /Y "$(OutDir)HAClimateDeskband-merged.dll" "$(OutDir)HAClimateDeskband.dll"
del /F /Q "$(OutDir)HAClimateDeskband-merged.dll"
)</PostBuildEvent>
</PropertyGroup>
</Project>
30 changes: 18 additions & 12 deletions HAClimateDeskbandInstaller/HAClimateDeskbandInstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@
<PropertyGroup>
<ApplicationIcon>Resources\HomeAssistant.ico</ApplicationIcon>
</PropertyGroup>
<Target Name="ILMerge">
<!-- the ILMergePath property points to the location of ILMerge.exe console application -->
<!-- Replaced with Embedded Resource -->
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskband.dll&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskbandInstaller.pdb&quot;" />
<Exec Command="del /F /Q &quot;$(OutDir)HAClimateDeskbandInstaller.exe.config&quot;" />
</Target>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -66,21 +59,34 @@
<None Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<Content Include="..\HAClimateDeskBand-win-x64\HAClimateDeskband-merged.dll">
<Link>Resources\HAClimateDeskband-merged.dll</Link>
</Content>
<EmbeddedResource Include="..\HAClimateDeskBand-win-x64\HAClimateDeskband.dll">
<Link>Resources\HAClimateDeskband.dll</Link>
</EmbeddedResource>
<Content Include="Resources\HomeAssistant.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ILMerge">
<Version>3.0.41</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HAClimateDeskband\HAClimateDeskband.csproj">
<Project>{4ee0b5c1-e49b-4ce8-ad43-75db00104a00}</Project>
<Name>HAClimateDeskband</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\BuildCommon.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>if $(ConfigurationName) == Release (
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)HAClimateDeskbandInstaller.exe.config"
del /F /Q "$(OutDir)HAClimateDeskbandInstaller.pdb"
)</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
Expand Down
10 changes: 5 additions & 5 deletions HAClimateDeskbandInstaller/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace HAClimateDeskbandInstaller
class Program
{
private const string InstallerExecutableName = "HAClimateDeskbandInstaller.exe";
private const string DllName = "HAClimateDeskband-merged.dll";
private const string DllName = "HAClimateDeskband.dll";
static Guid UninstallGuid = new Guid(@"2d0e746f-e2ae-4c2c-9040-5c5a715e7a8a");

class InstallInfo
Expand Down Expand Up @@ -88,7 +88,7 @@ static void Install(InstallInfo info)
// Register assemblies
foreach (string filename in info.FilesToRegister)
{
string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty));
string targetFilePath = Path.Combine(info.TargetPath, filename);
Console.Write($"Registering {filename}.. ");
RegisterDLL(targetFilePath, true, false);
Console.WriteLine("OK.");
Expand Down Expand Up @@ -116,7 +116,7 @@ private static void CopyFiles(InstallInfo info)
{
foreach (string filename in info.FilesToCopy)
{
string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty));
string targetFilePath = Path.Combine(info.TargetPath, filename);
Console.Write($"Copying {filename}.. ");
WriteEmbeddedResourceToFile(filename, targetFilePath);
Console.WriteLine("OK.");
Expand All @@ -141,7 +141,7 @@ static bool RollBack(InstallInfo info)
// Unregister assembly
foreach (string item in info.FilesToRegister)
{
string targetFilePath = Path.Combine(info.TargetPath, item.Replace("-merged", string.Empty));
string targetFilePath = Path.Combine(info.TargetPath, item);
RegisterDLL(targetFilePath, false, true);
RegisterDLL(targetFilePath, true, true);
}
Expand All @@ -153,7 +153,7 @@ static bool RollBack(InstallInfo info)
// Remove files
foreach (string filename in info.FilesToCopy)
{
string targetFilePath = Path.Combine(info.TargetPath, filename.Replace("-merged", string.Empty));
string targetFilePath = Path.Combine(info.TargetPath, filename);

if (File.Exists(targetFilePath))
{
Expand Down

0 comments on commit c69965a

Please sign in to comment.