Jump to content

Precompile compile


Jewtus
 Share

Recommended Posts

I'm trying to setup the compile command in autoit to compile some other au3 scripts prior to compiling the primary script.

When I do this bat file:

set autoitcompiler="C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe"
Set Sendemail="C:\Sources\NewTools (autoit based)\Send Emails.au3"

%autoitcompiler% /in %Sendemail%

the bat file will compile, but I'm wondering if I can setup Autoit to precompile without using the .bat file.

I tried this:

#AutoIt3Wrapper_Run_Before='"C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe"' /in "%scriptdir%\Send Emails.au3" 

but I get an error message

 

 

'C:Autoit' is not recognized as an internal or external command, operable program or batch file.

so I tried various different methods for putting quotes around the path but I cannot seem to get it working.

Anyone have suggestions on how to fix this?

Edited by Jewtus
Link to comment
Share on other sites

....or put it in a path that does not have spaces and troubleshoot something else.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Unfortunately, the pathnames are going to have spaces (set by server admin) so I'm trying to work around their silly settings.

I've tried the following:

#AutoIt3Wrapper_Run_Before=C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe /in "%scriptdir%\Send Emails.au3" 

#AutoIt3Wrapper_Run_Before="C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe" /in "%scriptdir%\Send Emails.au3" 

#AutoIt3Wrapper_Run_Before='C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe' /in "%scriptdir%\Send Emails.au3" 

#AutoIt3Wrapper_Run_Before=""C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe"" /in "%scriptdir%\Send Emails.au3" 

#AutoIt3Wrapper_Run_Before='"C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe"' /in "%scriptdir%\Send Emails.au3"

Worst case scenario, I can use the bat script and just it first.

Link to comment
Share on other sites

Use @ScriptDir instead of the environment variable and see if that works. Its entirely possible the wrapper program has no idea what %scriptdir% means.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

can you use 8.3 names? or filegetshortname?

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Use @ScriptDir instead of the environment variable and see if that works. Its entirely possible the wrapper program has no idea what %scriptdir% means.

For the compiler, you need to use %scriptdir%

From the compiler:

 

These commands will be executed one at a time as cmdline commands. 

The Commandlines can contain the following variables:
  %in% , %out%, %outx64%, %icon% which will be replaced by the fullpathfilename.
  %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.
  %fileversion% set to the #AutoIt3Wrapper_Res_Fileversion directive value.
  %scitedir% will be replaced by the SciTE program directory
Examples:
   copy "%in%" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\"
   copy "%out%" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\"
   start aacopy.bat "%out%" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\"

 

This error is the dead giveaway though:

'C:Autoit' is not recognized as an internal or external command,

Its a problem with the spaces in the file name so it needs to be qualified with quotes, but I have a feeling quotes are being removed by the compiler....

@Boththose

What do you mean by 8.3 names? I've worked with shortnames before but I'm not entirely sure how they work... I know that its usually like the first 5 letters and then ~1 or something.

Edited by Jewtus
Link to comment
Share on other sites

msgbox(0, '' ,  filegetshortname("C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe"))

see if that string works for your path.

 

*and i have no idea how they work, but they are better than messing with spaces and quotes.

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Ok so that does work... Is there a way to call the shortname from within the compile wrapper?

For example:

$AutoitCompiler=FileGetShortName('C:\Autoit - Portable\Beta\Aut2Exe\Aut2exe.exe')
#AutoIt3Wrapper_Run_Before= $AutoitCompiler /in "%scriptdir%\Get Master with survey.au3"

When I used:

C:AUTOIT~1BetaAut2ExeAut2exe.exe

It works perfectly, but I don't want to have to redo the shortname if I migrate the script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...