Macro Scheduler 14.1.04 Available

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Macro Scheduler 14.1.04 Available

Post by Marcus Tettmar » Fri May 09, 2014 11:16 am

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Fri May 09, 2014 7:23 pm

Hi Marcus,
Is there a script to check whether a new version is available, I usually use a batch file with wget to compare the trial versions from http://www.mjtnet.com/software/mssetup.exe and http://www.mjtnet.com/software/msched.zip against the versions in my hard disk folder, if difference, will auto download trial versions, thats when I know a new version is release, but your latest version isnt in same path and name, so it fails. :(

Any other method to check using a script(even ms script also can).

PS: I dont use the msched.exe to check for new versions.

User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Macro Scheduler 14.1.04 Available

Post by Marcus Tettmar » Sat May 10, 2014 6:09 am

Well, Macro Scheduler already does it for you if you have the news feed enabled.

But if you don't want to use that how about just using HTTPRequest to download the version history page, store a copy and just alert you when it changes: http://www.mjtnet.com/mswhatsnew.htm


I'd rather you requested that than downloaded the entire trial version release! Bandwidth isn't free!


Sent from my iPad using Tapatalk
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Sat May 10, 2014 2:12 pm

I use this method below but I dont know whats wrong with my code. :(

Code: Select all

IfFileExists>C:\MSVersion.html
  DeleteFile>C:\MSVersion.html
Endif
IfFileExists>C:\MSExist.txt
  DeleteFile>C:\MSExist.txt
Endif

HTTPRequest>http://www.mjtnet.com/downloads.htm,C:\MSVersion.html,GET,,HTMLResponse

ReadFile>C:\MSVersion.html,HTMLRes
Separate>%HTMLRes%,CRLF,TotalLines
Position>Click here</a> to download Macro Scheduler,HTMLRes,1,StartPos

IF>StartPos>0
  Let>k=1
  Repeat>k
    ReadLn>C:\MSVersion.html,k,line
    Position>Click here</a> to download Macro Scheduler,line,1,StartPos
    If>StartPos<>0
        Goto>SecondPart
    EndIf
    Let>k=k+1
  Until>k,%TotalLines_Count%
 
  Label>SecondPart
  ReadLn>C:\MSVersion.html,k,line
  MessageModal>line
  Trim>line,result
  MessageModal>result
  Position>Click here</a> to download Macro Scheduler,result,1,StartPos
  MidStr>result,StartPos,9,somevalue
  WriteLn>C:\MSExist.txt,somevalue,1
  ReadFile>C:\MSExist.txt,DownloadsRes
  MDL>DownloadsRes
ELSE
  //Display Error
  MDL>There was an error
ENDIF

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Mon May 12, 2014 10:10 am

Any help here? :?:

I only want to retrieve the version info from the picture attached.
Thanks

User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Macro Scheduler 14.1.04 Available

Post by Marcus Tettmar » Mon May 12, 2014 10:27 am

You don't need to download to a file and you can just use RegEx. This uses the vercheck.htm page which is where you end up if you check for new versions from the software:

Code: Select all

Let>URL=http://www.mjtnet.com/vercheck.htm
HTTPRequest>URL,,GET,,strHTML
Regex>(?<=version is: <b>).*?(?=</b),strHTML,0,matches,nm,0
Let>ver=matches_1
MessageModal>Current version is %ver%
But how about we make it simpler. I've made a new page on the site which does NOTHING more than display the version:

http://www.mjtnet.com/ver_only.htm

So all you need to do now is:

Code: Select all

HTTPRequest>http://www.mjtnet.com/ver_only.htm,,GET,,strVer
MessageModal>Version is: %strVer%
You could now store that somewhere. Probably quickest and easiest method is to use the registry:

Code: Select all

//Get current installed ver from registry (returns "" if not already set)
RegistryReadKey>HKEY_CURRENT_USER,Software\MJTNET\MSched14,verNum,curVer

//get latest version from web site
HTTPRequest>http://www.mjtnet.com/ver_only.htm,,GET,,strNewVer

//compare ...
If>curVer<>strNewVer
  MessageModal>There's a new version available
Endif

//write latest version to registry
RegistryWriteKey>HKEY_CURRENT_USER,Software\MJTNET\MSched14,verNum,strNewVer
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Thu May 15, 2014 3:01 pm

Thanks Marcus, I prefer using a file instead of registry. :D

Here's my final working script, in case anyone need it.

Code: Select all

ReadLn>msversion.txt,1,curVer
HTTPRequest>http://www.mjtnet.com/ver_only.htm,,GET,,strNewVer
Trim>curVer,curVer
MessageModal>Current version is %curVer%
If>curVer<>strNewVer
  MessageModal>There's a new version available
  MessageModal>New version is %strNewVer%
Endif
DeleteFile>msversion.txt
WriteLn>msversion.txt,result,strNewVer

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Thu Sep 11, 2014 5:41 pm

The above script no longer works, I receive "Current version is 302 HTTP/1.1 302 Found".

Anyone know why? :?:

User avatar
JRL
Automation Wizard
Posts: 3525
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Macro Scheduler 14.1.04 Available

Post by JRL » Thu Sep 11, 2014 7:43 pm

Notice the mjtnet URL is now https...

Try this:

Code: Select all

Let>HTTP_SSL=1
HTTPRequest>https://www.mjtnet.com/ver_only.htm,,GET,,strNewVer

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Fri Sep 12, 2014 4:09 am

Nope it still won't work give me "Current version is 404 Error connecting to host" now.

User avatar
Marcus Tettmar
Site Admin
Posts: 7394
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Macro Scheduler 14.1.04 Available

Post by Marcus Tettmar » Fri Sep 12, 2014 8:37 am

Have you installed OpenSSL? If not download it here: http://slproweb.com/download/Win32OpenSSL-1_0_1i.exe

Then this version of your script will work:

Code: Select all

ReadLn>msversion.txt,1,curVer
Let>HTTP_SSL=1
HTTPRequest>https://www.mjtnet.com/ver_only.htm,,GET,,strNewVer
Trim>curVer,curVer
MessageModal>Current version is %curVer%
If>curVer<>strNewVer
  MessageModal>There's a new version available
  MessageModal>New version is %strNewVer%
Endif
DeleteFile>msversion.txt
WriteLn>msversion.txt,result,strNewVer
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

newuser
Pro Scripter
Posts: 64
Joined: Tue Jun 11, 2013 4:53 pm

Re: Macro Scheduler 14.1.04 Available

Post by newuser » Mon Sep 22, 2014 11:27 pm

Thank you, your code works fine, and I only need to put these 2 files libeay32.dll and libssl32.dll in the same folder as the compiled exe, so that I dont need to install openssl. :D

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts