Using Merge Module Project to add multiple custom files/folders into the OEM Installer

In my OEM product in typically need to add hundreds of files and custom folders.

I do this by creating a merge module

To start with:
You will need to install the “Microsoft Visual Studio Installer Project” extension
Use Manage Extensions to find install it

Create a New Project
Use the “Merge Module Project” Project Type

Add your files to the “Module Retargetable Folder”
Just drag and drop your files/folders

All files under this folder will be placed into the default OEM installation folder
You can right click to add other special folders

Save and Build the Solution

You will need a copy of Orca or SuperOrca

We now need to merge our module with the OEM installer

Build and Make your OEM product
This example is for OEM 2022
My build directory is “C:\develop\install\OEM-2022”, yours will vary if you used the OEM defaults

@set ORCA=“C:\Program Files (x86)\Orca\Orca.exe”
@set MSITRAN=“C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\msitran.exe”
@set projectname=myCAD
@set BUILDDIR=”C:\develop\install\OEM-2022”

cd %BUILDDIR%
@echo Make local copy of the OEM msi installer
copy “%BUILDDIR%\Target\x64\%projectname%\%projectname%.msi” %projectname%.msi

@echo Merge
%ORCA% -! -q -m MergeModule.msm -f ADSKShared_Files -r INSTALLDIR %projectname%.msi -i Target\x64%projectname%

@echo Apply Transforms (Optional)
REM This transform is to add our paths/settings/icon into the OEM installer.
REM %MSITRAN% -a .\Transforms\%projectname%\support-paths.mst %projectname%.msi

REM Copy Merged & Transformed setup file back to correct location
copy %projectname%.msi “%BUILDDIR%\Target\x64\%projectname%\%projectname%.msi”

You can also use Orca to modify the OEM msi file to customise your installation
eg add custom support paths

Open your installer msi myCAD.msi with Orca

Add your support paths to Properties → ACADProfile_SupportPath → Value
Eg
[INSTALLDIR]menu;[INSTALLDIR]PARTS\AUTOGEN;[INSTALLDIR]PARTS;
[ROAMINGUSERFILESFOLDER]support;[INSTALLDIR]support;[INSTALLDIR]fonts;[INSTALLDIR]help;[INSTALLDIR]support\color
Save the transform using Menu->Transform->Generate Transform
support-paths.mst

Once saved you can apply the transform manually Menu->Transform->Apply Transform
or use
%MSITRAN% -a support-paths.mst %projectname%.msi

Enjoy!

3 Likes