What's new

Publishing Alibre powered software and Integrations in an open source way.

stepalibre

Alibre Super User
I am being as open and transparent as possible, sharing information as I learn. I believe in experimentation and understand how difficult it can be to get started. This is a public support ticket. I will post updates here. A support ticket will be created. Starting a company but this is all open source MIT licensed work. My Alibre code will be open source until I get banned from the forum. As I make progress this need to be resolved. This concerns both automated build and deployment. I assume you need Alibre installed and licensed on the system.

Can we publicly or privately publish a package with AlibreX.dll? This is for custom DLL NuGet package or .NET tools published to NuGet.


How about automated build machines? Azure DevOps? GitLab? I have a VM with AD, could it run in Azure? I know what other vendors allow, I'm asking if Alibre's licensing system will run on Azure. I'm aware VMs are not supported. The install will be the same process as a local VM, just in Azure.

With a wide range of types, I want to build/publish no install, xcopy-deploy, portable software. This will allow me to fully automate the process. Projects will be AI assisted and/or templated. I have multiple computers with AD installed and use macOS. I want easy deployment and testing setups to avoid installers, especially for simple tools. I'm sharing this publicly because I can't be the only user.

Here is an example, a CLI program: Portable or external programs that use AlibreX require it to be in the build directory.
1713324274134.png
1713323893113.png
1713324811741.png


How to deploy a portable application that require Alibre APIs? Is it possible to build registry free and/or portable addons? I have untested ideas.

alternatives:
- copy AlibreX.dll into the portable download folder - manually or with script
- use an installer
- current addon system

Not a software engineer, looking for simple solutions.
 
Last edited:

stepalibre

Alibre Super User
Problem: Build machine can't find AlibreX.dll.
Action build error [ Missing AlibreX.dll on build machine ] #2

Code:
  # Building the project using MSBuild
  # Assuming you're targeting the .NET Framework 4.8,
  # and the solution file is in the root directory.
  msbuild /p:Configuration=Release /p:TargetFrameworkVersion=v4.8 /p:RestorePackages=false
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
MSBuild version 17.9.8+b34f75857 for .NET Framework
Build started 4/17/2024 6:28:04 AM.

Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Any CPU".
Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (1) is building "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "bin\Release\net481\".
  Creating directory "obj\Release\net481\".
ResolveAssemblyReferences:
  Primary reference "AlibreX".
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AlibreX". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]
          For SearchPath "{HintPathFromItem}".
          Considered "D:\Program Files\Alibre Design 27.0.1.27039\Program\AlibreX.dll", but it didn't exist.
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.exe", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.exe", but it didn't exist.
          For SearchPath "{RawFileName}".
          Considered treating "AlibreX" as a file name, but it didn't exist.
_GenerateSourceLinkFile:
  Updating Source Link file 'obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.sourcelink.json'.
CoreCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETFRAMEWORK;NET48;NET20_OR_GREATER;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER;NET48_OR_GREATER /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.IO.Compression.FileSystem.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Numerics.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /debug- /debug:portable /filealign:512 /optimize+ /out:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.exe /subsystemversion:6.00 /target:exe /warnaserror- /utf8output /deterministic+ /sourcelink:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.sourcelink.json /langversion:7.3 /analyzerconfig:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.GeneratedMSBuildEditorConfig.editorconfig Program.cs "obj\Release\net481\.NETFramework,Version=v4.8.AssemblyAttributes.cs" obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.AssemblyInfo.cs /warnaserror+:NU1605
D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\Program.cs(3,7): error CS0246: The type or namespace name 'AlibreX' could not be found (are you missing a using directive or an assembly reference?) [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]
  CompilerServer: server - server processed compilation - 5b54da44-a50f-4566-bb33-02247ecfabf6
Done Building Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default targets) -- FAILED.
Done Building Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default targets) -- FAILED.

Build FAILED.

"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default target) (1) ->
"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AlibreX". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]


"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default target) (1) ->
"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default target) (2) ->
(CoreCompile target) ->
  D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\Program.cs(3,7): error CS0246: The type or namespace name 'AlibreX' could not be found (are you missing a using directive or an assembly reference?) [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:16.80
Error: Process completed with exit code 1.
 
Last edited:

stepalibre

Alibre Super User
Sorry for all the editing, I'm getting feedback and is cleaning things up. There are character limits in posts.

To clarify the company I'm creating is completely separate the repos are MIT. GitHub is where I build open source stuff, mostly in messing private repos.
 
Last edited:

NateLiquidGravity

Alibre Super User
Packing the AlibreX.dll is unnecessary if the requirement is that Alibre is installed and correctly licensed. You just need to check the registry for which versions are installed and target the install folder found in the registry for that version.
Definitely not as easy as when Alibre had only allowed only a single version installed at a time but I like being able to install multiple versions. Though they could still make it easier for finding the user's preferred installed version by storing a registry key for that in a stationary location.
 

stepalibre

Alibre Super User
That's not portable. I have the code to do registry key handling for the addons and programs. What you describe is also the way to call AlibreX.dll from scripts. That is for addon development where your code is being ran from inside the Alibre process Or from .NET/COM somehow.
Alibre is installed and correctly licensed
This also apply to build machines on GitHub/Azure servers.

multiple versions
Great point. Another reason to have a portable program. To avoid those issues: https://github.com/Testbed-for-Alibre-Design/CheckAlibreXPortableBinDirIsWorking/issues/1
For the build machine workflows I can have it setup for each new release, that's the goal. Include .NET8+ and .NET481 setups too.

Update:
Supporting only V27:29 for now this simplifies a lot
Portable CLI and GUI applications - Include scripts to copy the DLLs
No package publishing
Waiting for PDM / M-Files comparison
I want remote builds to be the default
 
Last edited:

stepalibre

Alibre Super User
It is portable, you don't need to write to the registry - just read from it what Alibre Design already wrote to it.
I read/write the registry for AD addons and other programs that require it. With a wide array of use cases and some third software require registry use. Registry keys add overhead. The automated build process will be setup for V27.29 with path "installed-drive-letter:\Program Files\Alibre Design 27.0.1.27039\Program\AlibreX.dll".

For now, portable apps and addons will be built for V27.29. Workflows can be made for any version. I tested this locally, not in GitHub Actions.

Working with your script:
1713414824027.png
 

stepalibre

Alibre Super User
I have ~331 programs. They vary from:
What-if programs
AlibreX and AlibreScript API tests
DLL reflection for API information
Import/export tools
Feature generation, insight
General data viewing/checking/conversion
Import/export any data to other formats

Programs for general testing and use of the API. Benchmarking/testing create/delete/update/regen for a given task. Input/output can be chained together. The list continues to grow. These programs are duplicated for any purpose, but currently not easy to use build and share in an automated open source way. Registry use should be avoided for portable applications where the application and program data is stored in the portable application root or sub folder. Making a self contained program that could run from and be backup safely with cloud storage OneDrive/Dropbox/iCloud Drive/Google Drive. I often use my Desktop or Downloads folders for testing and my NAS or cloud storge for simple programs. Only on SSDs.

Here are a few examples with AI cleanup tasks applied (untested). I haven't reviewed the changes. My workflow will send tasks to a bot process that works locally not yet tested on GitHub Actions.
Too much to post here. Some I've posted somewhere previously:

 
Last edited:

stepalibre

Alibre Super User
Everything works locally. While waiting for a response from support, I'll get a self-hosted runner set up.


The question is: Can AD run on a cloud server in headless mode for build task purposes? AD hosted in the cloud with GUI support is different. I understand how to set this up as a company on private hardware. If it can't then I'll build a machine with a self-hosted runner.

DeployMaster is the installer I use in the build pipeline.
 
Last edited:

stepalibre

Alibre Super User
Packing the AlibreX.dll is unnecessary if the requirement is that Alibre is installed and correctly licensed. You just need to check the registry for which versions are installed and target the install folder found in the registry for that version.
Definitely not as easy as when Alibre had only allowed only a single version installed at a time but I like being able to install multiple versions. Though they could still make it easier for finding the user's preferred installed version by storing a registry key for that in a stationary location.
Not many versions to deal with. I wonder how many users are on v25/26. This is not really an important issue, I'll focus on v27 until PDM and v28 are stable. The paths will be hard coded and the registry can be read when necessary. The code will be there for all users Adam3D, Pro and Exp, maintenance or not.

 

stepalibre

Alibre Super User
How about automated build machines? Azure DevOps? GitLab? I have a VM with AD, could it run in Azure? I know what other vendors allow, I'm asking if Alibre's licensing system will run on Azure. I'm aware VMs are not supported. The install will be the same process as a local VM, just in Azure.
The question is: Can AD run on a cloud server in headless mode for build task purposes? AD hosted in the cloud with GUI support is different. I understand how to set this up as a company on private hardware. If it can't then I'll build a machine with a self-hosted runner.
Yes.
Can we publicly or privately publish a package with AlibreX.dll? This is for custom DLL NuGet package or .NET tools published to NuGet.
No.
Problem: Build machine can't find AlibreX.dll.
Action build error [ Missing AlibreX.dll on build machine ] #2

Code:
  # Building the project using MSBuild
  # Assuming you're targeting the .NET Framework 4.8,
  # and the solution file is in the root directory.
  msbuild /p:Configuration=Release /p:TargetFrameworkVersion=v4.8 /p:RestorePackages=false
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
MSBuild version 17.9.8+b34f75857 for .NET Framework
Build started 4/17/2024 6:28:04 AM.

Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Any CPU".
Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (1) is building "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "bin\Release\net481\".
  Creating directory "obj\Release\net481\".
ResolveAssemblyReferences:
  Primary reference "AlibreX".
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AlibreX". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]
          For SearchPath "{HintPathFromItem}".
          Considered "D:\Program Files\Alibre Design 27.0.1.27039\Program\AlibreX.dll", but it didn't exist.
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\AlibreX.exe", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.winmd", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.dll", but it didn't exist.
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\AlibreX.exe", but it didn't exist.
          For SearchPath "{RawFileName}".
          Considered treating "AlibreX" as a file name, but it didn't exist.
_GenerateSourceLinkFile:
  Updating Source Link file 'obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.sourcelink.json'.
CoreCompile:
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1701,1702 /fullpaths /nostdlib+ /platform:AnyCPU /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETFRAMEWORK;NET48;NET20_OR_GREATER;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREATER;NET45_OR_GREATER;NET451_OR_GREATER;NET452_OR_GREATER;NET46_OR_GREATER;NET461_OR_GREATER;NET462_OR_GREATER;NET47_OR_GREATER;NET471_OR_GREATER;NET472_OR_GREATER;NET48_OR_GREATER /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Drawing.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.IO.Compression.FileSystem.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Numerics.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /debug- /debug:portable /filealign:512 /optimize+ /out:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.exe /subsystemversion:6.00 /target:exe /warnaserror- /utf8output /deterministic+ /sourcelink:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.sourcelink.json /langversion:7.3 /analyzerconfig:obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.GeneratedMSBuildEditorConfig.editorconfig Program.cs "obj\Release\net481\.NETFramework,Version=v4.8.AssemblyAttributes.cs" obj\Release\net481\CheckAlibreXPortableBinDirIsWorking.AssemblyInfo.cs /warnaserror+:NU1605
D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\Program.cs(3,7): error CS0246: The type or namespace name 'AlibreX' could not be found (are you missing a using directive or an assembly reference?) [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]
  CompilerServer: server - server processed compilation - 5b54da44-a50f-4566-bb33-02247ecfabf6
Done Building Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default targets) -- FAILED.
Done Building Project "D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default targets) -- FAILED.

Build FAILED.

"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default target) (1) ->
"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2389,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "AlibreX". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]


"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.sln" (default target) (1) ->
"D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj" (default target) (2) ->
(CoreCompile target) ->
  D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\Program.cs(3,7): error CS0246: The type or namespace name 'AlibreX' could not be found (are you missing a using directive or an assembly reference?) [D:\a\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking\CheckAlibreXPortableBinDirIsWorking.csproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:16.80
Error: Process completed with exit code 1.
AD needs to be installed on the build machine to pass.
How to deploy a portable application that require Alibre APIs? Is it possible to build registry free and/or portable addons? I have untested ideas.

alternatives:
- copy AlibreX.dll into the portable download folder - manually or with script
- use an installer
- current addon system
I've identified the various options and possiblities.

Thanks, David. I always appreciate the accuracy you emphasize. The attentiveness from support is great. Just don't ban me from the forum.
 
You just need to check the registry for which versions are installed and target the install folder found in the registry for that version.
Could you give more details on this? Is a registry key for install location documented somewhere or we just discover it by exploring and it's fairly stable?

Until today, I had assumed I could distribute AlibreX with my application and it would work on all/most versions but it turns out if you use v27's AlibreX.dll but have 26 or 28 installed and registered, it crashes badly with an unsafe-to-catch exception.

Alternatively, is there a way to find out the version of Alibre that your application is talking to? IADRoot.Version just returns the version of the ActiveX.dll.
 

bolsover

Senior Member
Could you give more details on this? Is a registry key for install location documented somewhere or we just discover it by exploring and it's fairly stable?

Until today, I had assumed I could distribute AlibreX with my application and it would work on all/most versions but it turns out if you use v27's AlibreX.dll but have 26 or 28 installed and registered, it crashes badly with an unsafe-to-catch exception.

Alternatively, is there a way to find out the version of Alibre that your application is talking to? IADRoot.Version just returns the version of the ActiveX.dll.
If you are working with an Add-on you can do something like:

C#:
public static void AddOnLoad(IntPtr hwnd, IAutomationHook pAutomationHook, IntPtr unused)
        {
            AlibreRoot = (IADRoot) pAutomationHook.Root;
            _parentWinHandle = hwnd;
             var version = AlibreRoot.Version.Replace("PRODUCTVERSION ", "");
             var versionarr = version.Split(',');
             var majorVersion = int.Parse(versionarr[0]);
             if (majorVersion < 27)
                 MessageBox.Show(Globals.AppName + "requires a newer version of Alibre Design", "Error");
            
           ....
        }
 
I'm working on a separate application that interfaces with Alibre using AlibreX.dll. Not sure if that's technically an add-on or not.

I can't use AlibreRoot.Version because I don't know where Alibre's copy of AlibreX.dll is. If I use my own copy, it returns the wrong value.

Maybe I should ask the user to specify the install location of Alibre, then I can run RegisterCOMdlls.BAT and load AlibreX.dll from there?
 

stepalibre

Alibre Super User
I'm working on a separate application that interfaces with Alibre using AlibreX.dll. Not sure if that's technically an add-on or not.
Apps that run as a console, WinForm or WPF app is a standalone app or out of process program, not an addon. Addons are DLLs that are loaded by Alibre Design.exe.
Maybe I should ask the user to specify the install location of Alibre, then I can run RegisterCOMdlls.BAT and load AlibreX.dll from there?
AlibreX.dll needs to be copied into the same directory as your app .exe.

RegisterCOMdlls.BAT is not required for your app to work on the end-user pc, this is separate unless your app uses COM or is handling more than what a simple app would normally do. I copy AlibreX.dll into my standalone and portable apps that need it. As shown here:
index.php


This is the purpose of CheckAlibreXPortableBinDirIsWorking.
 
How else can you control Alibre from another application besides COM? I'm using COM and need to run RegisterCOMdlls.BAT.

For now, it looks like I'll have to make my application only compatible with a single version of Alibre. AlibreX.dll has to be the same version as the one that has its COM dlls registered so I can't just distribute my application with one version and have it work with older or newer Alibre versions. I thought maybe I could have it use the AlibreX.dll already installed on the user's computer with Alibre, but my application would need to know where to find that. @NateLiquidGravity said you can find it from the registry - somewhere.
 

stepalibre

Alibre Super User
AlibreX is COM but your code written against AlibreX.dll has no direct link to COM, it is handled for you. The user computer needs to be properly configured for AlibreX to work, I assume this = true. If you're distributing an app you can script the entire process of copying the correct AlibreX.dll to your bin folder and running RegisterCOMdlls.BAT. This is what I do for GitHub actions and my remote machines. Every installer app/tool allow scripts to run pre or post install of your program/package. I have my own tools for this because Alibre Design is easy to manage compared to Big CAD.

For now, it looks like I'll have to make my application only compatible with a single version of Alibre. AlibreX.dll has to be the same version as the one that has its COM dlls registered so I can't just distribute my application with one version and have it work with older or newer Alibre versions.
Yes. I only support a single version up to now and again Alibre Design is easy to manage so getting the install folder is really all that's required.
 
So you get the install folder from the user at install time rather than the registry at runtime?

I don't really want to make the user decide anything to do with Alibre when installing because most of them won't be using it anyway and even then, they won't be able to change it later without re-installing. I don't want my application to copy files into its own install folder later on because of permissions and it would break uninstalling. So I think it should load it directly from the Alibre install folder at runtime.
 

stepalibre

Alibre Super User
The default install is:
C:\Program Files\Alibre Design 28.0.0.28094

On all my machines and on VMs the drive letter may change so I account for that.

You can find the install location in the registry so it doesn't hurt to check it. We are discussing several different things. It's possible to use the registry to find AlibreX for dynamic code/programs like IronPython programs to import AlibreX.dll. A standalone app can also use the registry at install or at runtime to get AlibreX.dll. I copy AlibreX.dll into the bin folder of my tools. I delete AlibreX.dll a number of ways to cleanup things and this is what installers/uninstallers do.

I don't want my application to copy files into its own install folder later on because of permissions and it would break uninstalling.
Installers and running scripts/tools as admin is exactly for this purpose. If you don't have admin rights or your app is doing a lot under the hood it is easier and better to make an addon that start your application. I have many addons that are standalone apps that are included inside an addon that is installed with an installer. The app doesn't use or is in any way linked or referenced, by Alibre Design.
The addon is just a button that starts my app as a process: Process.Start("<my app.exe>"). You can also reference your exe or compile it to a DLL that is referenced by the addon that calls your window to be open on an event, menu or ribbon button click. An example of this method is this: https://github.com/Testbed-for-Alibre-Design/AlibrePythonShellAddon it can be run as an .exe outside of Alibre completely or used in DLL form in the addon.

Many options.
 
Last edited:
Top