cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cada0310
Level 5

Using FlexNeT client side...

Hello,

I'm trying to write a command line based application whose job it will be to hit a FlexNeT server, query that server about a variety of products that I want to pull down updates for, and then pull down those updates.

What's the best way to attack this? I see that there is a Windows SDK, but that seems more geared towards automating the download/update inside a client application itself.

My service will pull all of the updates down to a particular folder (silently) where they can be deployed by an administrator.

I've also see that there are a set of web-service like objects that I could hit with queries, but I was wondering if there was any documentation or samples available for these kinds of operations?

So...SDK, or web services? Any thoughts?

Thanks,

Chris
0 Kudos
(10) Replies
Not applicable

The Windows SDK is probably closer to what you want. The web services are usually more aligned with creating updates or something more of that nature.

The way you would do this is have your Service invoke the necessary Windows Agent APIs, collect the updates manually, and download them as necessary. The major points to start looking would be at the USAgent, NotificationCollection, and Notification interfaces.

You can find lots of information and samples for those in the docs, but if you have specific questions you can either ask here or contact support if you have a valid support plan.

The biggest concern with this model you will want to ensure you address as best as possible is security related to running a Service in the background. Normally, these things work without issue, but dependent on your environment it may be a source of problems. Generally, the Agent is invoked over a COM boundary, so whatever user your service runs as would need to have access to COM servers ( which normally they do ) as well as internet access ( not all accounts have this ).
0 Kudos
timstspry
Level 7

Chris, be aware that the sample code as well as the samples included in the SDK are written in VB6. May not be a problem for you, but it was for me.

Tim
0 Kudos
cada0310
Level 5

Thanks for your replies - I finally got time to start messing with this.

My test code is here:

// Do our thing.
// Instantiate our flexnet connect object.
string productcode = "{AF1D9E51-D922-71D5-1B43-02105A9346E9}";

USAgent agent = new USAgent();

agent.SetNotificationServerURL(productcode, "http://my_flexnetserver_ip_address");

NotificationCollection NC;

if (agent.IsConnectedToNotificationServer(productcode) == true)
{
NC = agent.GetNotificationCollection(productcode);

foreach (Notification n in NC)
{
string sTitle = n.GetProperty(NotificationProperty.NP_TITLE);

}
}

But I get this exception when I hit the SetNotificationServerURL line:

System.Runtime.InteropServices.COMException was unhandled by user code
Message="The Software Manager does not recognize this product. Please contact your software vendor for updates to this product. Error 13003: Version Not Registered with the FLEXnet Connect."


I'm guessing that either the IP address given to me for our server is wrong, or the test product code is wrong?

Thanks,

Chris
0 Kudos
cada0310
Level 5

Hmm...more data...I seem to get that exception even with a bogus IP address in there...I think I'm missing something with setting up the agent...
0 Kudos
timstspry
Level 7

Chris, you must have the product that you want to check for updates installed on your development computer. For example, I started out with a simple test project, probably like you are doing, but I had to write an InstallShield installer that installed my test application on my development computer. Are you self-hosted for FLEXnet Connect, or Acresso-hosted?

I am self-hosted and was able to register my product via InstallShield 2010 with the FLEXnet Connect server. I am not sure how that works with an Acresso-hosted solution.

Hope this helps!

Tim
0 Kudos
cada0310
Level 5

Hi Tim,

Thanks for the information..this might be a problem for me.

You see, we're developing a service that downloads a bunch of different packages and stores them on a disk to be deployed manually by an administrator. The packages/products aren't installed on the system this service is running on at all...but the service keeps a database of what it has downloaded and what the latest version it has is.

Is there another way to do this?

Chris
0 Kudos
cada0310
Level 5

Some more data:

I'm now using this code below and having somewhat better results. The Register() call works, IsServiceEnabled() returns true, but IsConnectedToNotificationServer() always returns false for some reason.


string productcode = "{AF1D9E51-D922-71D5-1B43-02105A9346E9}";

USAgent agent = new USAgent();
agent.Register(productcode, "1.0", LanguageCode.English, "http://x.x.x.x", "Default", true, null);

Boolean bIsEnabled = false;
bIsEnabled = agent.IsServiceEnabled(productcode);

NotificationCollection NC;

if (agent.IsConnectedToNotificationServer(productcode) == true)
{
NC = agent.GetNotificationCollection(productcode);

foreach (Notification n in NC)
{
string sTitle = n.GetProperty(NotificationProperty.NP_TITLE);

}
}
0 Kudos
TimStVCS
Level 7

Chris, I believe you are missing setting the URL of the Notification Server. Should be something like:

fncAgentObj.SetNotificationServerURL(PC,"http://myURL")
You can use hard-coded IP address or resolved DNS name for the URL.

You would issue this command prior to checking if you are connected to the notification server.

Hope this helps!

Tim
0 Kudos
cada0310
Level 5

Heroic!

Thanks Tim, that was the last step for me to get back the results collection. I appreciate your help...hopefully this will be my last question for a while, but I have a bad feeling... 🙂

Chris
0 Kudos
Not applicable

cada0310 wrote:
Some more data:

I'm now using this code below and having somewhat better results. The Register() call works, IsServiceEnabled() returns true, but IsConnectedToNotificationServer() always returns false for some reason.


string productcode = "{AF1D9E51-D922-71D5-1B43-02105A9346E9}";

USAgent agent = new USAgent();
agent.Register(productcode, "1.0", LanguageCode.English, "http://x.x.x.x", "Default", true, null);

Boolean bIsEnabled = false;
bIsEnabled = agent.IsServiceEnabled(productcode);

NotificationCollection NC;

if (agent.IsConnectedToNotificationServer(productcode) == true)
{
NC = agent.GetNotificationCollection(productcode);

foreach (Notification n in NC)
{
string sTitle = n.GetProperty(NotificationProperty.NP_TITLE);

}
}



While the SetNotificationServerURL will technically fix this for you, you can avoid having to call that completely by including the trailing slash in the URL provided to the USAgent::Register API. This means your URLs should look similar to:
http://updates.installshield.com/
or
http://64.14.29.50/

Also, the 13003 error was occurring because there was a product version mismatch between what was registered locally and what was registered on the Publisher site. FNC is version sensitive such that version 1.00 is not equal to 1.0 or 1.00.000 and so on.

Hopefully those guidelines can be of further assistance.
0 Kudos