Everything you wanted to know about ISV Models, but were afraid to ask


This is the down and dirty on creating, generating and signing an AX model file for an ISV.  I could find little if any comprehensive information about this.  I hope it helps you.
1.  Obtain the authenticode certificate from somewhere.  In order to sign your models and code for customers, you are going to need a certificate.  There are all types, but the one you want is for signing code.  They are not cheap.  We found a deal through Microsoft that gives you one for $99 for a year.  https://winqual.microsoft.com/help/obtaining_a_verisign_class_3_digital_id.htm.
This will take approximately 2-3 days, as the company has to validate that you are who you say you are.  So set aside time for this.  Make sure that you get two files out of this.  A “pfx” file and a “cer” file.  You can typically get this by exporting out the certificate from the computer you install it on.  We created a server called “DAXLICENSE” just for this purpose.
2.  Obtain the ISV license codes.  Youmust obtain the ISV code from Microsoft in order to use the authenticode certificate for exporting license codes.  This currently involves engaging with Lionbridge and paying a fee of $3,500. If you do not get the ISV code, you will not be able to generate a license and you will not be able to sign that license.  This took us 3 weeks to obtain.  It will hopefully take just a week for you.
3.  Start AX with the ISV code  In the configuration tool, you should be able to paste your ISV code into the Development tab.
Once you have started AX, you should be able to see the “isv” code in the status bar at the bottom of the application:
4.  Create a Model.  Press “Control-D” or start in Development mode to see the development environment in Dynamics AX.
From Tools, Select “Model management > Create model”.  The following form will display:
A few notes:
  • Make the “Model name” short and without spaces.   You will be typing this name over and over when creating licenses, models, and such.  The longer it is, the more likely you will make a mistake.
  • Version.  This cannot be changed within the UI once you enter it here.  The only way to change it is in the AXUTIL command, so just remember that.
  • Version control.  We recommend waiting on this.  Create the model, and then add to version control later once you are ready to create your first “build”.
4. Set your current model. One of the most maddening things about Models is when you are working in AX and you discover that your current model is the “ISV Model”, meaning that you will have to re-assign all those objects back to your model.  To avoid this, do two things:
  • Go to “Tools > Model management > Change current model” and set the model to yours.
  • Go to “Tools > Options.  Select the “Development” tab and set the model so that your environment always starts with your model:
5.  Write your code.  You know how to do that, right?
6.  Check for stragglers.  When you use models and the “ISV Model” is available, inevitably there will be items that happen to find their way into the ISV Model.  If this happens, when you export your model it will be missing items.  To make sure this does not happen, we have a little trick.
Go to “Tools > Model management > Model elements”.  This will open a form with everything in AX listed.
This is not all that useful until you “filter” on the Model.  Right-click on the column and Filter using the value “ISV*” to show all items with the ISV Model tag.
Now you can make sure that items you have modified are not in this model.  Change the item’s model by finding it in the AOT, right-click and select “Move to Model” to change it.
7.  Add the model to TFS.  We recommend creating a TFS project and adding the model.  This is nice because when you add the model to the project, it will automatically add all of the model objects to the TFS project and check them in.  It saves a lot of time and hassle.
8.  Create a license code in the AOT .  In the AOT, browse to “Data Dictionary > License codes”.  Right-click and select “New license code”.  Now do it again about 20 times until the ID is around 100020.
“Wait”, you say.  “Why am I doing this?  Everything so far has been straight forward.  This sounds nuts”.  The reason is this: If your product is to be used with another ISV product, and the License code is the same, there is really no way to import the models to co-exist (unless you set /idconflict to “overwrite” which is not good).  Since most models will have an ID of 100001 or 100002, it is a good idea to avoid this and make a code that is higher up in number.
Make sure to delete the License Codes that are 100001 through 100019.
Now go do the same thing to your Configuration Code (if you used one) as the same rule applies there.
(We realize that Microsoft claimed that all ISV and partner stuff will co-exist now, but in this area it is not true.  If the ID is the same, you cannot import the model).
9.  Set the Authenticode to your license file.  If you bought that Authenticode certificate, this is one place you will need it.  Go to the properties of the License code and fine the “CertificateName” item.  Click on the Ellipsis (…) and select the “cer” file you have.
Note that the CertificateName and CertificateIssuer will populate.  If you do not have the ISV code, these fields will not be editable.
10.  Assign the license code to the Configuration Key.  In your parent configuration key, select the license code in the properties.  This locks everything together.
11.  Generate a full CIL.  You will thank us later.
12.  Export the model.  Go to the “Microsoft Dynamics AX 2012 Management Shell” by selecting Start > Administrative Tools and then the Shell.  You should get the command line interface.
Enter in the following: “axutil export /model:”[myModel]” /file:”[path]” /key:”[path]“
Where [myModel] and [path] and replaced with your model “Name” and the path and file name of the model.  The filename should end with “.axmodel”.
You should also sign with a Strong Named Key, that is generated from the SDK (which is on the VPC) by using the “SN.EXE” tool.  There is lot’s on the internet about how to use this, but  you must have a SNK and a PFX file to properly sign the model.
You should now have a model file ready.  BUT WAIT.  You are not done.
12.  Sign the model.  We have to admit, this part was very difficult to figure out.  There does not seem to be much good documentation on this signing models.  (If any).  You will either need to install the Windows SDK or use the Microsoft Dynamics AX VPC (which already has it installed) for this part. Basically, you need a tool called “SignTool” to run.
You will need to “sign” the model with your certificate now. Just having the license is not good enough.  We suggest copying your certificate .pfx file into the folder with the “SignTool” utility that is installed with the SDK.  So copy your pfx file to “c:\Program Files (x86)\Microsoft SDKs\Windows\V7.0a\Bin”
Open a command line window (Start > Run > Cmd).  Browse to that folder using the “CD” tool.  (If you do not know what this is, you need to get a DOS book).
Now type the following:  signtool sign /f “[Your PFX file]” /p [The PFX password] “[PATH to MODEL”.
Note that the brackets and information need to be replaced with your stuff.  So ours would look like this: signtool sign /f “RM3.pfx” /p ********* “c:\temp\Red Maple Adv Trade 6.0.947.325″
Now you model is signed and ready to go.  We will do another article on importing with other ISV solutions and creating license files.
Browse

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.