Skip to content

Commit

Permalink
built and released RPS for Revit 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Jun 20, 2021
1 parent 7a7654f commit 7435716
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 11 deletions.
Binary file added Output/2021.06.20_Setup_RevitPythonShell_2022.exe
Binary file not shown.
13 changes: 9 additions & 4 deletions PythonConsoleControl/PythonConsoleControl.csproj
Expand Up @@ -16,6 +16,7 @@
2019 | net47
2020 | net471
2021 | net48
2022 | net48
For example you can exclude Revit 2014, by simply removing net40 target belows
-->
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
Expand Down Expand Up @@ -57,6 +58,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2021</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2022</RevitVersion>
</PropertyGroup>

<PropertyGroup>
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
Expand Down Expand Up @@ -104,8 +108,9 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1"/>

<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1" />

</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -132,8 +137,8 @@
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
</ItemGroup>


<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down
11 changes: 8 additions & 3 deletions RevitPythonShell/RevitPythonShell.csproj
Expand Up @@ -16,6 +16,7 @@
2019 | net47
2020 | net471
2021 | net48
2022 | net48
For example you can exclude Revit 2014, by simply removing net40 target belows
-->
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
Expand Down Expand Up @@ -58,6 +59,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2021</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2022</RevitVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
<PlatformTarget>x64</PlatformTarget>
Expand Down Expand Up @@ -112,7 +116,8 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.*" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1" />
</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -139,7 +144,7 @@
<HintPath>..\RequiredLibraries\Microsoft.Scripting.Metadata.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
Expand Down Expand Up @@ -266,7 +271,7 @@
<ReplaceFileText Condition="'$(Configuration)' == 'Release'" InputFilename="@(AddinManifest)" OutputFilename="@(AddinManifest)" MatchExpression="Assembly&gt;(.*?)&lt;" ReplacementText="Assembly&gt;$(AssemblyName).dll&lt;" />
<ReplaceFileText Condition="$(Configuration.Contains('Debug'))" InputFilename="@(AddinManifest)" OutputFilename="@(AddinManifest)" MatchExpression="Assembly&gt;(.*?)&lt;" ReplacementText="Assembly&gt;$([System.IO.Path]::GetFullPath('$(OutputPath)'))$(AssemblyName).dll&lt;" />
</Target>

<Target Name="CreateInnoSetupFile" AfterTargets="AfterBuild" Condition="'$(Configuration)' == 'Release'">
<PropertyGroup>
<OutputDirPath>$(SolutionName)\bin\$(Configuration)\$(RevitVersion)\</OutputDirPath>
Expand Down
13 changes: 9 additions & 4 deletions RpsRuntime/RpsRuntime.csproj
Expand Up @@ -15,7 +15,8 @@
2018 | net46
2019 | net47
2020 | net471
2021 | net472
2021 | net48
2022 | net48
For example you can exclude Revit 2014, by simply removing net40 target belows
-->
<TargetFrameworks>net40;net45;net451;net452;net46;net47;net471;net48</TargetFrameworks>
Expand Down Expand Up @@ -56,6 +57,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2021</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net48' ">
<RevitVersion>2022</RevitVersion>
</PropertyGroup>

<PropertyGroup>
<!-- Forcibly set platform to 'x64' and ignore architecture-related problems -->
Expand Down Expand Up @@ -108,7 +112,8 @@
<PackageReference Include="Autodesk.Revit.SDK" Version="2019.*" Condition=" '$(RevitVersion)' == '2019' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2020.1.0" Condition=" '$(RevitVersion)' == '2020' " PrivateAssets="All" />
<PackageReference Include="Autodesk.Revit.SDK" Version="2021.*" Condition=" '$(RevitVersion)' == '2021' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
<PackageReference Include="Autodesk.Revit.SDK" Version="2022.*" Condition=" '$(RevitVersion)' == '2022' " PrivateAssets="All" />
<PackageReference Include="AvalonEdit" Version="6.0.1" />
</ItemGroup>

<Target Name="PreventRevitSDKCopyLocal" AfterTargets="ResolveReferences">
Expand All @@ -117,7 +122,7 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Autodesk.Revit.SDK'" />
</ItemGroup>
</Target>

<ItemGroup>
<Reference Include="IronPython">
<HintPath>..\RequiredLibraries\IronPython.dll</HintPath>
Expand All @@ -138,7 +143,7 @@
<HintPath>..\RequiredLibraries\Microsoft.CSharp.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="System" />
Expand Down
66 changes: 66 additions & 0 deletions Setup_RevitPythonShell_2022.iss
@@ -0,0 +1,66 @@
[Files]
Source: "RevitPythonShell\bin\Release\2022\PythonConsoleControl.dll"; DestDir: "{app}"; Flags: replacesameversion
Source: "RevitPythonShell\bin\Release\2022\RevitPythonShell.dll"; DestDir: "{app}"; Flags: replacesameversion
Source: "RevitPythonShell\bin\Release\2022\RpsRuntime.dll"; DestDir: "{app}"; Flags: replacesameversion
Source: "RevitPythonShell\bin\Release\2022\RevitPythonShell.addin"; DestDir: "{userappdata}\Autodesk\Revit\Addins\2022"; Flags: replacesameversion
Source: "RevitPythonShell\bin\Release\2022\ICSharpCode.AvalonEdit.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\IronPython.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\IronPython.Modules.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Scripting.Metadata.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Dynamic.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\Microsoft.Scripting.dll"; DestDir: "{app}"
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\RevitPythonShell.xml"; DestDir: "{userappdata}\RevitPythonShell\2022"; Flags: onlyifdoesntexist
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\init.py"; DestDir: {userappdata}\RevitPythonShell\2022; Flags: confirmoverwrite;
Source: "RevitPythonShell\bin\Release\2022\DefaultConfig\startup.py"; DestDir: {userappdata}\RevitPythonShell\2022; Flags: confirmoverwrite;


[code]
{ HANDLE INSTALL PROCESS STEPS }
procedure CurStepChanged(CurStep: TSetupStep);
var
AddInFilePath: String;
LoadedFile : TStrings;
AddInFileContents: String;
ReplaceString: String;
SearchString: String;
begin
if CurStep = ssPostInstall then
begin
AddinFilePath := ExpandConstant('{userappdata}\Autodesk\Revit\Addins\2022\RevitPythonShell.addin');
LoadedFile := TStringList.Create;
SearchString := 'Assembly>RevitPythonShell.dll<';
ReplaceString := 'Assembly>' + ExpandConstant('{app}') + '\RevitPythonShell.dll<';
try
LoadedFile.LoadFromFile(AddInFilePath);
AddInFileContents := LoadedFile.Text;
{ Only save if text has been changed. }
if StringChangeEx(AddInFileContents, SearchString, ReplaceString, True) > 0 then
begin;
LoadedFile.Text := AddInFileContents;
LoadedFile.SaveToFile(AddInFilePath);
end;
finally
LoadedFile.Free;
end;
end;
end;
[Setup]
AppName=RevitPythonShell for Autodesk Revit 2022
AppVerName=RevitPythonShell for Autodesk Revit 2022
RestartIfNeededByRun=false
DefaultDirName={pf32}\RevitPythonShell\2022
OutputBaseFilename=Setup_RevitPythonShell_2022
ShowLanguageDialog=auto
FlatComponentsList=false
UninstallFilesDir={app}\Uninstall
UninstallDisplayName=RevitPythonShell for Autodesk Revit 2022
AppVersion=2022.0
VersionInfoVersion=2022.0
VersionInfoDescription=RevitPythonShell for Autodesk Revit 2022
VersionInfoTextVersion=RevitPythonShell for Autodesk Revit 2022

0 comments on commit 7435716

Please sign in to comment.