취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

How to register an exe dataplugin via a vbs script?

해결 완료!
솔루션으로 이동

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. 

0 포인트
1/15 메시지
5,949 조회수

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,

Camilo V.
National Instruments
0 포인트
2/15 메시지
5,908 조회수

Ok thank you for looking into it.  

0 포인트
3/15 메시지
5,872 조회수

Actually, Brad mentioned that Andreas might have an idea.  Should I submit a support ticket? 

0 포인트
4/15 메시지
5,833 조회수

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,

Camilo V.
National Instruments
0 포인트
5/15 메시지
5,812 조회수

I'll wait for your reply here. 

 

Thanks!

0 포인트
6/15 메시지
5,806 조회수
솔루션
승인자 RussellSenior

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

 

7/15 메시지
5,792 조회수

Hello Russell,

 

Just wondering if you were able to test Brad's Suggestion. Were you able to get the script working?

 

Regards,

Camilo V.
National Instruments
0 포인트
8/15 메시지
5,620 조회수

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. 

0 포인트
9/15 메시지
5,613 조회수

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

0 포인트
10/15 메시지
5,598 조회수