09-20-2016 12:43 PM
What's the best way to check if a dataplugin is registered and if it's not load the data plugin via it's exe file.
We can use matlab plugin as a specific example. To install it, I have to run the .exe file and follow the prompts. So, how can I do this via Diadem? I can run an external program, sure, but is there some way to do it without input from the user?
Also, is using the plugin name the best way to see if it's installed? MatLab is the plugin name, does that ever change?
For background, I have a startup script that users point to, and I would like to have the script check for plugins and install if not already installed.
Thanks.
Solved! Go to Solution.
09-21-2016 07:22 PM
Hello,
I am not sure whether this will be possible. I have been doing some research today and there seemed to be nothing to find about it. I will do some further research and I'll let you know what I can find.
Regards,
09-23-2016 02:30 PM
Ok thank you for looking into it.
09-25-2016 07:22 PM
Actually, Brad mentioned that Andreas might have an idea. Should I submit a support ticket?
09-26-2016 07:39 AM - edited 09-26-2016 07:39 AM
Hello Russell,
I have actually been discussing this with Brad and he already provided some guidelines, but I still have a couple things to clarify.
You can sumbit a support ticket if you prefer, but I should have something for you soon.
Regards,
09-26-2016 08:37 AM
I'll wait for your reply here.
Thanks!
09-26-2016 04:12 PM
Hi Guys,
Here’s a VBScript function that checks if a DataPlugin is registered. For VBScript (*.uri) DataPlugins, it will also try to download and install the DataPlugin from the web site. The IF THEN statement will run the contents of the “DosCommand” variable synchronously, meaning it will wait to return until the DOS command is done. The standard DOS extension for msi installers will cause the DataPlugin installer to install invisibly. I see in my notes that “/o” and “/u” and “/v” have been used at different times, but I don’t recall if any of these are the invisible/silent mode. That should be Google-able, since it's an MSI attribute, not an NI thing.
IF NOT InstallUpdateDataPlugin("DEWESoft7") THEN Set WSH = CreateObject("WScript.Shell") Call WSH.Run("""" & DosCommand & """", 0, TRUE) END IF Function InstallUpdateDataPlugin(DataPluginName) Dim UpdateSource Set UpdateSource = Navigator.Settings.CreateUpdateSource() IF Navigator.Settings.RegisteredDataPlugins.Exists(DataPluginName) THEN IF UpdateSource.CompareVersion(DataPluginName) = eCompLowerVersion THEN
On Error Resume Next Call UpdateSource.Install(DataPluginName)
On Error Goto 0 END IF ELSE On Error Resume Next Call UpdateSource.Install(DataPluginName) On Error Goto 0 END IF InstallUpdateDataPlugin = Navigator.Settings.RegisteredDataPlugins.Exists(DataPluginName) End Function ' InstallUpdateDataPlugin()
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-30-2016 08:59 AM
Hello Russell,
Just wondering if you were able to test Brad's Suggestion. Were you able to get the script working?
Regards,
09-30-2016 09:56 AM
Hi, thanks for following up. No I have not tried it yet. I hope to soon, maybe this weekend.
I will be sure to post back my results, but Brad wrote it, so I'm confident it works. 🙂
Thanks.
10-01-2016 10:52 AM - edited 10-01-2016 10:57 AM
Hello Camilo/Brad: I have tried the installer, and it works well.
The only thing to note so far,
If I use 0 as the [intWindowStyle] parameter (second parameter) in the wsh.run command, the installations do no happen synchronously if I am calling Brads function whilst looping through a list of plugins, they occur all at the same time. So, maybe just for future reference, 1 seems to be the better choice. (User interaction is required for exe installs, anyway). Also, for future reference: https://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.84).aspx
I will provide more comments if I find anything else.
Thanks again!
-Russ