Book a Demo

Author Topic: Add-In Invalide parameters(topic not in good dir)  (Read 5647 times)

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Add-In Invalide parameters(topic not in good dir)
« on: July 20, 2012, 12:31:25 am »
Hi, (It's again me  :-[)

I have make one Add-In with visual studio.
On my computer it's work.

But when I try to distribute them on other computer, it doesn't work.

I have process like Greet said in this topic :
http://geertbellekens.wordpress.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-addin-in-10-minutes/

but when I run EA, in the Manage Add-in they are : Invalid Parameter(s)  

(I have make a .BAT's file :
Code: [Select]
@echo off

set "VAR=C:\Program Files (x86)\MoodysAddInEA\"

if not exist "%VAR%" md "%VAR%"

reg add "HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins\Moodys" /d "Moodys.Main" /f

copy Moodys.dll "%VAR%"

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "%VAR%Moodys.dll" /codebase
)
« Last Edit: July 20, 2012, 12:47:50 am by Cisore »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add-In Invalide parameters(topic not in good d
« Reply #1 on: July 20, 2012, 03:40:46 pm »
If it doesn't work on another computer then there must be something wrong with the installation.
Have you read http://geertbellekens.wordpress.com/2011/02/23/tutorial-deploy-your-enterprise-architect-csharp-add-in-with-an-msi-package/?

Geert

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #2 on: July 20, 2012, 05:14:58 pm »
Yes I have read that ! But I don't want to pass by a MSI file ! Because in two weeks I go out of this enterprise and in my mind, the other employees could be change a .BAT file more easy than a .MSI file.

My work with the .BAT are incorrect ?

( the error code : Invalid parameter(s), are a error of what ? to call the add-in ? to find the main class ? or to use the method in the main class ?)

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #3 on: July 20, 2012, 11:40:38 pm »
I have try with .MSI file.

(I have make all process in your topic)
But they don't work !

the same error : Invalid parameter(s)


Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #4 on: July 25, 2012, 05:07:26 pm »
Someone know where this error come form ?
(Invalid parameters !)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add-In Invalide parameters(topic not in good d
« Reply #5 on: July 25, 2012, 05:23:07 pm »
Try posting your code.
Maybe that reveals something

Geert

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #6 on: July 25, 2012, 10:23:37 pm »
the code for the main class !!? :
Code: [Select]
using System;

namespace Moodys
{
      public class Main
      {
        private IAction addAct = null;
        private IAction genCode = null;
        private IAction gesVC = null;
        private IAction addcond = null;
        private IAction genDoc = null;
        private IAction genModel = null;

            //Called Before EA starts to check Add-In Exists
            public String EA_Connect(EA.Repository Repository)
            {
                  return "a string";
            }
            public object EA_GetMenuItems(EA.Repository Repository, string Location, string MenuName)
            {
                  EA.Package aPackage = Repository.GetTreeSelectedPackage();
            Boolean debug = isDebug(Repository, "debug");
                  switch( MenuName )
                  {
                        case "":
                              return "-&Moodys";
                case "-&Moodys":
                    if (debug)
                    {
                        string[] ar = { "&Générer Nouvelle dll de calcul", "-&Ajouter Activity", "-&Ajouter Condition", "&Générer Code", "-&Gestion VC", "&Générer doc (HTML)", "&Clear Model"  };
                        return ar;
                    }
                    else
                    {
                        string[] ar = { "&Générer Nouvelle dll de calcul", "&Ajouter Activity", "&Ajouter Condition", "&Générer Code", "&Générer doc (HTML)"};
                        return ar;
                    }
                case "-&Gestion VC":
                    string[] vc = { "&Remove VC"};
                    return vc;
                case "-&Ajouter Activity" :
                    string[] aa = {"&One","&All"};
                    return aa;
                case "-&Ajouter Condition":
                    string[] ajC = { "&One", "&All" };
                    return ajC;
                  }
                  return "";
            }
            
            bool IsProjectOpen(EA.Repository Repository)
            {
                  try
                  {
                        EA.Collection c = Repository.Models;
                        return true;
                  }
                  catch
                  {
                        return false;
                  }
            }
            public void EA_GetMenuState(EA.Repository Repository, string Location, string MenuName, string ItemName, ref bool IsEnabled, ref bool IsChecked)
            {
                  if( IsProjectOpen(Repository) )
                  {
                if (ItemName == "&Clear Model")
                {
                    IsChecked = false;
                    IsEnabled = true;
                }
                else if (ItemName == "&Générer Nouvelle dll de calcul")
                {
                    if (genModel == null)
                        genModel = new GenModel(this);
                    IsEnabled = genModel.goodDir(Repository);
                }
                else if (MenuName == "-&Ajouter Activity" || ItemName == "&Ajouter Activity")
                {
                    if (addAct == null)
                        addAct = new AddActivity(this);
                    IsEnabled = addAct.goodDir(Repository) && Location == "TreeView";
                }
                else if (MenuName == "-&Ajouter Condition" || ItemName == "&Ajouter Condition")
                {
                    if (addcond == null)
                        addcond = new AddCond();
                    IsEnabled = addcond.goodDir(Repository) && Location == "TreeView";
                }
                else if (ItemName == "&Générer Code")
                {
                    if (genCode == null)
                        genCode = new genereCode(this);
                    IsEnabled = genCode.goodDir(Repository) && Location == "TreeView";
                }
                else if (MenuName == "-&Gestion VC")
                {
                    if (gesVC == null)
                        gesVC = new gestionVC();
                    IsEnabled = gesVC.goodDir(Repository) && Location == "TreeView";
                }
                else if (ItemName == "&Générer doc (HTML)")
                {
                   // IsChecked = false;
                    if (genDoc == null)
                        genDoc = new GenerationDoc(this);
                    IsEnabled = genDoc.goodDir(Repository) && Location == "TreeView";
                }
                  }
                  else
                        IsEnabled = false;
            }

            public void EA_MenuClick(EA.Repository Repository, string Location, string MenuName, string ItemName)
            {

            if (ItemName == "&Générer Nouvelle dll de calcul")
            {
                genModel.start();
            }
            else if ((MenuName == "-&Ajouter Activity" && ItemName == "&One") || ItemName == "&Ajouter Activity")
            {
                addAct.start();
            }
            else if (MenuName == "-&Ajouter Activity" && ItemName == "&All")
            {
                ((AddActivity)addAct).startAll();
            }
            else if ((MenuName == "-&Ajouter Condition" && ItemName == "&One") || ItemName == "&Ajouter Condition")
            {
                addcond.start();
            }
            else if (MenuName == "-&Ajouter Condition" && ItemName == "&All")
            {
                ((AddCond)addcond).startAll();
            }
            ...
 

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add-In Invalide parameters(topic not in good d
« Reply #7 on: July 25, 2012, 10:41:06 pm »
Yes, the main class.
No, I can't see anything obvious.
And if it works on your machine then it must be a problem with dll's not registering properly on the other machine.

Geert

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #8 on: July 25, 2012, 11:09:12 pm »
Quote
And if it works on your machine then it must be a problem with dll's not registering properly on the other machine.

this is what I think !
It's why I wanted to know what the error invalid parameter(s) mind !
(DLL not fund ? dependency not fund ? Both ? other ?)
(Globally, is it a error code precisely or much error can return it ? And how can I have more information on this error ?)

Sorry to persist but a Add-In how can't be deploy on other machine are useless ! :-/

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Add-In Invalide parameters(topic not in good d
« Reply #9 on: July 25, 2012, 11:27:20 pm »
I don't know. Have you tried Sparx Support?

Geert

Cisore

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Add-In Invalide parameters(topic not in good d
« Reply #10 on: August 01, 2012, 05:00:13 pm »
I succeeded !

I have add the /tlb option to the commande RegAsm
And I have signing the project !

(Proprieties | Signing  | sign the assembly )
 :D