Jump to content

Automatically set #AutoIt3Wrapper_Res_ProductVersion value equal to #AutoIt3Wrapper_Res_Fileversion value?


Go to solution Solved by Jos,

Recommended Posts

5 hours ago, Jos said:

Why now simply set this in the AutoIt3Wrappper.ini:

To be honest I never used it. But the eloquence of my explication should have move you so deep, emotionally, that the requested change would have been attended to immediately and with out challenge. You see, that's why I tend to use emojis to compel those I reach 💛
In my prior posting I did not use any emoji, hence the intellectual challenge 💢

In the future, rest assured, a greater number of these will be use 😿

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Developers
  • Solution
38 minutes ago, TimRude said:

So I thought I'd try changing the line in my AutoIt3Wrappper.ini file so that instead of hard-coding the AutoIt version number as the literal string '3.3.16.1', I'd instead set it to %AutoItVer%, like this:

I guess all these "issues" you have says something about how often people really use these as this has been like this for years. :) 

Made another couple of changes to do the updates for the resources at a different point in the process to ensure all info is know at that point.
Try the latest beta which should fix this one. 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Yep, the new beta fixes that. Works great now!

53 minutes ago, Jos said:

I guess all these "issues" you have says something about how often people really use these as this has been like this for years. :) 

To be honest, I never knew about the option of using an AutoIt3Wrapper.ini file until I looked at the code of AutoIt3Wrapper.au3 and noticed it there. Likewise, I didn't know you could use %variable% values in directives other than the Run Before/After until you suggested it. I see now that it's all in the AutoIt3Wrapper help info, but it's kind of buried in there and just didn't register with me before. I'm guessing that may be the case with a lot of users.

Thanks for the help!

Link to comment
Share on other sites

  • Developers

Well, i started way-back-when with settings in the INI files and only at a later point added the directives with the intention to fade out the INI option. That last part never happened but people are using it less in favor of the directives.

The helpfile indeed contains the info but I am not even sure if all %xxxx% options are in there. You know how that goes. It takes 5 minutes to add the functionality and 10 to update the docs. 

Thanks for the testing and feedback!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

; Check for SCITE_USERHOME Env variable and used that when specified.
; Else use Program directory
If EnvGet("SCITE_USERHOME") <> "" And FileExists(EnvGet("SCITE_USERHOME") & "\AutoIt3Wrapper\AutoIt3Wrapper.ini") Then
    $AutoIt3WapperIni = EnvGet("SCITE_USERHOME") & "\AutoIt3Wrapper\AutoIt3Wrapper.ini"
    $UserData = EnvGet("SCITE_USERHOME") & "\AutoIt3Wrapper"
ElseIf EnvGet("SCITE_HOME") <> "" And FileExists(EnvGet("SCITE_HOME") & "\AutoIt3Wrapper\AutoIt3Wrapper.ini") Then
    $AutoIt3WapperIni = EnvGet("SCITE_HOME") & "\AutoIt3Wrapper\AutoIt3Wrapper.ini"
    $UserData = EnvGet("SCITE_HOME") & "\AutoIt3Wrapper"
Else
    $AutoIt3WapperIni = @ScriptDir & "\AutoIt3Wrapper.ini"
    $UserData = @ScriptDir
EndIf

This is better. Otherwise it does not work as expected  :graduated:

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Developers
8 minutes ago, argumentum said:

This is better. Otherwise it does not work as expected  :graduated:

Are you sure? ;)   Your version tests if AutoIt3Wrapper.ini exits in the  AutoIt3Wrapper subdirectory, and the current version test if AutoIt3Wrapper subdirectory exit, so they both work fine as far as I can see. .... agree? 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

...I'm working with it right now and I put the .ini where the the .au3 is at in the SciTE tree structure but did not work. So reading the code I see the it assumes that if the folder is there, the .ini is there too but only the .ini.example is at the AppData folder. So this little change tests for the file itself.
Tested it and worked. If the .ini is not at the expected folder, look at the next one until is found or default sets in.
I asked myself and, I'm in full agreement with myself. :)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

33 minutes ago, argumentum said:

...I'm working with it right now and I put the .ini where the the .au3 is at in the SciTE tree structure but did not work. So reading the code I see the it assumes that if the folder is there, the .ini is there too but only the .ini.example is at the AppData folder. So this little change tests for the file itself.
Tested it and worked. If the .ini is not at the expected folder, look at the next one until is found or default sets in.
I asked myself and, I'm in full agreement with myself. :)

The help docs say: "Default AutoIt3Wrapper options can be set in AutoIt3Wrapper.ini which is stored in the %LOCALAPPDATA%\AutoIt v3\SciTE\AutoIt3Wrapper folder for the Installer version and ...\AutoIt3\SciTE\AutoIt3Wrapper folder for the portable version."

In keeping with that, it looks like Jos' beta code first checks to see if there's a folder named %LOCALAPPDATA%\AutoIt v3\SciTE\AutoIt3Wrapper (indicating an Installer version) and if so then it assumes any .ini file to be used must live there.

If that folder doesn't exist, it then checks to see if there's a folder named  ...\AutoIt3\SciTE\AutoIt3Wrapper (for a portable version) and if so then it assumes any .ini file to be used must live there.

Finally, if neither of those 2 folders exist, it looks for an .ini file in the @Scriptdir folder.

However, it does seem that it would be better to actually look to see if the .ini file actually exists in the folder rather than just checking if the folder exists. There could well exist a folder in the first location but the user may have created the .ini file in the second (or third) location. Seems like there would be no harm by checking for the .ini file itself and using the one found first, searching in the order listed.

So I think I agree with argumentum :yes: (for whatever's that's worth).

Edited by TimRude
Link to comment
Share on other sites

  • Developers
1 hour ago, argumentum said:

.I'm working with it right now and I put the .ini where the the .au3 is at in the SciTE tree structure but did not work.

That is not how it is working. The reason for the multiple options has to do with the portability of SciTE and its tools. 

  • When SCITE_USERHOME is defined it is assumed that the AutoIt3Wrapper.ini is located in %SCITE_USERHOME %\AutoIt3Wrapper\AutoIt3Wrapper.ini. This was introduced when settings moved from Program Files to User directories and the "require admin rights to update files in program files" was added to Windows.
  • When SCITE_HOME is defined it is assumed that the AutoIt3Wrapper.ini is located in %SCITE_HOME %\AutoIt3Wrapper\AutoIt3Wrapper.ini. This is the original setting used in SciTE before the previous was added and all configs were in the program directory.
  • Else we assume it is portable and located in the "SciTE.exe directory"\AutoIt3Wrapper\AutoIt3Wrapper.ini. Introduced for the portable option when no Environment variables are defined.

There is a long history around this but this is how it has been for a long time now.

1 hour ago, TimRude said:

If that folder doesn't exist, it then checks to see if there's a folder named  ...\AutoIt3\SciTE\AutoIt3Wrapper (for a portable version) and if so then it assumes any .ini file to be used must live there.

Finally, if neither of those 2 folders exist, it looks for an .ini file in the @Scriptdir folder.

Close but not correct. ;)  see my explanation at the start of this post.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
44 minutes ago, argumentum said:

wrapping in _Convert_Variables() is needed. 

Will do as it probably makes sense, but I am sure this will not work properly yet at that point in the script as not all of those possible variables have their value known. 

EDIT: Will add $INP_Icon to Func Convert_required_DirectiveValues() 

nobody has even tried to use it till now and it wasn't my intent to do the Conversion of %xxx% on all possible directives/INI keywords as their probably will be another can-of-worms I open with that. 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

6 minutes ago, Jos said:

That is not how it is working. The reason for the multiple options has to do with the portability of SciTE and its tools. 

  • When SCITE_USERHOME is defined it is assumed that the AutoIt3Wrapper,ini is located in %SCITE_USERHOME %\AutoIt3Wrapper\AutoIt3Wrapper.ini
  • When SCITE_HOME is defined it is assumed that the AutoIt3Wrapper,ini is located in %SCITE_HOME %\AutoIt3Wrapper\AutoIt3Wrapper.ini
  • Else we assume it is portable and located in the "SciTE.exe directory"\AutoIt3Wrapper\AutoIt3Wrapper.ini

There is a long history around this but this is how it has been for a long time now.

So basically, it seems that argumentum's problem at the moment is that he's put his .ini file in the wrong folder ("where the the .au3 is at in the SciTE tree structure"), and because the code is looking for an existing folder rather than an existing .ini file, his .ini file doesn't get seen.

I'm wondering, what harm would it cause to check for the existence of the actual .ini file instead of just the folder? In other words, even if you find the folder where the .ini should be but the .ini file isn't there, is there a problem with continuing to look in the other possible locations for it?

Or just leave it as is, and argumentum just has to make sure to put the .ini file in the correct folder. :bonk:

Link to comment
Share on other sites

30 minutes ago, Jos said:

That is not how it is working. ...

...a reality check for me. I install at c:\utilities\AutoIt to have more freedom from permissions than the proper place.
So I install but lack respect for the proper folder structure and treat it as semi-portable. But, wtf is semi-portable, and how is a developer to maintain a product based on a "misbehaved way of doing things" !. So yeah, my bad. And many thanks for your patient clarification.
 

1 minute ago, TimRude said:

..wondering, what harm would it cause to check for the existence of the actual .ini file instead of just the folder?..

This wrapper is basically the same from the beginning and if you follow the code, it'd be a big deal.

5 minutes ago, TimRude said:

Or just leave it as is, and argumentum just has to...

Yeap, I do :)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Jos, one other issue discovered: In my scripts I use the Run_After directive to code-sign my executables after building them. Like this:

#AutoIt3Wrapper_Run_After=C:\Code_Signing\DualSign.cmd "%out%"

Now with the new beta of AutoIt3Wrapper.au3 (22.611.2153.12) I'm getting

SignTool Error: File not found: %out%

indicating that the %out% variable isn't being converted when being passed to my DualSign.cmd file.

Link to comment
Share on other sites

#AutoIt3Wrapper_Run_After="C:\Code_Signing\DualSign.cmd "%out%""
; the double " are needed. Try it out

...tho in the future Jos will advise to get the new beta.
And that is something I should have foreseen as I am in the future 🕴️

Edited by argumentum
time travel

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Developers
1 hour ago, TimRude said:

indicating that the %out% variable isn't being converted when being passed to my DualSign.cmd file.

I have been cleaning a little too much, so give the current Beta a try which should fix that. :) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 1 month later...

@Jos I've found another issue with wrapper variables not be converted. In this case, the %autoitdir% variable is not being converted when used in the #AutoIt3Wrapper_Res_Icon_Add directive. Since this thread was about getting those wrapper variables working properly, it seemed logical to follow up here.

I noticed this when I came across an example script that grabbed one of the known icons from a subfolder of the AutoIt program folder.

In this basic example, I try to add 2 icons -- one using the hard-coded AutoIt program path, and the other using the %autoitdir% variable.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\SETUP01.ICO, 201
#AutoIt3Wrapper_Res_Icon_Add=%autoitdir%\Aut2Exe\Icons\SETUP02.ICO, 202
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

MsgBox(0, "Problem", "Build the exe and only the hard-coded icon (201) gets added.")

When you try to build the exe, only icon 201 gets added, not 202.

The output pane shows this:

- => Skipping #AutoIt3Wrapper_Res_Icon_Add because the Ico file is not found:"%autoitdir%\Aut2Exe\Icons\SETUP02.ICO, 202"

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...