Jump to content

Recommended Posts

  • Moderators
Posted

Jos,

If I make the first change to au3.properties that wraithdu has suggested I run into big problems compiling:

This set of directives, which has worked for quite a while without problem:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_Icon=M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico
#AutoIt3Wrapper_Outfile=M:\Program\Au3 Scripts\FRED\FRED.exe

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Res_Description=FRED
#AutoIt3Wrapper_Res_Fileversion=3.0.0.8
#AutoIt3Wrapper_Res_LegalCopyright=© Melba 23 2008-9
://////=__=
#AutoIt3Wrapper_Res_Productversion= 3.0.0.0
://////=__=

#AutoIt3Wrapper_Run_After=M:\Program\ResHacker\Reshacker.exe -add %out%, %out%, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
#AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%"

#EndRegion ;**** Directives created by AutoIt3Wrapper_Win ****

gets changed to this:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico
#AutoIt3Wrapper_outfile=M:\Program\Au3 Scripts\BMP\FRED.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=FRED
#AutoIt3Wrapper_Res_Fileversion=3.0.0.8
#AutoIt3Wrapper_Res_LegalCopyright=© Melba23 2008-9
#AutoIt3Wrapper_Run_After=M:\Program\ResHacker\Reshacker.exe -add %out%, %out%, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
#AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%"
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****



#AutoIt3Wrapper_Res_Productversion= 3.0.0.0



#EndRegion ;**** Directives created by AutoIt3Wrapper_Win ****

Note the 2 #EndRegion directives that now exist.

The result:

No upx compression despite the directive.

The Productversion directive is honoured even though it is now outside the first #EndRegion

It appears the earlier tests used the existing AutoIt3Wrapper_Gui and the change to your new "combined" file that wraithdu suggested has led to this. Sorry to be the bearer of bad tidings. ;)

Anything I can do to help - you know where to find me.... :evil:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Replies 244
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Developers
Posted (edited)

Note the 2 #EndRegion directives that now exist.

The second #EndRegion is due to the fact that the orignal #EndRegion does seems to be the standard one created by AutoIt3Wrapper_GUI. It says "AutoIt3Wrapper_Win" which I don't understand where that comes from.

The result:

No upx compression despite the directive.

The Productversion directive is honoured even though it is now outside the first #EndRegion

The UPX directive states not to UPX the output EXE or am I misunderstanding you here?

The Productversion directive is honoured even though it is now outside the first #EndRegion

The #AutoIt3Wrapper Directive can be anywhere in the script and will be supported. The directives between:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
... are supported/generated/updated via GUI front-end ..that's all.

I see that 2 #AutoIt3Wrapper_Res_Field line disappeared and will have a look at 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.
  :)

  • Moderators
Posted

Jos,

New tests!

Firstly ignore the "AutoIt3Wrapper_Win" line. For some reason my original script had that in - was it from an earlier version?

Result using v2.0.1.2 with the original au3.properties line - command.compile.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "$(FilePath)":

Directives at start:

#AutoIt3Wrapper_Icon=M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico
#AutoIt3Wrapper_Outfile=M:\Program\Au3 Scripts\FRED\FRED.exe

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Res_Description=FRED - Background Music Player
#AutoIt3Wrapper_Res_Fileversion=3.0.0.8
#AutoIt3Wrapper_Res_LegalCopyright=© Steve Gunner UK 2008-9
://////=__=
#AutoIt3Wrapper_Res_Productversion= 3.0.0.0
://////=__=

#AutoIt3Wrapper_Run_After=M:\Program\ResHacker\Reshacker.exe -add %out%, %out%, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
#AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%"

These are unchanged after compilation.

SciTE console output:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper_Gui.exe" /in "M:\Program\Au3 Scripts\FRED\FRED.au3"
+>11:28:36 Starting AutoIt3Wrapper GUI v.2.0.0.0
-> No changes made..
+>11:28:39 Starting AutoIt3Wrapper v.2.0.1.2    Environment(Language:0409  Keyboard:00000809  OS:WIN_VISTA/Service Pack 2  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
+>11:28:40 AU3Check ended.rc:0
>Running Obfuscator (1.0.28.3)  from:C:\Program Files\AutoIt3\SciTE cmdline:
- Iteration 1 Strip Functions result: Output  7699 lines and stripped 9558 lines
- Iteration 2 Strip Variables result: Output  5238 lines and stripped 2415 lines
- Iteration 3 Strip Variables result: Output  5194 lines and stripped 44 lines
- Iteration 4 Start the actual Obfuscation.
+> Source    43933 lines 2198936 Characters.
+> Stripped  12017 Func/Var lines and  26649 comment lines, Total 2011943 Characters.
+> Saved     88% lines 91% Characters.
+> Obfuscator v1.0.28.3 finished obfuscating 5194 lines, created:M:\Program\Au3 Scripts\FRED\FRED_Obfuscated.au3
>Running AU3Check for obfuscated file(1.54.19.0)  from:C:\Program Files\AutoIt3
+>11:29:09 AU3Check Obfuscated code ended.rc:0
>Running:(3.3.2.0):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe  /in "M:\Program\Au3 Scripts\FRED\FRED_Obfuscated.au3" /out "M:\Program\Au3 Scripts\FRED\FRED.exe" /nopack /icon "M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico" /comp 2
+>11:29:13 Aut2exe.exe ended.rc:0
+> Updated Program Version information.
>11:29:17 Resource updating finished.
+>11:29:17 Created program:M:\Program\Au3 Scripts\FRED\FRED.exe
->11:29:17 Warning: This is an Unicode compiled script and will not run on Win9x/ME.
>Running:M:\Program\ResHacker\Reshacker.exe -add M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
>M:\Program\ResHacker\Reshacker.exe -add M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , , Ended   rc:0
>Running:M:\Program\UPX\upx.exe --best "M:\Program\Au3 Scripts\FRED\FRED.exe"
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2008
UPX 3.03w       Markus Oberhumer, Laszlo Molnar & John Reiser   Apr 27th 2008

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
    720087 ->    339159   47.10%    win32/pe     FRED.exe

Packed 1 file.
>M:\Program\UPX\upx.exe --best "M:\Program\Au3 Scripts\FRED\FRED.exe" Ended   rc:0
+>11:29:24 AutoIt3Wrapper Finished..
>Exit code: 0    Time: 48.163

Result: valid compressed running file with all resources in place

Now using v2.0.1.2 with the new au3.properties line - command.compile.$(au3)="$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.exe" /showgui /in "$(FilePath)"

Initial directives:

#AutoIt3Wrapper_Icon=M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico
#AutoIt3Wrapper_Outfile=M:\Program\Au3 Scripts\FRED\FRED.exe

#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#AutoIt3Wrapper_UseUpx=n

#AutoIt3Wrapper_Res_Description=FRED - Background Music Player
#AutoIt3Wrapper_Res_Fileversion=3.0.0.8
#AutoIt3Wrapper_Res_LegalCopyright=© Steve Gunner UK 2008-9
://////=__=
#AutoIt3Wrapper_Res_Productversion= 3.0.0.0
://////=__=

#AutoIt3Wrapper_Run_After=M:\Program\ResHacker\Reshacker.exe -add %out%, %out%, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
#AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%"

After compilation:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico
#AutoIt3Wrapper_outfile=M:\Program\Au3 Scripts\FRED\FRED.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=FRED - Background Music Player
#AutoIt3Wrapper_Res_Fileversion=3.0.0.8
#AutoIt3Wrapper_Res_LegalCopyright=© Steve Gunner UK 2008-9
://////=__=
://////=__=
#AutoIt3Wrapper_Run_After=M:\Program\ResHacker\Reshacker.exe -add %out%, %out%, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
#AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%"
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****


#AutoIt3Wrapper_Res_Productversion= 3.0.0.0

and SciTE console output:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /showgui /in "M:\Program\Au3 Scripts\FRED\FRED.au3"
+>11:31:42 Starting AutoIt3Wrapper v.2.0.1.2    Environment(Language:0409  Keyboard:00000809  OS:WIN_VISTA/Service Pack 2  CPU:X64 OS:X86)
-> 1 Change(s) made.
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
+>11:31:45 AU3Check ended.rc:0
>Running Obfuscator (1.0.28.3)  from:C:\Program Files\AutoIt3\SciTE cmdline:
- Iteration 1 Strip Functions result: Output  7699 lines and stripped 9558 lines
- Iteration 2 Strip Variables result: Output  5238 lines and stripped 2415 lines
- Iteration 3 Strip Variables result: Output  5194 lines and stripped 44 lines
- Iteration 4 Start the actual Obfuscation.
+> Source    43935 lines 2199057 Characters.
+> Stripped  12017 Func/Var lines and  26651 comment lines, Total 2012045 Characters.
+> Saved     88% lines 91% Characters.
+> Obfuscator v1.0.28.3 finished obfuscating 5194 lines, created:M:\Program\Au3 Scripts\FRED\FRED_Obfuscated.au3
>Running AU3Check for obfuscated file(1.54.19.0)  from:C:\Program Files\AutoIt3
+>11:32:14 AU3Check Obfuscated code ended.rc:0
>Running:(3.3.2.0):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe  /in "M:\Program\Au3 Scripts\FRED\FRED_Obfuscated.au3" /out "M:\Program\Au3 Scripts\FRED\FRED.exe" /nopack /icon "M:\Program\Au3 Scripts\FRED\Icons\FRED_Main.ico" /comp 2
+>11:32:18 Aut2exe.exe ended.rc:0
+> Updated Program Version information.
>11:32:22 Resource updating finished.
+>11:32:22 Created program:M:\Program\Au3 Scripts\FRED\FRED.exe
->11:32:22 Warning: This is an Unicode compiled script and will not run on Win9x/ME.
>Running:M:\Program\ResHacker\Reshacker.exe -add M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
M:\Program\UPX\upx.exe --best "M:\Program\Au3 Scripts\FRED\FRED.exe"

>M:\Program\ResHacker\Reshacker.exe -add M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\FRED.exe, M:\Program\Au3 Scripts\FRED\Icons\FRED.res, , ,
M:\Program\UPX\upx.exe --best "M:\Program\Au3 Scripts\FRED\FRED.exe"
 Ended   rc:0
+>11:32:23 AutoIt3Wrapper Finished..
>Exit code: 0    Time: 41.581

Result: valid uncompressed running file with all resources in place.

So it looks as if the #AutoIt3Wrapper_Run_After=M:\Program\UPX\upx.exe --best "%out%" is not being honoured. The end of the SciTE output is very different for the 2 cases - I hope it gives you a clue. To me it looks as if upx is called before ResHacker ends.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Developers
Posted

ok... Understand the problem now and will have a look.

The #AutoIt3Wrapper_Run_Before & #AutoIt3Wrapper_Run_After issue should be solved now in the latest Beta version of Autoit3Wrapper.

Thanks for all the help testing ;)

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

  • Moderators
Posted

Jos,

Both versions of the au3.properties line now work aa advertised. Thanks for the quick fixes.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Developers
Posted (edited)

AutoIt3Wrapper.au3 - 2.0.1.3

at line 975 within bulding Manifest file there is AutoIt version hardcoded as version="3.0.0.0"

Maybe this should be dynamically evaluated but I'm not sure.

Yea, I took a example Manifest and added the option to update that.

Just looked at the standard Manifest of an compiled script which doesn't have that first section and looks like:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
So guess this code should work too:

FileWriteLine($hTempFile2, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')
FileWriteLine($hTempFile2, '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">')
FileWriteLine($hTempFile2, '')
FileWriteLine($hTempFile2, '    <!-- Identify the application security requirements. -->')
FileWriteLine($hTempFile2, '    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">')
FileWriteLine($hTempFile2, '        <security>')
FileWriteLine($hTempFile2, '            <requestedPrivileges>')
FileWriteLine($hTempFile2, '                <requestedExecutionLevel')
FileWriteLine($hTempFile2, '                level="' & $INP_RES_requestedExecutionLevel & '"')
FileWriteLine($hTempFile2, '                    uiAccess="false"/>')
FileWriteLine($hTempFile2, '            </requestedPrivileges>')
FileWriteLine($hTempFile2, '        </security>')
FileWriteLine($hTempFile2, '    </trustInfo>')
FileWriteLine($hTempFile2, '')
FileWriteLine($hTempFile2, '    <!-- Identify the application dependencies. -->')
FileWriteLine($hTempFile2, '    <dependency>')
FileWriteLine($hTempFile2, '        <dependentAssembly>')
FileWriteLine($hTempFile2, '            <assemblyIdentity')
FileWriteLine($hTempFile2, '                type="win32"')
FileWriteLine($hTempFile2, '                name="Microsoft.Windows.Common-Controls"')
FileWriteLine($hTempFile2, '                version="6.0.0.0"')
FileWriteLine($hTempFile2, '                language="*"')
FileWriteLine($hTempFile2, '                processorArchitecture="*"')
FileWriteLine($hTempFile2, '                publicKeyToken="6595b64144ccf1df"')
FileWriteLine($hTempFile2, '            />')
FileWriteLine($hTempFile2, '        </dependentAssembly>')
FileWriteLine($hTempFile2, '    </dependency>')
FileWriteLine($hTempFile2, '</assembly>')
Not sure what should be in it to make it work properly at this moment and need some time to check that out and test.

Input is welcome as always ;)

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

Posted (edited)

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.ini" 

[Autoit]

UseAnsi=1

UseAnsi=1 option is ignored in this case because at compile time I can see this warning:

Warning: This is an Unicode compiled script and will not run on Win9x/ME.

I know there is a new Autit3Wrapper directive for Ansi/Unicode (#AutoIt3Wrapper_UseAnsi=)

but I think this INI option should act as global setting for case there is no Ansi/Unicode directive used.

Edited by Zedna
  • Developers
Posted

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.ini" 

[Autoit]

UseAnsi=1

UseAnsi=1 option is ignored in this case because at compile time I can see this warning:

Warning: This is an Unicode compiled script and will not run on Win9x/ME.

I know there is a new Autit3Wrapper directive for Ansi/Unicode (#AutoIt3Wrapper_UseAnsi=)

but I think this INI option should act as global setting for case there is no Ansi/Unicode directive used.

Ansi support was dropped in AutoIt3 and also in AutoIt3Wrapper. Anything still in there is "Old Stuff" that should be taken out.

When using the directive you get this error:

- Skipping #AutoIt3Wrapper_UseAnsi directive because ANSI is not supported anymore.

AutoIt3Wrapper doesn't read the INI value anymore thus totally ignores those.

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

Posted (edited)

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.au3" 

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.exe" 

Both files downloaded now from beta directory and they have different file version

AU3 - 2.0.1.4 (size 181 757 bytes)

EXE - 2.0.1.3 (size 716 401 bytes)

Edited by Zedna
  • Developers
Posted

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.au3" 

"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\autoit3wrapper.exe" 

Both files downloaded now from beta directory and they have different file version

AU3 - 2.0.1.4 (size 181 757 bytes)

EXE - 2.0.1.3 (size 716 401 bytes)

Thats always the case because I use :

#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p
#AutoIt3Wrapper_Run_cvsWrapper=v

..which will update the version with one "click" after it is dumped to the SVN repository.

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

Posted (edited)

I did tests with my Resource UDF now (link is in my signature).

But there is some problem with #AutoIt3Wrapper_Res_File_Add=

In resource_test.au3 I use these directives for adding resources 1) original:

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.txt, rcdata, TEST_TXT_1, 0
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, image1.bmp, bitmap, TEST_BMP_1, 0
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, image2.bmp, bitmap, TEST_BMP_2, 0
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, image3.jpg, rcdata, TEST_JPG_3, 0
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, binary1.dat, rcdata, TEST_BIN_1, 0
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

I tested to use your #AutoIt3Wrapper_Res_File_Add= 2) new:

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_Res_File_Add=test_1.txt, rcdata, TEST_TXT_1, 0 ; Filename,Section,ResName
#AutoIt3Wrapper_Res_File_Add=image1.bmp, bitmap, TEST_BMP_1, 0
#AutoIt3Wrapper_Res_File_Add=image2.bmp, bitmap, TEST_BMP_2, 0
#AutoIt3Wrapper_Res_File_Add=image3.jpg, rcdata, TEST_JPG_3, 0
#AutoIt3Wrapper_Res_File_Add=binary1.dat, rcdata, TEST_BIN_1, 0
#AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

1) It works fine

2) Only sound is played no images/texts are found in resources

I tried it also without UPX compression with the same result.

There are some differences when I look at resources in output EXE by reshacker, see attachments:

- section names are with different case in variant 1) and 2)

- language is different 1) - 0  2) - 2057

It seems I can't set language by #AutoIt3Wrapper_Res_File_Add= directive

I tried to use language but no luck:

$string = _ResourceGetAsString("TEST_TXT_1", $RT_RCDATA, 2057)
GUICtrlSetData($label1, $string)

; set BMP image to picture control from resource  bitmap
_ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP, 2057)

EDIT: There may be problem with my Resource UDF - Func _ResourceGet() --> FindResource API

I use "long" for ResType:

If $ResLang <> 0 Then
    $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $ResType, "str", $ResName, "short", $ResLang)
 Else
    $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceA", "int", $hInstance, "str", $ResName, "long", $ResType)
 EndIf

 

Edited by Zedna
  • Developers
Posted

I will have a look at adding the language option which is currently not in place, but this script works fine adding all files.

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, SOUND, MYWAV
Global Const $SND_RESOURCE = 0x00040004
Global Const $SND_ASYNC = 1
DllCall("winmm.dll", "int", "PlaySound", "str", "MYWAV", "hwnd", 0, "int", $SND_RESOURCE)
DllCall("winmm.dll", "int", "PlaySound", "str", "MYWAV", "hwnd", 0, "int", BitOR($SND_RESOURCE, $SND_ASYNC))
For $n = 1 To 100
    Sleep(15)
    ToolTip("Asynch! " & $n)
Next
;
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\au3.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype1.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype2.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype3.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\filetype-blank.ico
#include <ButtonConstants.au3>
GUICreate("Demo resource ICO's")
$h_Button1 = GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON)
GUISetState()
For $x = 0 To 7
   $rc = TraySetIcon(@ScriptFullPath, -$x)
   $rc2 = GUICtrlSetImage($h_Button1, @ScriptFullPath, -$x)
  If $x < 3 Then
      TrayTip("Default ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   Else
      TrayTip("New ico:" & $x, "TraySetIcon rc:" & $rc & @LF & "GUICtrlSetImage rc:" & $rc2, 3)
   EndIf
   Sleep(2000)
Next
GUIDelete()
;
#AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Coffee Bean.bmp, bitmap, Coffee_BMP
#AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Greenstone.bmp, bitmap, Stone_BMP

No need to worry about the UPX anymore. That is automatically done after the resource update if requested.

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

  • Developers
Posted

PlaySound works fine but FindResource API doesn't work.

It returns 0 as result and GetLastError + FormatMessage says: The image file can not find the specified resource type. 

Ok, I have the Language support also working for Res_Icon and Res_File_Add:

#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\au3.ico, ,1033
#AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Coffee Bean.bmp, bitmap, Coffee_BMP,1033

Will now have to look at your other issue. Could you take my posted example and add the code it that demonstrates your found issue so we both work with the same code that can also be tested by us both?

Thanks

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

Posted

I found the source of problem.

As I said in my above topic I use in my Resource UDF in FindResource API "long" for resource type parameter.

$InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $RT_RCDATA, "str", "TEST_TXT_1", "short", 2057)

When I change it from long to str like this it works fine

$InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "str", "RCDATA", "str", "TEST_TXT_1", "short", 2057)

Here is all my testing script, it's piece of code ripped from my Resource UDF (Func _ResourceGet) and my resource_test.au3 example included in my UDF.

In this script I used only one TXT file as binary resource ($RT_RCDATA).

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_Res_File_Add=test_1.txt, rcdata, TEST_TXT_1 ; Filename,Section,ResName

#include <WinAPI.au3>
;~ #include "resources.au3"

Global Const $RT_RCDATA = 10

$hInstance = _WinAPI_GetModuleHandle("")

; original code from Resource UDF
;~  If $ResLang <> 0 Then
;~      $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $ResType, "str", $ResName, "short", $ResLang)
;~  Else
;~      $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceA", "int", $hInstance, "str", "TEST_TXT_1", "long", $RT_RCDATA)
;~  EndIf

; ripped code to this test:

; ResType as long - doesn't work - InfoBlock = 0
;~ $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $RT_RCDATA, "str", "TEST_TXT_1", "short", 2057)
;~ _GetLastErrorMessage ("Error long:")
;~ MsgBox(0,'InfoBlock', $InfoBlock[0] )

; ResType as string - works fine - InfoBlock <> 0
; note: both FindResourceA and FindResourceExA works fine
;~ $InfoBlock = DllCall("kernel32.dll", "int", "FindResourceA", "int", $hInstance, "str", "TEST_TXT_1", "str", "RCDATA")
$InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "str", "RCDATA", "str", "TEST_TXT_1", "short", 2057)
_GetLastErrorMessage ("Error string:")
MsgBox(0,'InfoBlock', $InfoBlock[0] )

;~ _ResourceGet("TEST_TXT_1", $RT_RCDATA, 2057)
;~ _GetLastErrorMessage ("Error:")
;~ MsgBox(0, '',@error)

 $ResSize = DllCall("kernel32.dll", "dword", "SizeofResource", "int", $hInstance, "int", $InfoBlock[0])
;~  MsgBox(0,'Resource size', $ResSize[0] ) ; 36
 $GlobalMemoryBlock = DllCall("kernel32.dll", "int", "LoadResource", "int", $hInstance, "int", $InfoBlock[0])
 $MemoryPointer = DllCall("kernel32.dll", "int", "LockResource", "int", $GlobalMemoryBlock[0])
 $struct = DllStructCreate("char[" & $ResSize[0] & "]", $MemoryPointer[0])
 MsgBox(0,'Resource result', DllStructGetData($struct, 1) )


Func _GetLastErrorMessage ($DisplayMsgBox = "")
    Local $ret, $s
    Local $p = DllStructCreate("char[4096]")
    Local Const $FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000

    If @error Then Return ""

    $ret = DllCall("Kernel32.dll", "int", "GetLastError")

    $ret = DllCall("kernel32.dll", "int", "FormatMessage", _
            "int", $FORMAT_MESSAGE_FROM_SYSTEM, _
            "ptr", 0, _
            "int", $ret[0], _
            "int", 0, _
            "ptr", DllStructGetPtr($p), _
            "int", 4096, _
            "ptr", 0)
    $s = DllStructGetData($p, 1)
    $p = 0
    If $DisplayMsgBox <> "" Then MsgBox(0, "_GetLastErrorMessage", $DisplayMsgBox & @CRLF & $s)
    Return $s
EndFunc   ;==>_GetLastErrorMessage
Posted

I found the source of problem.

As I said in my above topic I use in my Resource UDF in FindResource API "long" for resource type parameter.

$InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "long", $RT_RCDATA, "str", "TEST_TXT_1", "short", 2057)

When I change it from long to str like this it works fine

$InfoBlock = DllCall("kernel32.dll", "int", "FindResourceExA", "int", $hInstance, "str", "RCDATA", "str", "TEST_TXT_1", "short", 2057)

I don't know why use of "long", $RT_RCDATA in FindResource doesn't work with resources from your latest AutoIt3Wrapper while it works fine with resources from reshacker.exe -add ...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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