Jump to content

Special character with recorded au3 and include file problem


ur
 Share

Recommended Posts

I have recorded a gui installation and modified the au3 file as per my requirement.

But the problem is, whenever I try to compile the au3 file, I am getting a special character on top of the file.

aaaa.PNG

Can you suggest how to resolve this as it is appearing everytime during compilation.

And also I am trying to include a au3 file which is separate folder so I am adding the <..\Library.au3> line.

It is able to pick that but in that file "Library.au3" there is a file install line.

FileInstall(".\SendMail.ps1", @ScriptDir & "\SendMail.ps1")

Library.au3 is being used by many other codes in the previous folder..

But the current file is looking for the ps1 file in current folder.

So is there any option to tell the compiler to pick the dependent files relative to Library.au3 instead of the current code.

Link to comment
Share on other sites

On ‎2‎/‎13‎/‎2017 at 6:56 PM, Subz said:

What is the .au3 file encoding?

With regards to FileInstall, in your library any reason you can't use an absolute path rather than a relative path for your source?

Because I have synced this with GitHub and the work is not fixed to one machine, as workstations may vary I am keeping everything relative to the sourcecode folder.

May be a silly question, how to check the encoding?

Edited by ur
Link to comment
Share on other sites

Does anyone compile library.au3 directly?  Are all scripts in child folders? for example

  • library.au3
  • sendmail.ps1
    • Scripts Sub Folder
    • Script1 to Compile.au3
    • Script2 to Compile.au3

If so you could change the library.au3 to use FileInstall('..\SendMail.au3', @ScriptDir & '\SendMail.au3'), but this all depends on your folder structure, I personally work the other way around for example:

  • Script1 to Compile.au3
  • Script2 to Compile.au3
    • Resources Sub folder
    • library.au3
    • sendmail.ps1
Link to comment
Share on other sites

library.au3 is the common one with the team and also for other tools, if any common functionaly one is there, we are saving those to library.au3 so that we can use it for multiple tools and also for future purpose to reduce redundancy.

So it is there in parent folder.

I am able to compile my au3 by including it as "../library.au3".

But the dependent files sendmail.ps1 it is checking in my au3 directory instead of the library.au3 folder.

 

Link to comment
Share on other sites

You could change the library.au3 FileInstall to:

FileInstall("..\SendMail.ps1", @ScriptDir & "\SendMail.ps1")

But that would mean your team would always have to create scripts at the same level as your current script.  Alternatively just remove the FIleInstall from the library leave SendMail.ps1 in the parent folder and then add the line above to your individual scripts.

 

 

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

×
×
  • Create New...