cancel
Showing results for 
Search instead for 
Did you mean: 

[B1 9.0] Building add-ons for x64

former_member445524
Participant
0 Kudos

Hello all,

I have a problem with the installer for x64 add-ons. The AddonInstallApi.dll provided by B1 x64 seems to be built for x86 and calls to it fail with the error: "An attempt was made to load a program with an incorrect format."  Are 64-bit add-ons supposed to use it, and if not, then what should they use instead? I didn't find any x64 analog for it.

Also how does the B1 client classify add-ons as either x86 or x64? I built my add-on as x64 in Visual Studio but it still is reported as x86 by B1. The AddonRegDataGen tool is x86 only as well...

Accepted Solutions (1)

Accepted Solutions (1)

former_member665562
Discoverer
0 Kudos

Hi Anton,

You have to use AddOnInstallAPI_x64.dll for x64 Addon.

Addon - target platform x64

Installer - target platform x64

Jozef Horyl

former_member445524
Participant
0 Kudos

Thanks, Jozef.

I missed your post due to the website's not working correctly from the Opera browser — didn't get subscribed.

Former Member
0 Kudos

Hi Jozef,

How to create addon using  AddOnInstallAPI_x64.dll for x64 Addon?.

Please explain the steps to create addon and where to use this dll.

Kiran Venkatram

Answers (5)

Answers (5)

Former Member
0 Kudos

To Generate X64 Addon for X64 Client with B1DE

1- clean your project (delete all files or folder in Bin folder

2- Add UIAPI and DIAPI to References of addon project

    from: C:\Program Files\SAP\SAP Business One\SAPbouiCOM.exe

          C:\Program Files\SAP\SAP Business One DI API\DI API 90\SAPbobsCOM90.dll

3- On Project proprieties > Builds : set Plateform and target plateform to "Any CPU"

4- Build you project

5- Create your installer project with B1DE tools: new project> SAP B1 AddonInstaller .Net Wizard

6- choose you generated Exec File on step 4

7- Ctr+H (Search and replace) on All Solution : <<AddOnInstallAPI.dll>> by <<AddOnInstallAPI_x64.dll>>

8- On Project proprieties > Compile >Advanced Compile Options > Target CPU:x64

9- Build your project

10- Go to your project folder and run AddOnRegDataGenFile\AddOnRegDataGen.bat

11- Go to the Bin folder a new .ard file is generated

12- Edit this file with notepad and replace :<<platform="N" >> by <<platform="X" >>

Former Member
0 Kudos

Hi Everybody,

Can u explain which path of AddOnInstallAPI_x64.dll for 64 bit of SAP B1 9.0 Version?

Please share the download path for AddOnInstallAPI_x64.dll for 64 bit of SAP B1 9.0 Version.

When am creating ARD fie for 64 bit of SAP B1 9.0 , By Right Click on the Project Properties-->compile-->Advanced Compile Options-->X64.

Once created ARD file, then i opened "C:\Users\User1\Desktop\ARDFile\ARDname\ARDname\ARDname\AddOnRegDataGenFile"

While double click on the "windows Batch file"(AddOnRegDataGen), it automatically generates ARD file and EXE File.

In ARD file, Edit the ARD file--> Change the Platform "N" to "X". whereas EXE file could not change the 64 bit.

Hence the error shows in SAP b1 "Addon exception or "Incorrect string format".

Please fix this issue ASAP.

Thanks & Regards,

Bowya S S

former_member203128
Participant
0 Kudos

Hello Anton Shepelev

Actually your AddOn is running over SAP 9.0 64 bits? The method EndInstallEx of AddOnInstallAPI_x64 is the same that x86?

Regards

former_member445524
Participant
0 Kudos

Alvaro Gonzalez, I am using EndInstall, as does the SDK Installer sample. Where is EndInstallEx documented?

former_member203128
Participant
0 Kudos

Hi Anton

In the SAP Business One SDK 8.81 Help Center you can find this method, for that documentation I was using EndInstallEx

Do you generate the Installer with the Tool SAP B1 AddOnInstaller .NET Wizard?

Regards

Alvaro González

former_member445524
Participant
0 Kudos

Alvaro Gonzalez, yes I have found it in the SDK's "Create a Setup Program" section, which I had neglected skipping right the the Installer sample. But when I tried to call this function I got the following exception: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Here's my definition of it: http://pastebin.com/mm5UCNzs

What did I get wrong?

I authored my installer manually, without any wizards. I think there are none for VS2008.

former_member445524
Participant
0 Kudos

Alvaro Gonzalez, no you are mistaken. The SDK describes EndInstallEx() as a parameterless function, whereas it accepts two parameters — a string and a boolean, which are not even mentioned either in the documentation or in the C# SDK installer sample.

I have written about it to Support and they have acknowledged the error and promised to fix it.

former_member445524
Participant
0 Kudos

I found that AddonRegDataGet UI has a "x64" checkbox, but how can it be set from the xml file passed to it as a command-line parameter?

former_member445524
Participant
0 Kudos

Question about AddonRegDataGen moved into a separate thread.

Former Member
0 Kudos

Hi,

     You can recompile your add-on. Please visit this content.

http://scn.sap.com/community/business-one-sdk/blog/2012/05/18/creating-and-registering-add-on-on-sap...

Regards,

former_member445524
Participant
0 Kudos

Hello, Bryan.

I am writing addons manually in Visual Studio, without using any B1-specific templates or wizards, and your video didn't answer my questions. You were using the AddonRegDatagen tool, but, as I have said, even in B1 9.0 it is provided only as a 32-bit executable which doesn't work on my x64 machine. Secondly, I couldn't find a 64-bit version of the addon installer API, while the supplied 32-bit one can't conveniently be used from an x64 application.

Could you please look into your source and let me know how the addon installer API is accessed therefrom? The only way to do that I know is via some complicated trickeration:

http://tinyurl.com/74ukgg9

Do you also know how B1 determines whether an add-on is 64-bit or 32-bit? Simply rebuilding it as x64 doesn't help and it still is detected as 32-bit...

former_member445524
Participant
0 Kudos

Hello, Bryan,

I see you are using "SAP B1 AddOnInstaller .NET Wizard", but I can't find this template in B1 Studio for Visual Studio for B1 9.0... I have only two templaetes: "SAP Business One Add-On project" and "SAP Business One Add-On project from B1s file".