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++.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Identifying iMacros Version

Post by shaves » Mon Aug 28, 2017 8: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
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Identifying iMacros Version

Post by chivracq » Tue Aug 29, 2017 3:17 pm

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 6:37 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Identifying iMacros Version

Post by shaves » Tue Aug 29, 2017 6:11 pm

Thanks for the quick reply. I'll give this a try. I appreciate the help and quick turnaround.....
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Identifying iMacros Version

Post by chivracq » Tue Aug 29, 2017 6:44 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Identifying iMacros Version

Post by shaves » Fri Sep 08, 2017 9: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...........
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Identifying iMacros Version

Post by chivracq » Sat Sep 09, 2017 3:43 am

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 3:01 pm, edited 1 time in total.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
shaves
Posts: 77
Joined: Tue Apr 29, 2008 6:50 pm

Re: Identifying iMacros Version

Post by shaves » Mon Sep 11, 2017 2:38 pm

Thanks for the feedback. I appreciate your help with these questions.....
Post Reply