Skip to content

Commit

Permalink
Produce installer binaries for older Revit versions
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgDangl committed May 5, 2024
1 parent 9cc431b commit a69ae0b
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 356 deletions.
46 changes: 32 additions & 14 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using Newtonsoft.Json;
using System.IO.Compression;
using Nuke.Common.Utilities;
using System.Configuration;

class Build : NukeBuild
{
Expand Down Expand Up @@ -250,17 +251,30 @@ public static class FileVersionProvider
.DependsOn(BuildElectronApp)
.Executes(() =>
{
CopyDirectoryRecursively(SourceDirectory / "ipa-bcfier-ui" / "dist" / "ipa-bcfier-ui" / "browser", SourceDirectory / "IPA.Bcfier.Revit" / "Resources" / "Browser", DirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite);
CopyDirectoryRecursively(SourceDirectory / "ipa-bcfier-ui" / "dist" / "ipa-bcfier-ui" / "browser",
SourceDirectory / "IPA.Bcfier.Revit" / "Resources" / "Browser",
DirectoryExistsPolicy.Merge,
FileExistsPolicy.Overwrite);
var pluginOutputDirectory = OutputDirectory / "RevitPlugin";

DotNetBuild(c => c.SetProjectFile(SourceDirectory / "IPA.Bcfier.Revit" / "IPA.Bcfier.Revit.csproj")
.SetConfiguration("Release")
.SetOutputDirectory(pluginOutputDirectory)
.SetAssemblyVersion(GitVersion.AssemblySemVer)
.SetFileVersion(GitVersion.AssemblySemVer)
.SetInformationalVersion(GitVersion.InformationalVersion)
.EnableNoRestore());
SignExecutablesInFolder(pluginOutputDirectory, includeDll: true);
var configurations = new[]
{
"Release-2024",
"Release-2023",
"Release-2022",
"Release-2021"
};
foreach (var configuration in configurations)
{
var outputDirectory = pluginOutputDirectory / configuration;
DotNetBuild(c => c.SetProjectFile(SourceDirectory / "IPA.Bcfier.Revit" / "IPA.Bcfier.Revit.csproj")
.SetConfiguration(configuration)
.SetOutputDirectory(outputDirectory)
.SetAssemblyVersion(GitVersion.AssemblySemVer)
.SetFileVersion(GitVersion.AssemblySemVer)
.SetInformationalVersion(GitVersion.InformationalVersion));
SignExecutablesInFolder(outputDirectory, includeDll: true);
}

File.Copy(SourceDirectory / "IPA.Bcfier.Revit" / "Installer.iss", pluginOutputDirectory / "Installer.iss", overwrite: true);

Expand All @@ -271,11 +285,15 @@ public static class FileVersionProvider
ZipFile.ExtractToDirectory(zipStream, installerDirectory / "bcfier-app");

CopyDirectoryRecursively(SourceDirectory / "IPA.Bcfier.Revit" / "InstallerAssets", installerDirectory / "InstallerAssets", DirectoryExistsPolicy.Merge, FileExistsPolicy.Overwrite);
File.Copy(pluginOutputDirectory / "Dangl.BCF.dll", installerDirectory / "Dangl.BCF.dll");
File.Copy(pluginOutputDirectory / "IPA.Bcfier.dll", installerDirectory / "IPA.Bcfier.dll");
File.Copy(pluginOutputDirectory / "IPA.Bcfier.Revit.dll", installerDirectory / "IPA.Bcfier.Revit.dll");
File.Copy(pluginOutputDirectory / "DecimalEx.dll", installerDirectory / "DecimalEx.dll");
File.Copy(pluginOutputDirectory / "IPA.Bcfier.Revit.addin", installerDirectory / "IPA.Bcfier.Revit.addin");
foreach (var configuration in configurations)
{
(installerDirectory / configuration).CreateOrCleanDirectory();
File.Copy(pluginOutputDirectory / configuration / "Dangl.BCF.dll", installerDirectory / configuration / "Dangl.BCF.dll");
File.Copy(pluginOutputDirectory / configuration / "IPA.Bcfier.dll", installerDirectory / configuration / "IPA.Bcfier.dll");
File.Copy(pluginOutputDirectory / configuration / "IPA.Bcfier.Revit.dll", installerDirectory / configuration / "IPA.Bcfier.Revit.dll");
File.Copy(pluginOutputDirectory / configuration / "DecimalEx.dll", installerDirectory / configuration / "DecimalEx.dll");
File.Copy(pluginOutputDirectory / configuration / "IPA.Bcfier.Revit.addin", installerDirectory / configuration / "IPA.Bcfier.Revit.addin");
}

InnoSetup($"/dAppVersion=\"{GitVersion.AssemblySemVer}\" {pluginOutputDirectory / "Installer.iss"}");

Expand Down
89 changes: 0 additions & 89 deletions src/IPA.Bcfier.Revit/BcfierJavascriptBridge.cs

This file was deleted.

25 changes: 10 additions & 15 deletions src/IPA.Bcfier.Revit/IPA.Bcfier.Revit.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net481</TargetFramework>
<TargetFramework Condition="$(Configuration.Contains('2024'))">net481</TargetFramework>
<TargetFramework Condition="$(Configuration.Contains('2023'))">net481</TargetFramework>
<TargetFramework Condition="$(Configuration.Contains('2022'))">net481</TargetFramework>
<TargetFramework Condition="$(Configuration.Contains('2021'))">net481</TargetFramework>
<TargetFramework Condition="!$(Configuration.Contains('-20'))">net481</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<DefineConstants Condition="$(Configuration.Contains('Debug'))">DEBUG_BUILD</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2021'))">REVIT_2021</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2022'))">REVIT_2022</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2023'))">REVIT_2023</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('Debug'))">$(DefineConstants);DEBUG_BUILD</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2021'))">$(DefineConstants);REVIT_2021</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2022'))">$(DefineConstants);REVIT_2022</DefineConstants>
<DefineConstants Condition="$(Configuration.Contains('2023'))">$(DefineConstants);REVIT_2023</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CefSharp.Wpf" Version="105.3.390" PrivateAssets="build">
</PackageReference>
<PackageReference Include="CefSharp.Common" Version="105.3.390" PrivateAssets="all" ExcludeAssets="build;runtime;contentFiles">
</PackageReference>
<PackageReference Include="cef.redist.x86" Version="105.3.39" ExcludeAssets="all">
</PackageReference>
<PackageReference Include="cef.redist.x64" Version="105.3.39" ExcludeAssets="all">
</PackageReference>
<PackageReference Include="DecimalMath.DecimalEx" Version="1.0.2" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2025'))" Version="2025.0.0" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2024'))" Version="2024.0.0" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2024')) Or !$(Configuration.Contains('-20'))" Version="2024.0.0" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2023'))" Version="2023.0.0" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2022'))" Version="2022.1.0" />
<PackageReference Include="Revit_All_Main_Versions_API_x64" Condition="$(Configuration.Contains('2021'))" Version="2021.1.4" />
Expand Down
40 changes: 35 additions & 5 deletions src/IPA.Bcfier.Revit/Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

#define RevitAddinFolder "{sd}\ProgramData\Autodesk\Revit\Addins"
#define RevitAddin24 RevitAddinFolder+"\2024\"
#define RevitAddin23 RevitAddinFolder+"\2023\"
#define RevitAddin22 RevitAddinFolder+"\2022\"
#define RevitAddin21 RevitAddinFolder+"\2021\"

[Setup]
AppId="cfd740a5-8089-4323-a6e5-c86cfee9cca2"
Expand All @@ -29,13 +32,40 @@ ChangesAssociations=yes

[Components]
Name: revit24; Description: Addin for Autodesk Revit 2024; Types: full
Name: revit23; Description: Addin for Autodesk Revit 2023; Types: full
Name: revit22; Description: Addin for Autodesk Revit 2022; Types: full
Name: revit21; Description: Addin for Autodesk Revit 2021; Types: full

[Files]

;REVIT 2024
Source: "{#Repository}\IPA.Bcfier.Revit.addin"; DestDir: "{#RevitAddin24}"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\DecimalEx.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Dangl.BCF.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\IPA.Bcfier.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\IPA.Bcfier.Revit.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Release-2024\IPA.Bcfier.Revit.addin"; DestDir: "{#RevitAddin24}"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Release-2024\DecimalEx.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Release-2024\Dangl.BCF.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Release-2024\IPA.Bcfier.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\Release-2024\IPA.Bcfier.Revit.dll"; DestDir: "{#RevitAddin24}\Ipa.BCFier"; Flags: ignoreversion; Components: revit24
Source: "{#Repository}\bcfier-app\*"; DestDir: "{#RevitAddin24}\Ipa.BCFier\ipa-bcfier-app"; Flags: ignoreversion recursesubdirs; Components: revit24

;REVIT 2023
Source: "{#Repository}\Release-2023\IPA.Bcfier.Revit.addin"; DestDir: "{#RevitAddin23}"; Flags: ignoreversion; Components: revit23
Source: "{#Repository}\Release-2023\DecimalEx.dll"; DestDir: "{#RevitAddin23}\Ipa.BCFier"; Flags: ignoreversion; Components: revit23
Source: "{#Repository}\Release-2023\Dangl.BCF.dll"; DestDir: "{#RevitAddin23}\Ipa.BCFier"; Flags: ignoreversion; Components: revit23
Source: "{#Repository}\Release-2023\IPA.Bcfier.dll"; DestDir: "{#RevitAddin23}\Ipa.BCFier"; Flags: ignoreversion; Components: revit23
Source: "{#Repository}\Release-2023\IPA.Bcfier.Revit.dll"; DestDir: "{#RevitAddin23}\Ipa.BCFier"; Flags: ignoreversion; Components: revit23
Source: "{#Repository}\bcfier-app\*"; DestDir: "{#RevitAddin23}\Ipa.BCFier\ipa-bcfier-app"; Flags: ignoreversion recursesubdirs; Components: revit23

;REVIT 2022
Source: "{#Repository}\Release-2022\IPA.Bcfier.Revit.addin"; DestDir: "{#RevitAddin22}"; Flags: ignoreversion; Components: revit22
Source: "{#Repository}\Release-2022\DecimalEx.dll"; DestDir: "{#RevitAddin22}\Ipa.BCFier"; Flags: ignoreversion; Components: revit22
Source: "{#Repository}\Release-2022\Dangl.BCF.dll"; DestDir: "{#RevitAddin22}\Ipa.BCFier"; Flags: ignoreversion; Components: revit22
Source: "{#Repository}\Release-2022\IPA.Bcfier.dll"; DestDir: "{#RevitAddin22}\Ipa.BCFier"; Flags: ignoreversion; Components: revit22
Source: "{#Repository}\Release-2022\IPA.Bcfier.Revit.dll"; DestDir: "{#RevitAddin22}\Ipa.BCFier"; Flags: ignoreversion; Components: revit22
Source: "{#Repository}\bcfier-app\*"; DestDir: "{#RevitAddin22}\Ipa.BCFier\ipa-bcfier-app"; Flags: ignoreversion recursesubdirs; Components: revit22

;REVIT 2021
Source: "{#Repository}\Release-2021\IPA.Bcfier.Revit.addin"; DestDir: "{#RevitAddin21}"; Flags: ignoreversion; Components: revit21
Source: "{#Repository}\Release-2021\DecimalEx.dll"; DestDir: "{#RevitAddin21}\Ipa.BCFier"; Flags: ignoreversion; Components: revit21
Source: "{#Repository}\Release-2021\Dangl.BCF.dll"; DestDir: "{#RevitAddin21}\Ipa.BCFier"; Flags: ignoreversion; Components: revit21
Source: "{#Repository}\Release-2021\IPA.Bcfier.dll"; DestDir: "{#RevitAddin21}\Ipa.BCFier"; Flags: ignoreversion; Components: revit21
Source: "{#Repository}\Release-2021\IPA.Bcfier.Revit.dll"; DestDir: "{#RevitAddin21}\Ipa.BCFier"; Flags: ignoreversion; Components: revit21
Source: "{#Repository}\bcfier-app\*"; DestDir: "{#RevitAddin21}\Ipa.BCFier\ipa-bcfier-app"; Flags: ignoreversion recursesubdirs; Components: revit21
12 changes: 0 additions & 12 deletions src/IPA.Bcfier.Revit/Models/SaveBcfFileQueueItem.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Autodesk.Revit.DB;
using CefSharp;

namespace IPA.Bcfier.Revit.Models
{
Expand Down
80 changes: 0 additions & 80 deletions src/IPA.Bcfier.Revit/OpenIpaBcfierWindowCommand.cs

This file was deleted.

22 changes: 0 additions & 22 deletions src/IPA.Bcfier.Revit/PluginDebugRequestHandler.cs

This file was deleted.

Loading

0 comments on commit a69ae0b

Please sign in to comment.