Getting includes, images to show up in compiled exe

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Getting includes, images to show up in compiled exe

Post by Warren » Wed Oct 18, 2017 5:32 pm

I'm starting to work with the compiler and currently re-reading the manual. Since I had already created quite a few scripts that may all need to be changed to work with the compiler, I'd like to see if I can clarify a few things first:

1) I'm having an issue where nested includes aren't working. In other words, main script has include for header, and header has include for variables. Header shows up in compiled exe, but variables don't. Is this a limitation of compiling in MS, or should I look elsewhere to troubleshoot? (In both cases, the scripts are in script directory and called by %SCRIPT_DIR% is specified in manual)

2) Images aren't showing up either (box was checked.) i see in instructions that it installs BMP_DIR in same location as exe. This isn't happening, though, so trying to troubleshoot. I'm just getting the exe and incv.dll in destination folder. I have my BMP_DIR defined as Let>BMP_DIR={%SCRIPT_DIR%+"\Images"} Is it the fact like above that the BMP_DIR path is defined in the header which is then called by the main file? Should I be looking at some other potential cuase?

3) My original plan was to drop exe shortcut in windows startup folder so it launches on startup. Can the launch on startup option be baked into the exe, and if so, is this preferable for some reason?

thx

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

Re: Getting includes, images to show up in compiled exe

Post by Marcus Tettmar » Wed Oct 18, 2017 7:04 pm

Hi,

1) The parser only looks at the main script for Includes to "compile in". So any nested further down need to be supplied as .scp files with the .exe.

2) When you compile the BMP_DIR should be created and copied over. But again maybe you have these images references in a nested include which the parser isn't seeing. In any case you have misunderstood BMP_DIR is a subfolder at the same level as the script/exe which has the same name as the script/exe. You do not need to define it as long as you have that folder present. See this help article:
http://help.mjtnet.com/article/167-rela ... and-bmpdir
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Re: Getting includes, images to show up in compiled exe

Post by Warren » Thu Oct 19, 2017 12:10 am

That is how I thought %SCRIPT_DIR% worked, but I wasn't aware of the automatically assigned script name matching nature of %BMP_DIR%.

It seems to make more sense for me to have a single Images folder, and taking the time to give descriptive names to each image which can be used over and over by different scripts. I understand this may not be the workflow that works best for other people, but I'm doing many scripts involving the same few sites over and over.

I'm currently just redefining %BMP_DIR% as {%SCRIPT_DIR%+"\Images"} and copying the Images folder over manually. Maybe there's a better solution. Still experimenting.

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

Re: Getting includes, images to show up in compiled exe

Post by Marcus Tettmar » Thu Oct 19, 2017 9:01 am

Absolutely use what works best for you. If you are compiling and wanting to make your macros portable you could even have an INI file which you define paths in. Store it in the .exe location. Reference the INI file in ReadINIfile with %SCRIPT_DIR% and have BMP_DIR set via some setting in this INI file. That way it's easy to move around and configure without modifying/recompiling the code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Warren
Pro Scripter
Posts: 83
Joined: Sun Oct 08, 2017 11:57 pm

Re: Getting includes, images to show up in compiled exe

Post by Warren » Thu Oct 19, 2017 6:24 pm

I may try that.

Just noticed something else that might not work with my method of multiple scripts in a single folder with a single shared images subfolder. When I compile to exe, it creates a ircv.dll file.

Would compiling multiple scripts to that same folder create a conflict since each would then be looking for it's own version of file by that same name?

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

Re: Getting includes, images to show up in compiled exe

Post by Marcus Tettmar » Fri Oct 20, 2017 11:51 am

That's just the runtime DLL needed for image recognition. They can all use the same one. This is not script specific. It's just making sure it's there - as it needs to be same location as .exe. If all your exes are in same location then only one is needed. And only one is needed for the master .exe
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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