Skip to content

Commit 4b50fb4

Browse files
actions to update the version in the installer (#1) (#2)
* Update README.md * actions to update the version in the installer adding license.txt file to the .iss file adding icons to the installer * unnecessary license deleted * Bump version, add version update to staging action, remove duplicate license. --------- Co-authored-by: Daniel Pinheiro <[email protected]>
1 parent c522c68 commit 4b50fb4

File tree

9 files changed

+51
-11
lines changed

9 files changed

+51
-11
lines changed

.github/workflows/production_actions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
- name: Restore nuGet packages
5252
run: nuget restore $env:Solution_Name
5353

54-
- name: Set path for candle and light
55-
run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
56-
shell: bash
54+
# Update the version inside of the .iss file
55+
- name: Updating the version into the installer
56+
run: (Get-Content SampleRevitAddin.Installer/InstallScript.iss) -replace 'MyAppVersion "1.0.0"', 'MyAppVersion "v${{ steps.gitversion.outputs.majorMinorPatch }}"' | Out-File -encoding ASCII SampleRevitAddin.Installer/InstallScript.iss
5757

5858
- name: Run MSBuild
5959
id: run-msbuild

.github/workflows/staging_actions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ jobs:
5151
- name: Restore nuGet packages
5252
run: nuget restore $env:Solution_Name
5353

54+
# Update the version inside of the .iss file
55+
- name: Updating the version into the installer
56+
run: (Get-Content SampleRevitAddin.Installer/InstallScript.iss) -replace 'MyAppVersion "1.0.0"', 'MyAppVersion "v${{ steps.gitversion.outputs.majorMinorPatch }}"' | Out-File -encoding ASCII SampleRevitAddin.Installer/InstallScript.iss
57+
5458
- name: Run MSBuild
5559
id: run-msbuild
5660
run: |

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
mode: ContinuousDeployment
2-
next-version: 0.0.1
2+
next-version: 0.1.1

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
# Snack.Revit.Addin
1+
# Snack.Revit.Addin
2+
3+
## The Path
4+
5+
As architects-coders, BIM developers, or just power users that build projects or products in the AEC industry, many of us have tested multiple approaches to efficiently coding Revit add-ins. I struggled with this for a while.
6+
7+
My path and I’m sure many others, started with Dynamo, then PyRevit since I started coding in Python. The ease of use, lack of boilerplate code, and language choice make this a good starting point. But, when complexities arise, tapping into Revit’s API directly is usually the way to go. To do this, we need to use .NET Framework and its flagship programming language: C#.
8+
9+
In that realm, we need to take care of building the application, packaging it, and deploying it in a frictionless, safe, and scalable way. The problem is there’s no standard recipe to do all this. In fact, [there are many](https://github.com/jeremytammik/VisualStudioRevitAddinWizard). So, how do we do it at e-verse? We’ve gone through plenty of iterations testing and improving our approach. We think sharing it may help other people in the industry who, like me, struggled with finding the most scalable and efficient way to do all this when we first started, using different tedious approaches to, for example, maintain an add-in for multiple Revit versions.
10+
11+
---
12+
13+
## Our Recipe
14+
15+
Our general add-in structure looks like this:
16+
17+
1. A git code repository
18+
2. A .NET Framework solution containing multiple projects
19+
- The key here is to have different Class Library projects that compile a single Shared Project, so the code is the same but compiles targeting multiple Revit versions in a single operation
20+
3. A set of NuGet dependencies
21+
4. Post-build events to make debugging and releasing easier
22+
5. A configuration file to manage settings and environment variables outside the main logic
23+
6. CI/CD pipelines leveraging GitHub Actions to take care of releases for development, production, and any other environments needed
24+
25+
There are several templates and wizards to do this, but here we present our own. Take a look at this [article](https://blog.e-verse.com/build/coding-revit-add-ins-the-e-verse-way) about it.

SampleRevitAddin.Installer/InstallScript.iss

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "SampleRevitAddin"
5-
#define MyAppVersion "1.0"
5+
#define MyAppVersion "1.0.0"
66
#define MyAppPublisher "e-verse"
77

88
[Setup]
@@ -12,33 +12,38 @@ AppId={{264AD411-643C-43AC-9F07-34523C752100}
1212
AppName={#MyAppName}
1313
#define installerPath "{commonpf64}\e-verse\Snacks\"
1414
AppVersion={#MyAppVersion}
15-
;AppVerName={#MyAppName} {#MyAppVersion}
15+
AppVerName={#MyAppName} {#MyAppVersion}
1616
AppPublisher={#MyAppPublisher}
1717
DefaultDirName={#installerPath}
1818
DisableDirPage=yes
1919
DefaultGroupName=Revit Extractor
2020
DisableProgramGroupPage=yes
2121

22-
2322
#define Revit2020 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2020\"
2423
#define Revit2021 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2021\"
2524
#define Revit2022 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2022\"
2625
#define Revit2023 "\Autodesk\ApplicationPlugins\SampleRevitAddin.bundle\Contents\2023\"
2726

28-
2927
; Uncomment the following line to run in non administrative install mode (install for current user only.)
3028
;PrivilegesRequired=lowest
3129
OutputDir=.\Output
3230
OutputBaseFilename=SampleRevitAddin
3331
Compression=lzma
3432
SolidCompression=yes
33+
SetupIconFile="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.ico"
34+
OutputManifestFile=Setup-Manifest.txt
35+
UninstallDisplayName="SampleRevitAddin Uninstall"
36+
UninstallDisplayIcon="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.ico"
37+
WizardSmallImageFile="..\SampleRevitAddin.Resources\Images\Icons\e-verselogo.bmp"
3538
WizardStyle=modern
3639

3740
[Languages]
38-
Name: "english"; MessagesFile: "compiler:Default.isl"
41+
Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "..\LICENSE"
3942

40-
[Files]
43+
[Messages]
44+
SetupWindowTitle = Setup {#SetupSetting("AppName")} Version: {#SetupSetting("AppVersion")}
4145

46+
[Files]
4247

4348
Source: "..\SampleRevitAddin.2020\bin\Release\*"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs
4449
Source: "..\SampleRevitAddin.Common\SampleRevitAddin.addin"; DestDir: "{userappdata}{#Revit2020}\"; Flags: ignoreversion recursesubdirs createallsubdirs
Binary file not shown.
Binary file not shown.

SampleRevitAddin.Resources/SampleRevitAddin.Resources.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@
5353
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5454
</EmbeddedResource>
5555
</ItemGroup>
56+
<ItemGroup>
57+
<Content Include="Files\Text\license.txt" />
58+
<Content Include="Images\Icons\e-verselogo.bmp" />
59+
<Content Include="Images\Icons\e-verselogo.ico" />
60+
</ItemGroup>
5661
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5762
</Project>

SampleRevitAddin.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Installer"
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleRevitAddin.Resources", "SampleRevitAddin.Resources\SampleRevitAddin.Resources.csproj", "{87317C2B-AF3A-40AD-865C-093FBAA72440}"
2525
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3C7DD4D2-E4F4-47CD-88E1-C48C77173C05}"
27+
EndProject
2628
Global
2729
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2830
Debug|Any CPU = Debug|Any CPU

0 commit comments

Comments
 (0)