Identifying iMacros Version

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Identifying iMacros Version

by shaves on Mon Aug 28, 2017 1:43 pm

I have a macro that will work in version 11 because it is using the EVENT command. I want to add a little script, at the beginning of my macro, to identify if the user is using version 11. In the past, we had a script (see below) to identify if the user was on version 6 or 7 (I pulled this out of an old macro). I've tried to modify it to check for version 11. However, v11exe is always false and I need it to be true if the user has version 11. Currently, our users have version 10.3 or 11. The macro works for 11 but not 10.3 when pushing a button to run a query. I want to add a script to the beginning of the macro; so it will stop if v11exe is false and then display a popup that you must have version 11 to use this macro. Any suggestions? Thanks of your help........

Sub iMacVersion()

v6Path = False
v6exe = False
v7Path = False
v7exe = False
v11Path = False ' new
v11exe = False 'new

Set ObjScr = CreateObject("Scripting.FileSystemObject")

v6Path = ObjScr.FolderExists("C:\Program Files\iMacros")
v7Path = ObjScr.FolderExists("C:\Program Files\iOpus\iMacros")
v11Path = ObjScr.FolderExists("C:\Program Files\Ipswitch\iMacros") 'new
If v6Path = True Then v6exe = ObjScr.FileExists("C:\Program Files\iMacros\iMacros.exe")
If v7Path = True Then v7exe = ObjScr.FileExists("C:\Program Files\iOpus\iMacros\iMacros.exe")
If v11Path = True Then v11exe = ObjScr.FileExists("C:\Program Files\Ipswitch\iMacros\iMacros.exe") 'new

Set ObjScr = Nothing

End Sub
shaves
 
Posts: 56
Joined: Tue Apr 29, 2008 11:50 am

Re: Identifying iMacros Version

by chivracq on Tue Aug 29, 2017 8:17 am

shaves wrote:I have a macro that will work in version 11 because it is using the EVENT command. I want to add a little script, at the beginning of my macro, to identify if the user is using version 11. In the past, we had a script (see below) to identify if the user was on version 6 or 7 (I pulled this out of an old macro). I've tried to modify it to check for version 11. However, v11exe is always false and I need it to be true if the user has version 11. Currently, our users have version 10.3 or 11. The macro works for 11 but not 10.3 when pushing a button to run a query. I want to add a script to the beginning of the macro; so it will stop if v11exe is false and then display a popup that you must have version 11 to use this macro. Any suggestions? Thanks of your help........

Code: Select all
Sub iMacVersion()

v6Path = False
v6exe = False
v7Path = False
v7exe = False
v11Path = False              ' new
v11exe = False                'new

Set ObjScr = CreateObject("Scripting.FileSystemObject")

v6Path = ObjScr.FolderExists("C:\Program Files\iMacros")
v7Path = ObjScr.FolderExists("C:\Program Files\iOpus\iMacros")
v11Path = ObjScr.FolderExists("C:\Program Files\Ipswitch\iMacros")                             'new
If v6Path = True Then v6exe = ObjScr.FileExists("C:\Program Files\iMacros\iMacros.exe")
If v7Path = True Then v7exe = ObjScr.FileExists("C:\Program Files\iOpus\iMacros\iMacros.exe")
If v11Path = True Then v11exe = ObjScr.FileExists("C:\Program Files\Ipswitch\iMacros\iMacros.exe")               'new

Set ObjScr = Nothing

End Sub

Ah...!, better indeed as an apart Thread than included as Sub-Qt in your previous Thread as the Answer might interest other Users as well... :wink:

Well, if the Folder Structure for iMB is different for each Version (you don't post the Structure for iMB v10 btw, but I guess it will be different than for iMB v11/v11.5), the "Idea" is to "misuse" '!DATASOURCE' and/or '!FOLDER_DATASOURCE' on the Folder and/or on the 'iMacros.exe' File as all Combinations will return some (different) Runtime Errors depending on if the Folder or '.EXE' exists or not... (except with '!FOLDER_DATASOURCE' on an existing Folder of course...)
=> After running a mini-"fake" Script where you "pretend" to set '!FOLDER_DATASOURCE' and/or '!DATASOURCE', you simply need to check the Runtime Error from your main '.vbs' Script (the Technique would work as well for a '.js' Script) with the Return Code or even more precisely with 'iimGetErrorText()' to pull your Conclusion on the iMB Version...

If using '!FOLDER_DATASOURCE', you can only use this Command on the Folder and not on the '.EXE' (because the RuntimeError is the same if the File exists or not), and you need to track the "real" DataSource Folder to reset it back to its real Value if your whole Script uses a DataSource, so that's maybe a bit cumbersome compared to '!DATASOURCE' which "works" simpler on both existing and non-existing Folder and '.EXE' by each time returning a (different) RuntimeError for all 4 Combinations...

For the little Test Script below, I don't have iMB installed, so I ran my Tests on some 'Dropbox' Install where only '\client\Dropbox.exe' exists. (=> '\client2\' and 'Dropbox6.exe' do not exist...):
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
'SET !ERRORIGNORE YES
TAB T=1

SET !FOLDER_DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\
'=> No RuntimeError but you need to track the "real" DataSource Folder and to reset it to its real Location...!

'SET !FOLDER_DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client2\
'RuntimeError: can not open FOLDER_DATASOURCE: C:\Program Files (x86)\Dropbox\Client2\, line 7 (Error code: -931)

'SET !FOLDER_DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\Dropbox.exe
'RuntimeError: can not open FOLDER_DATASOURCE: C:\Program Files (x86)\Dropbox\Client\Dropbox.exe, line 10 (Error code: -931)

'SET !FOLDER_DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\Dropbox6.exe
'RuntimeError: can not open FOLDER_DATASOURCE: C:\Program Files (x86)\Dropbox\Client\Dropbox6.exe, line 13 (Error code: -931)

'>

'SET !DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\
'NS_ERROR_FILE_ACCESS_DENIED: Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileInputStream.init], line 13 (Error code: -1001)

'SET !DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client2\
'RuntimeError: Data source file does not exist, line 13 (Error code: -930)

'SET !DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\Dropbox.exe
'Error: Component returned failure code: 0x80500001 [nsIConverterInputStream.init], line 9 (Error code: -1001)

'SET !DATASOURCE C:\Program<SP>Files<SP>(x86)\Dropbox\Client\Dropbox6.exe
'RuntimeError: Data source file does not exist, line 19 (Error code: -930)

PROMPT FOLDER_DATASOURCE:<SP>{{!FOLDER_DATASOURCE}}<BR>DATASOURCE:<SP>{{!DATASOURCE}}
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)

>>>

Another Method is to use the Method described in this HowTo from TechSupport, that you can probably adapt to your Needs:
- How to determine iMacros folder locations from VBScript

>>>

And I've upped your Qt on SOF, ah-ah...!
I cannot answer Threads (anymore) on SOF because of their stupid Reputation Points System after one stupid User who didn't like my "Style" downvoted all my Posts and Answers on SOF and managed to kind of lock me as I don't have enough Rep-Points now to be able to post, ah-ah...! :roll:
Last edited by chivracq on Tue Aug 29, 2017 11:37 am, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Identifying iMacros Version

by shaves on Tue Aug 29, 2017 11:11 am

Thanks for the quick reply. I'll give this a try. I appreciate the help and quick turnaround.....
shaves
 
Posts: 56
Joined: Tue Apr 29, 2008 11:50 am

Re: Identifying iMacros Version

by chivracq on Tue Aug 29, 2017 11:44 am

shaves wrote:Thanks for the quick reply. I'll give this a try. I appreciate the help and quick turnaround.....

And I guess using Tom's Method that you can probably directly access the iMB Version which is very probably stored in the Registry as well...
This is a common "Standard" in the Software Industry, even the iMacros for FF Add=on has its Version mentioned in 'about:config' where all Settings are stored...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Identifying iMacros Version

by shaves on Fri Sep 08, 2017 2:32 pm

On the SOF forum, I got a suggestion to use "iimGetInterfaceVersion" to identify the iMacros version. As far as I know, there are 2 different version in our user population, 10.3 / 11.0.

I put together a little macro (visual basic) that uses "iimGetInterfaceVersion" and I'm getting consistent results with either the Enterprise version or the Player version.

Version 10. 3 returns 1001011632 or 1001011664
Version 11. 0 returns 1020012032 or 1020012064

I added a little code to the macro I was working on (and the one that started this issue). The code runs "iimGetInterfaceVersion" and if the variable (that captures this value) returns either 1020012032 or 1020012064, it appears iMacros 11.0 is installed and it keeps running. If it isn't one of these values, it stops and says they need to have version 11.0

I think I'm going to change the code so that it says if the variable is greater than or equal to either 1020012032 or 1020012064, then keep running. This should cover me if the number changes slightly due to a future release or update.

Do you see any issue or potential issue with using "iimGetInterfaceVersion" this way? So far this has worked great with everyone that has tested it. Thank you in advance for your feedback...........
shaves
 
Posts: 56
Joined: Tue Apr 29, 2008 11:50 am

Re: Identifying iMacros Version

by chivracq on Fri Sep 08, 2017 8:43 pm

shaves wrote:On the SOF forum, I got a suggestion to use "iimGetInterfaceVersion" to identify the iMacros version. As far as I know, there are 2 different version in our user population, 10.3 / 11.0.

I put together a little macro (visual basic) that uses "iimGetInterfaceVersion" and I'm getting consistent results with either the Enterprise version or the Player version.

Version 10. 3 returns 1001011632 or 1001011664
Version 11. 0 returns 1020012032 or 1020012064

I added a little code to the macro I was working on (and the one that started this issue). The code runs "iimGetInterfaceVersion" and if the variable (that captures this value) returns either 1020012032 or 1020012064, it appears iMacros 11.0 is installed and it keeps running. If it isn't one of these values, it stops and says they need to have version 11.0

I think I'm going to change the code so that it says if the variable is greater than or equal to either 1020012032 or 1020012064, then keep running. This should cover me if the number changes slightly due to a future release or update.

Do you see any issue or potential issue with using "iimGetInterfaceVersion" this way? So far this has worked great with everyone that has tested it. Thank you in advance for your feedback...........

Hum..., yep indeed, I didn't know this Command, even if it is indeed documented in the Wiki..., but I don't use any '.js' Scripts myself, I do everything in pure '.iim', so I only know the Commands other Users use in their Scripts posted on the Forum, ah-ah...!

Hum, strange Numbers I would think, especially "10200120-32/64" for v11... And iMB v11.0 and v11.5 both return the same Value...? :o
But they could have called it stg like "11000120-32/64" and "11500120-32/64", I would think...! But I guess the Scripting Interface didn't get any Change(s) between v11.0 and v11.5, you are a bit "lucky" it doesn't make a Difference in your Case, ah-ah...!

And yep, you are probably right about using some "if >=1020012032", because iMB v12.0 just got released 1 or 2 weeks ago, which probably got some higher Return Value...
Last edited by chivracq on Mon Sep 11, 2017 8:01 am, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Identifying iMacros Version

by shaves on Mon Sep 11, 2017 7:38 am

Thanks for the feedback. I appreciate your help with these questions.....
shaves
 
Posts: 56
Joined: Tue Apr 29, 2008 11:50 am


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 2 guests

-->