Author Topic: Innosetup: Looping through all versions and verticals and languages ...  (Read 22881 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 389
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #30 on: September 14, 2013, 09:22:11 AM »
Sorry for my comment, I´m trying to do the old way and inno-setup to build a install-it-self-package of all my programs. I´ve looked in archive.org to can get acadInst.exe, where I need to can install menus, supportpath and profile. Have somebody a idea where I can get it :?

PS.:http://www.cadwerx.net not available!

Found it http://www.freecadapps.com/swdetails.php?value=ACG-MSC&orgvalue=ACG&review=5626&rowcolor=fce08d
« Last Edit: September 14, 2013, 10:00:36 AM by cadplayer »

exmachina

  • Guest
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #31 on: September 14, 2013, 12:00:22 PM »
acadInst.exe & AcadInst_x64.exe v1.7.0.48 (cuix files are not supported):

exmachina

  • Guest
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #32 on: September 14, 2013, 12:30:04 PM »
Inno setup script to do the following:

-Checks whether a particular version (or any version) is installed
-Add support paths (and optionally delete them when uninstalling).
-Add code to acaddoc.lsp (and optionally delete them when uninstalling).

Copy InnoAcInstall.iss to C:\Program Files\Inno Setup and take a look at one of the examples

Peter2

  • Swamp Rat
  • Posts: 618
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #33 on: September 14, 2013, 12:36:17 PM »
...PS.:http://www.cadwerx.net not available!...
Yes. Regrettably Byron stopped his developments.

...Found it http://www.freecadapps.com/swdetails.php?value=ACG-MSC&orgvalue=ACG&review=5626&rowcolor=fce08d
The problem is that this version is 1.2 from 2002. A lot has changed since then in Acad environment.

acadInst.exe & AcadInst_x64.exe v1.7.0.48 (cuix files are not supported):
Wonderful. Thanks a lot.
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

cadplayer

  • Bull Frog
  • Posts: 389
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #34 on: September 14, 2013, 02:13:50 PM »
 :-o oh I not realy understand what I do
Simple question: what should do actually acadinst.exe and .ini. If I compile iss I get this message. I did change shortcut to example "C:\Programme\AutoCAD 2002\AcadInst.exe" "Infrastructure" (that create a new supportpath with named Infrastructure)

Peter2

  • Swamp Rat
  • Posts: 618
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #35 on: September 14, 2013, 03:03:17 PM »
I don't know the details, but

a) it seems that you use the old version of Acadinstall
b) I believe that the CHM of the new version will give you a lot of info
c) maybe your test command is missing some information: Write "Infrastructure" to which profile of which version? There is also an INI which has to be used by Acadinstall ..
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

exmachina

  • Guest
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #36 on: September 14, 2013, 04:03:48 PM »
:-o oh I not realy understand what I do
Simple question: what should do actually acadinst.exe and .ini. If I compile iss I get this message. I did change shortcut to example "C:\Programme\AutoCAD 2002\AcadInst.exe" "Infrastructure" (that create a new supportpath with named Infrastructure)

Example:

cadplayer

  • Bull Frog
  • Posts: 389
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #37 on: September 16, 2013, 01:13:18 AM »
Jar: can I get newest acadinst.exe or where I can find them?
...I have same message again
« Last Edit: September 16, 2013, 01:17:31 AM by cadplayer »

Peter2

  • Swamp Rat
  • Posts: 618
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #38 on: September 16, 2013, 01:33:20 AM »
Jar: can I get newest acadinst.exe or where I can find them?
...I have same message again
Did you take the download from his posting
"Reply #31 on: 14 September 2013, 18:00:22 »"?
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

cadplayer

  • Bull Frog
  • Posts: 389
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #39 on: September 16, 2013, 03:06:33 AM »
okay done!

Maybe a nother problem I have, in acadinst.ini are R15 or 16 version. I work with 2013 so it doesn´t run on this version or?

Peter2

  • Swamp Rat
  • Posts: 618
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #40 on: September 16, 2013, 10:43:59 AM »
...Maybe a nother problem I have, in acadinst.ini are R15 or 16 version. I work with 2013 so it doesn´t run on this version or?
I don't know, but ..

a) The INI from JAR has the line
Versions=R17.0,R17.1,R17.2

Have you modified it for 2013?

b) As already mentioned not all features will work in "modern" versions - e.g. the MNU-features are outdated (or you will find a Workaround)
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

cadplayer

  • Bull Frog
  • Posts: 389
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #41 on: September 17, 2013, 10:17:25 AM »
Thanks Peter!
Yes I did as 19.0 version but same result.
When I find out inno-ss compiler I was very happy to can do installpackage very easy and comfortable.
It´s a little difficult to know what should do acadinst-program so I believe I do not use this tool - strange. The second is to go back to my mainproblem install a Autolisp library in diffrent maps an maby modify support searchpath in Autocad so all collegues can easy setup my tools.
I think that is possible to do with iss.
Otherwise thanks again.

VVeli

  • Newt
  • Posts: 24
Hi,
there is an example how to find all installed AutoCAD versions at computer.
Just making a new installation package for AutoCAD Add-In with Inno Setup.
Code is not a final version and could have bugs. So use it wisely. =)

Cheers
Veli V.

Code: [Select]
[Icons]
Name: "{group}\AddIn"; Filename: "{code:GetAutoCADExe}\acad.exe"; Parameters: "{code:CheckCivil3DAecBaseDbxExists|{code:GetAutoCADExe}}/p ""AddIn"""; WorkingDir: "{app}"; IconFilename: "{app}\Bp.ico"

type
  AUTOCADINFO = record
    location: AnsiString;
    productname: AnsiString;
    productid: AnsiString;
    serialnumber: AnsiString;
  end;
  AcadInfoArray = array of AUTOCADINFO;

// Global variables
var
  AcadVerNames, AcadVerKeys, AcadExes, AcadProductNames: TArrayOfString;
  AcadInfos: AcadInfoArray;

function GetInstalledAutoCADVersions(): Boolean;
var
  S, V, AcadRegKey, sAcadExeLocation, sProductName, sProductId, sSerialNumber: String;
  RootKey, I, J, iCountAcadExeLocations: Integer;
  AcadVerKeysTemp: TArrayOfString;
  AcadInfo: AUTOCADINFO;
begin
  if IsWin64 then
  begin
    RootKey := HKLM64;
  end
  else
  begin
    RootKey := HKEY_LOCAL_MACHINE;
  end;

  iCountAcadExeLocations := 0; 
  AcadRegKey := 'SOFTWARE\Autodesk\AutoCAD';
  if RegGetSubkeyNames(RootKey, AcadRegKey, AcadVerNames) then
  begin
    S := '';
    for I := 0 to GetArrayLength(AcadVerNames)-1 do
    begin
      //MsgBox(AcadRegKey + '\' + AcadVerNames[I], mbInformation, MB_OK);
      if RegGetSubkeyNames(RootKey, AcadRegKey + '\' + AcadVerNames[I], AcadVerKeysTemp) then
      begin
        for J := 0 to GetArrayLength(AcadVerKeysTemp)-1 do
        begin
          //SOFTWARE\Autodesk\AutoCAD\R17.2\ACAD-7000:409
          //MsgBox(AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], mbInformation, MB_OK);
          sAcadExeLocation := '';
          if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'Location', sAcadExeLocation) then
          begin
            SetArrayLength(AcadExes, iCountAcadExeLocations + 1);
            AcadExes[iCountAcadExeLocations] := sAcadExeLocation;
            SetArrayLength(AcadVerKeys, iCountAcadExeLocations + 1);
            AcadVerKeys[iCountAcadExeLocations] := AcadVerKeysTemp[J];
            //S := S + AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeys[J] + ' = ' + AcadExes[I] + #13#10;
            SetArrayLength(AcadProductNames, iCountAcadExeLocations+1);
            AcadProductNames[iCountAcadExeLocations] := GetAutoCADProductName(AcadVerKeysTemp[J]);

            //---- Test of own array ----
            sProductName := '';
            sProductId := '';
            sSerialNumber := '';
            SetArrayLength(AcadInfos, iCountAcadExeLocations + 1);
            AcadInfo.location := sAcadExeLocation;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'ProductName', sProductName) then
            begin
              AcadInfo.productname := sProductName;
            end;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'ProductId', sProductId) then
            begin
              AcadInfo.productid := sProductId;
            end;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'SerialNumber', sSerialNumber) then
            begin
              AcadInfo.serialnumber := sSerialNumber;
            end;
            AcadInfos[iCountAcadExeLocations] := AcadInfo;
            //MsgBox('Location = ' + AcadInfo.location + #13#10 + 'ProductName = ' + AcadInfo.productname + #13#10 + 'ProductId = ' + AcadInfo.productid + #13#10 + 'SerialNumber = ' + AcadInfo.serialnumber + #13#10, mbInformation, MB_OK);
            //---- Test of own array ----

            iCountAcadExeLocations := iCountAcadExeLocations + 1;
          end;
        end;
      end;
    end;
    //MsgBox('Founded AutoCAD registry keys:'#13#10#13#10 + S, mbInformation, MB_OK);
  end;
end;

// Function implementations
function GetAutoCADExe(Param: String): String;
begin
  Result := AcadInfos[SelectAutoCADPage.SelectedValueIndex].location;
end;

procedure InitializeWizard;
var
  iCountAcadProductNames, I: Integer;
  button : TButton;
begin

  // AutoCAD version selection dialog
  SelectAutoCADPage := CreateInputOptionPage(wpWelcome,
    'Choose AutoCAD version', 'Upon which version of AutoCAD do you install addin?',
    'Choose AutoCAD version and click Next.',
    True, False);
  iCountAcadProductNames := GetArrayLength(AcadProductNames);
  for I := 0 to iCountAcadProductNames-1 do
  begin
    //SelectAutoCADPage.Add(AcadProductNames[I]);
    SelectAutoCADPage.Add(AcadInfos[I].productname);
  end;
end;

function InitializeSetup(): Boolean;
begin;
  GetInstalledAutoCADVersions();
  Result := True;
end;


Peter2

  • Swamp Rat
  • Posts: 618
...Code is not a final version and could have bugs. ...
Thanks. We are looking forward at the final version.  ;-)
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

VVeli

  • Newt
  • Posts: 24
Re: Innosetup: Looping through all versions and verticals and languages ...
« Reply #44 on: August 10, 2015, 04:26:31 AM »
Hi,
I have almost finished my installation project with Inno Setup. Setup package is in 32bit mode because it has 32bit dlls to register in Windows environment. Original idea was to detect AutoCAD version and install 3rd addin upon selected version. It also creates AutoCAD profiles and configures them. I don´t know is this a right way to do it but it is a one way. Have a good coding! =)

This is only a part of code because of 20000 characters limit. If someone need rest of it I can put it in .iss file.
Code: [Select]
[Icons]
Name: "{group}\KHK"; Filename: "{code:GetAutoCADExe}\acad.exe"; WorkingDir: "{app}"; IconFilename: "{app}\Bp.ico"; Parameters: "{code:CheckAutoCADStartupParameters}/p ""KHK"""

[Run]
Filename: "{app}\CopyRegKey.bat"; Parameters: """HKEY_CURRENT_USER\{code:GetTemplateProfileRegKey}"""; WorkingDir: "{app}"; Flags: waituntilterminated; StatusMsg: "Kopioi ja luo AutoCAD profiilit..."; AfterInstall: ModifyKHKProfileRegFile
Filename: "{app}\ImportRegKey.bat"; Parameters: "KHK"; WorkingDir: "{app}"; Flags: waituntilterminated; StatusMsg: "Palauttaa ja muokkaa AutoCAD profiileja..."; AfterInstall: ModifyKHKProfile

[Code]
// Global type definitions
type

  AUTOCADINFO = record
    location: AnsiString;
    productname: AnsiString;
    productid: AnsiString;
    serialnumber: AnsiString;
    registrykey: AnsiString;
  end;
  AcadInfoArray = array of AUTOCADINFO;

// Global variables
var
  SelectAutoCADPage: TInputOptionWizardPage;
  AcadInfos: AcadInfoArray;
  RootKey: Integer;

// Function declarations
function GetInstalledAutoCADVersions(): Boolean; forward;
function GetAutoCADProductName(Param: String): String; forward;

// Function implementations
function InitializeSetup(): Boolean;
var
  bRes: Boolean;
begin;
  bRes := False;
  Log('InitializeSetup() called');
  bRes := GetInstalledAutoCADVersions();
  if bRes = False then begin
    MsgBox('Koneelta ei löytynyt asennettua AutoCAD -ohjelmaa.' + #13#10 + 'Asennus lopetetaan.', mbInformation, MB_OK);
  end;
  Result := bRes;
end;

procedure InitializeWizard;
var
  iCountAcadProductNames, I: Integer;
  button : TButton;
begin
  Log('InitializeWizard() called');

  // AutoCAD version selection dialog
  SelectAutoCADPage := CreateInputOptionPage(wpWelcome, 'AutoCAD version valinta', 'Minkä AutoCAD:n päälle ohjelmisto asennetaan?',
    'Valitse AutoCAD versio ja paina Seuraava.', True, False);
  iCountAcadProductNames := GetArrayLength(AcadInfos);
  for I := 0 to iCountAcadProductNames - 1 do
  begin
    SelectAutoCADPage.Add(AcadInfos[I].productname);
  end;

function GetInstalledAutoCADVersions(): Boolean;
var
  S, V, AcadRegKey, sAcadExeLocation, sProductName, sProductId, sSerialNumber, sRegistryKey: String;
  I, J, iCountAcadExeLocations: Integer;
  AcadVerNames, AcadVerKeysTemp: TArrayOfString;
  AcadInfo: AUTOCADINFO;
begin
  if IsWin64 then begin
    RootKey := HKLM64;
  end else begin
    RootKey := HKEY_LOCAL_MACHINE;
  end;

  iCountAcadExeLocations := 0; 
  AcadRegKey := 'SOFTWARE\Autodesk\AutoCAD';
  if RegGetSubkeyNames(RootKey, AcadRegKey, AcadVerNames) then
  begin
    S := '';
    for I := 0 to GetArrayLength(AcadVerNames) - 1 do
    begin
      //MsgBox(AcadRegKey + '\' + AcadVerNames[I], mbInformation, MB_OK);
      if RegGetSubkeyNames(RootKey, AcadRegKey + '\' + AcadVerNames[I], AcadVerKeysTemp) then
      begin
        for J := 0 to GetArrayLength(AcadVerKeysTemp)-1 do
        begin
          //SOFTWARE\Autodesk\AutoCAD\R17.2\ACAD-7000:409
          //MsgBox(AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], mbInformation, MB_OK);
          sAcadExeLocation := '';
          sRegistryKey := AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J];
          if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'Location', sAcadExeLocation) then
          begin
            sProductName := '';
            sProductId := '';
            sSerialNumber := '';
            SetArrayLength(AcadInfos, iCountAcadExeLocations + 1);
            AcadInfo.location := sAcadExeLocation;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'ProductName', sProductName) then begin
              AcadInfo.productname := sProductName;
            end;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'ProductId', sProductId) then begin
              AcadInfo.productid := sProductId;
            end;
            if RegQueryStringValue(RootKey, AcadRegKey + '\' + AcadVerNames[I] + '\' + AcadVerKeysTemp[J], 'SerialNumber', sSerialNumber) then begin
              AcadInfo.serialnumber := sSerialNumber;
            end;
            AcadInfo.registrykey := sRegistryKey;
            AcadInfos[iCountAcadExeLocations] := AcadInfo;
            //MsgBox('Location = ' + AcadInfo.location + #13#10 + 'ProductName = ' + AcadInfo.productname + #13#10 + 'ProductId = ' + AcadInfo.productid + #13#10 + 'SerialNumber = ' + AcadInfo.serialnumber + #13#10, mbInformation, MB_OK);
           
            iCountAcadExeLocations := iCountAcadExeLocations + 1;
          end;
        end;
      end;
    end;
    //MsgBox('Founded AutoCAD registry keys:'#13#10#13#10 + S, mbInformation, MB_OK);
  end;
  if iCountAcadExeLocations > 0 then begin
    Result := True;
  end else begin
    Result := False;
  end;
end;

function GetAutoCADProductName(Param: String): String;
var
  sRet: String;
begin
  // AutoCAD 2012
  if Param = 'ACAD-A000:409' then begin
    sRet := 'Autodesk Civil 3D 2012';
  end else if Param = 'ACAD-A001:409' then begin
    sRet := 'AutoCAD 2012';
  end else if Param = 'ACAD-A002:409' then begin
    sRet := 'Autodesk Map 3D 2012';

  // AutoCAD 2013
  end else if Param = 'ACAD-B000:409' then begin
    sRet := 'Autodesk Civil 3D 2013';
  end else if Param = 'ACAD-B001:409' then begin
    sRet := 'AutoCAD 2013';
  end else if Param = 'ACAD-B002:409' then begin
    sRet := 'Autodesk Map 3D 2013';

  // AutoCAD 2009
  end else if Param = 'ACAD-7000:409' then begin
    sRet := 'Autodesk Civil 3D 2009';
  end else if Param = 'ACAD-7001:409' then begin
    sRet := 'AutoCAD 2009';
  end else if Param = 'ACAD-7002:409' then begin
    sRet := 'Autodesk Map 3D 2009';

  // AutoCAD 2010
  end else if Param = 'ACAD-8000:409' then begin
    sRet := 'Autodesk Civil 3D 2010';
  end else if Param = 'ACAD-8001:409' then begin
    sRet := 'AutoCAD 2010';
  end else if Param = 'ACAD-8002:409' then begin
    sRet := 'Autodesk Map 3D 2010';

  // AutoCAD 2011
  end else if Param = 'ACAD-9000:409' then begin
    sRet := 'Autodesk Civil 3D 2011';
  end else if Param = 'ACAD-9001:409' then begin
    sRet := 'AutoCAD 2011';
  end else if Param = 'ACAD-9002:409' then begin
    sRet := 'Autodesk Map 3D 2011';

  // AutoCAD 2014
  end else if Param = 'ACAD-D000:409' then begin
    sRet := 'Autodesk Civil 3D 2014';
  end else if Param = 'ACAD-D001:409' then begin
    sRet := 'AutoCAD 2014';
  end else if Param = 'ACAD-D002:409' then begin
    sRet := 'Autodesk Map 3D 2014';

  // AutoCAD 2015
  end else if Param = 'ACAD-E000:409' then begin
    sRet := 'Autodesk Civil 3D 2015';
  end else if Param = 'ACAD-E001:409' then begin
    sRet := 'AutoCAD 2015';
  end else if Param = 'ACAD-E002:409' then begin
    sRet := 'Autodesk Map 3D 2015';

  // AutoCAD 2016
  end else if Param = 'ACAD-F000:409' then begin
    sRet := 'Autodesk Civil 3D 2016';
  end else if Param = 'ACAD-F001:409' then begin
    sRet := 'AutoCAD 2016';
  end else if Param = 'ACAD-F002:409' then begin
    sRet := 'Autodesk Map 3D 2016';

  // Something other AutoCAD version
  end else begin
    sRet := 'Tuntematon AutoCAD versio: ' + Param;
  end;
  //MsgBox('GetAutoCADProductName(' + Param + ') = ' + sRet, mbInformation, MB_OK);
  Result := sRet; 
end;

function GetAutoCADExe(Param: String): String;
begin
  Result := AcadInfos[SelectAutoCADPage.SelectedValueIndex].location;
end;

function GetTemplateProfileRegKey(Param: String): String;
var
  prodId, regkey: String;
begin
  prodId := AcadInfos[SelectAutoCADPage.SelectedValueIndex].productid;
  regkey := AcadInfos[SelectAutoCADPage.SelectedValueIndex].registrykey;
  Log('CheckAutoCADStartupParameters prodId: ' + prodId);
  if prodId = 'F000' then begin // Civil 3D 2016
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = 'E000' then begin // Civil 3D 2015
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = 'D000' then begin // Civil 3D 2014
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = 'B000' then begin // Civil 3D 2013
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = 'A000' then begin // Civil 3D 2012
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = '9000' then begin // Civil 3D 2011
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = '8000' then begin // Civil 3D 2010
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else if prodId = '7000' then begin // Civil 3D 2009
    Result := regkey + '\Profiles\<<C3D_Metric>>';
  end else begin
    Result := regkey + '\Profiles\<<Unnamed Profile>>';
  end;
end;

function CheckAutoCADStartupParameters(Param: String): String;
var
  prodId, path: String;
begin
  prodId := AcadInfos[SelectAutoCADPage.SelectedValueIndex].productid;
  path := AcadInfos[SelectAutoCADPage.SelectedValueIndex].location;
  Log('CheckAutoCADStartupParameters prodId: ' + prodId);
  Log('CheckAutoCADStartupParameters location: ' + path);
  if prodId = 'F000' then begin // Civil 3D 2016
    Result := '/ld "' + path + '\AecBase.dbx" /product "C3D" ';
  end else if prodId = 'F002' then begin // Map 3D 2016
    Result := '/product MAP /language "en-US" ';
  end else if prodId = 'E000' then begin // Civil 3D 2015
    Result := '/ld "' + path + '\AecBase.dbx" /product "C3D" ';
  end else if prodId = 'D000' then begin // Civil 3D 2014
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else if prodId = 'B000' then begin // Civil 3D 2013
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else if prodId = 'A000' then begin // Civil 3D 2012
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else if prodId = '9000' then begin // Civil 3D 2011
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else if prodId = '8000' then begin // Civil 3D 2010
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else if prodId = '7000' then begin // Civil 3D 2009
    Result := '/ld "' + path + '\AecBase.dbx" ';
  end else begin
    Result := '';
  end;
end;

Cheers
Veli