TheSwamp

CAD Forums => CAD General => Topic started by: Kotofej on July 08, 2016, 10:37:35 AM

Title: plug in bundle fails to load
Post by: Kotofej on July 08, 2016, 10:37:35 AM
Hello to all,

as the title suggests, I have problems (as anticipated) with something which looked decievingly simple at first glance. After following Autodesk's instructions and resources from the web, I created a simple testing .bundle folder with the accompanying .xml file, as well as a .lsp file. I placed it in all possible folders (Program data..., Program files..., User...) and after launching AutoCAD, a bubble appears and says "Unable to load unnamed plugin" (using AutoCAD 2014). Also, the log file is pretty useless.

I tried to download some free plugins - which all work normally - from the app store and compare their content (specially the .xml file) and saw no discrepancies of concerns. Although these apps used an installer which possibly made some additional changes which I didn't make in order for the plugins to work.

I am interested if anyone has any experience with .bundle-ing up their applications and if so, any advice is highly appreciated. On request, I can post more details if needed.
Title: Re: plug in bundle fails to load
Post by: Jeff_M on July 08, 2016, 12:30:08 PM
Can you share the bundle here?
Title: Re: plug in bundle fails to load
Post by: Atook on July 08, 2016, 12:33:38 PM
What version of CAD are you running? Security requirements for bundles changed with 2017.
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 08, 2016, 12:38:42 PM
I'm using AutoCAD 2014. I added the bundle to the attachment.

Title: Re: plug in bundle fails to load
Post by: ChrisCarlson on July 08, 2016, 12:54:16 PM
Is it a full version of 2014 or LT?
Title: Re: plug in bundle fails to load
Post by: Jeff_M on July 08, 2016, 01:02:47 PM
This line needs a space added:
   <RuntimeRequirementsOS="Win32|Win64|MacOS" Platform="AutoCAD|AutoCAD*"/>

so it looks like this:
   <RuntimeRequirements OS="Win32|Win64|MacOS" Platform="AutoCAD|AutoCAD*"/>

It then loads and the command runs, using Autocad 2016 and placing the bundle in C:\ProgramData\Autodesk\ApplicationPlugins
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 08, 2016, 02:42:34 PM
My bad, this was a trivial mistake.

But unfortunately, this still doesn't work for me. Btw, I'm not using LT

Edit: interestingly, I have 3 other apps (some default apps) in that folder and they all load with no problems.
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 08, 2016, 05:59:39 PM
Just an observation -

Only "AutoCAD*" is needed, as "AutoCAD|AutoCAD*" is redundant for any version that supports the former (2013-2017).

*If* memory serves, only 2012 version requires each-and-every-single product to be specified.


Cheers
Title: Re: plug in bundle fails to load
Post by: Jeff_M on July 08, 2016, 08:40:02 PM
Kotofej, I tested with C3D 2014 and your bundle loaded perfectly for me.
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 09, 2016, 03:40:01 AM
Bizzare, right now I'm thinking of actually reinstalling AutoCAD.
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 09, 2016, 08:12:55 AM
By the way, should the folder ProgramData/... be specified in the support file search path, if not?

Edit: a side note - when I type "appmanager" in the command prompt, the app shows up there, although after right-clicking it, I can't do anything. So it appears the app is recognized, but not loaded.
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 09, 2016, 04:00:24 PM
This is representative of how incomplete, or improperly implemented the Autoloader mechanism really is....

PackageContents.xml loading properly registers the App (and Commands?), but does not ensure that the dependent executable file(s) are loaded... And does not un-register the App, should the loading of the executable(s) fail.
Title: Re: plug in bundle fails to load
Post by: kdub_nz on July 09, 2016, 06:52:55 PM
This is representative of how incomplete, or improperly implemented the Autoloader mechanism really is....

PackageContents.xml loading properly registers the App (and Commands?), but does not ensure that the dependent executable file(s) are loaded... And does not un-register the App, should the loading of the executable(s) fail.

Don't expect it to be fixed ... they're too busy Forging ahead ...
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 10, 2016, 12:27:02 PM
I am somehow getting an implicit message here which says: "Better avoid using plug-ins as a mean of app distribution."
Title: Re: plug in bundle fails to load
Post by: Jeff_M on July 10, 2016, 12:56:23 PM
Kotofej, the bundle system works well...once you get it setup correctly. I've now tested your bundle (after that minor edit) on 2 computers and it's working fine.
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 10, 2016, 01:39:21 PM
OK, if I manage to solve this problem, I'll post what it was. Obviously something related specifically to my computer.

Anyways, thanks to all of you for your feedback!
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 10, 2016, 01:42:25 PM
Kotofej, the bundle system works well...once you get it setup correctly.

This.

I'm a big fan of the Autoloader mechanism, actually - I use it both for my own daily work for custom internal tools, as well as SincPac.  :wink:

I also publish a few of my smaller apps at Autodesk Exchange, and merely pointed out Autodesk's historical pattern of introducing something, and being okay with things not being what they could be; this is no different than many of the long-standing bugs, etc within AutoCAD itself.

Another example of this, with regard to Autoloader, is custom system variables - Int variable type is not properly implemented, the way string types are, and there is no means by which to implement a bit-coded sysvar via PackageContents.xml directly.

I didn't mean to deter you from Autoloader, as it is exceptionally good at the few things that it does; as Jeff aptly points out, you just need to be mindful to use it well.


Cheers
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 10, 2016, 05:39:20 PM

Don't expect it to be fixed ... they're too busy Forging ahead ...

Code - C#: [Select]
  1. Modes normality = this.Mode;
  2. this.Mode = Modes.ExpectationsManaged;
  3.  

This, too.  :|

Code - C#: [Select]
  1. this.Mode = normality;
  2.  

Title: Re: plug in bundle fails to load
Post by: Kotofej on July 13, 2016, 11:54:29 AM
Just to inform you, I finally got this to work. It turns out that replacing the line

<RuntimeRequirements OS="Win32|Win64|MacOS"Platform="AutoCAD*"/>

with

    <RuntimeRequirements OS="Win32|Win64|MacOS" Platform="AutoCAD*"/>

did the job. Although I'm a bit surprised that the space between " and Platform made a difference, I'm pretty new to xml, and I assume this is possibly a bug? Since I would expect it to ignore a blank space at the end of the last function argument (the string "Win32|Win64|MacOS"). Pretty terrible.
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 13, 2016, 05:50:20 PM
The spacing is only really an issue following an XmlNode, XmlAttribute's value, etc... Once separated, multiple spaces can be used without issue, but there needs to be a space, or it time up the works. *shrugs*
Title: Re: plug in bundle fails to load
Post by: Jeff_M on July 13, 2016, 06:04:21 PM
Kotofej, looks like my post showing that I added a space before the OS also shows that space before Platform. I do not recall adding it, but I did load the packagecontents file into XMLEditor. Perhaps it automatically added the other space. Sorry I didn't notice that earlier.

You may want to grab XMLEditor. Using this is what led me to find the first missing space, as it would not load due to an error on line XX. Once you learn how to use it, it's much easier (imho) to create & edit xml files.
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 13, 2016, 11:03:24 PM
I just use Notepad++; it's free, and can be configured for custom theme, syntax highlighting, etc.
Title: Re: plug in bundle fails to load
Post by: kdub_nz on July 13, 2016, 11:34:24 PM
[gump]

free isn't always the cheapest

[/gump]
Title: Re: plug in bundle fails to load
Post by: BlackBox on July 13, 2016, 11:53:26 PM
[gump]

free isn't always the cheapest

[/gump]

 :-D

... I know some folks that still use Notepad. *chortle*

(http://img2.izismile.com/img/img6/20130228/1000/where_every_day_abbreviations_actually_come_from_10.gif)
Title: Re: plug in bundle fails to load
Post by: Kotofej on July 15, 2016, 01:47:13 PM
I also use Notepad++, however it does not highlight such syntax errors. Anyways, I'm glad that the answer to the problem was trivial, as it is in many cases. Thanks for the help and tips, folks!
Title: Re: plug in bundle fails to load
Post by: dgorsman on July 18, 2016, 10:38:18 AM
If you're already using Visual Studio, it has a decent XML editor as well.  While it has its downsides, the fact that XML can be done with something as simple as notepad is a benefit - when I need to make small tweaks to data I don't need a full-blown application to do so.