Sign in to follow this  
Followers 0
UEZ

AutoIt3Wrapper resource update problem

17 posts in this topic

#1 ·  Posted (edited)

I'm gettin' an em when compiling my old SIC2 script (Valik has a copy of it):

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /beta /in "C:\_BZ25LN\Coding\AU3\__UEZ\Tools\SIC2\SIC2.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3\beta"
+>20:48:55 Starting AutoIt3Wrapper v.2.0.2.0    Environment(Language:0409  Keyboard:00000407  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (1.54.20.0)  from:C:\Program Files (x86)\AutoIt3\Beta
+>20:48:56 AU3Check ended.rc:0
>Running Obfuscator (1.0.28.15)  from:C:\Program Files (x86)\AutoIt3\SciTE cmdline: /Beta
- Iteration 1 Strip Functions result: Output  3857 lines and stripped 3946 lines
- Iteration 2 Strip Variables result: Output  3446 lines and stripped 359 lines
- Iteration 3 Strip Variables result: Output  3436 lines and stripped 10 lines
- Iteration 4 Start the actual Obfuscation.
+> Source    19176 lines 1059198 Characters.
+> Stripped  4315 Func/Var lines and  11358 comment lines, Total 915299 Characters.
+> Saved     81% lines 86% Characters.
+> Obfuscator v1.0.28.15 finished obfuscating 3436 lines, created:C:\_BZ25LN\Coding\AU3\__UEZ\Tools\SIC2\SIC2_Obfuscated.au3
>Running AU3Check for obfuscated file(1.54.20.0)  from:C:\Program Files (x86)\AutoIt3\Beta
+>20:49:06 AU3Check Obfuscated code ended.rc:0
>Running:(3.3.7.2):C:\Program Files (x86)\AutoIt3\Beta\aut2exe\aut2exe.exe  /in "C:\_BZ25LN\Coding\AU3\__UEZ\Tools\SIC2\SIC2_Obfuscated.au3" /out "C:\_BZ25LN\Coding\AU3\__UEZ\Tools\SIC2\SIC2.exe" /nopack /icon "Images\SIC2_04.ico" /comp 2 /Console
+>20:49:07 Aut2exe.exe ended.rc:0
>20:49:07 Performing the Program Resource Update steps:
...>Updating Program Version information.
...>Setting Program ExecutionLevel Manifest information to RequireAdministrator
UpdateResources other: $result[0] = 0 - LastError:1359:An internal error occurred.
...>Updating Program Manifest information.
!>20:49:07 Error: EndUpdateResource: Returncode = 0 - LastError:1359:An internal error occurred.rc:2
!>20:49:07 Error: Program Resource updating Failed. The output program will not contain the Resource updates!rc:2

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites



I'm gettin' an em when compiling my old SIC2 script (Valik has a copy of it):

>20:49:07 Performing the Program Resource Update steps:
...>Updating Program Version information.
...>Setting Program ExecutionLevel Manifest information to RequireAdministrator
UpdateResources other: $result[0] = 0 - LastError:1359:An internal error occurred.
...>Updating Program Manifest information.
!>20:49:07 Error: EndUpdateResource: Returncode = 0 - LastError:1359:An internal error occurred.rc:2
!>20:49:07 Error: Program Resource updating Failed. The output program will not contain the Resource updates!rc:2

Br,

UEZ

Looks like it might be a problem with the custom resources updater and VC10 .exes. Maybe Jos knows about it.

Share this post


Link to post
Share on other sites

@UEZ,

Do you have the Windows explorer open in the script directory?

No, generally windows explorer is not running.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

No, generally windows explorer is not running.

Br,

UEZ

Do you have a script to test with because the few test I have done all work fine?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

This script is a 'small' reproducer to have the res update of AutoIt3wrapper fail for me:

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_LegalCopyright=UEZ 2008-2011
; commment any of the next 2 and problem is gone
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_RequestedExecutionLevel=RequireAdministrator
$a = 1

Will need time for some debugging but wanted to post this in case wraithdu is interested since he wrote a big part of this.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I will take a look when I get home and get a chance to set up a beta environment.

Share this post


Link to post
Share on other sites

I will take a look when I get home and get a chance to set up a beta environment.

Think it is related to the latest changes I made in the AutoIt3Wrapper and has nothing to do with the new AutoIt3 Beta.

I get the same error with the v3.3.6.1 and it goes away when I reload an earlier release of AutoIt3Wrapper.

Going to check what I possibly did wrong moving the steps into Funcs.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Hmm, just did a quick unscientific test here at work. I have AutoIt 3361 installed, and just replaced the AutoItSC.bin file with the new beta, and it compiled OK

Edit:

This would follow based on your last comment. My quick guess is you lost the resource handle somewhere?

Edited by wraithdu

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Indeed, I updated the AutoIt3Wrapper when you released with dual compilation and when I replace it back with the version from full package then no em appears again.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Hmm, just did a quick unscientific test here at work. I have AutoIt 3361 installed, and just replaced the AutoItSC.bin file with the new beta, and it compiled OK

Edit:

This would follow based on your last comment. My quick guess is you lost the resource handle somewhere?

I have split up de Compile section into the following to be able to run the steps 2 times in stead of a single pass through.

As far as I can tell the $rh isn't lost looking at the code and it does work unless the 2 shown lines are in there.

#region Run AUT2EXE/RESUPD/UPX
    ;Use the explicit x86 or x64 outputfile when specified.
    If $INP_Compile_Both = "y" Or $INP_UseX64 = 'n' Then
        Compile_Run_AUT2EXE('x86', $ScriptFile_Out)
        If Compile_Upd_res($ScriptFile_Out) And $INP_UseUpx = "y" Then
            Compile_UPX($ScriptFile_Out)
        EndIf
        Write_RC_Console_Msg("Created program:" & $ScriptFile_Out, "", "+")
    EndIf
    If $INP_Compile_Both = "y" Or $INP_UseX64 <> 'n' Then
        Compile_Run_AUT2EXE('x64', $ScriptFile_Out_x64)
        Compile_Upd_res($ScriptFile_Out_x64)
        Write_RC_Console_Msg("Created program:" & $ScriptFile_Out_x64, "", "+")
    EndIf
    #endregion Run AUT2EXE/RESUPD/UPX

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You have to reset the values of the array(s) when doing enumeration.

Before you call EnumResourceNames set $g_aResNamesAndLangs[0][0] to 0, and before EnumResourceLanguages set $g_aResNamesAndLangs[$g_aResNamesAndLangs[0][0]][1] to empty string.

Thing is you are building-up on resource languages of other resource types.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

You have to reset the values of the array(s) when doing enumeration.

Before you call EnumResourceNames set $g_aResNamesAndLangs[0][0] to 0, and before EnumResourceLanguages set $g_aResNamesAndLangs[$g_aResNamesAndLangs[0][0]][1] to empty string.

Thing is you are building-up on resource languages of other resource types.

thanks for your input. will have a look later this evening to see what exactly is happening and why it is different from what it was before.

r/jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I just wanted to say you should check using/reusing some global variables (shared in two functions calls for resourceupdate).

But trancexx was quick and more detailed.

Edited by Zedna

Share this post


Link to post
Share on other sites

thanks for your input. will have a look later this evening to see what exactly is happening and why it is different from what it was before.

r/jos

Sure, no problem.

Dim as a hint. Don't use that keyword ever again.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Sure, no problem.

Dim as a hint. Don't use that keyword ever again.

Yeap I know ... this project is started a long time ago and is in desperate need of an total overhaul already for a while, but we are still glueing bit and piece to it and I haven't found the time nor energy to start all over and redo the whole base script.

Who knows ... one day .... but I haven't written any scripts in the business world for over 4 years now and that is why and how it all started.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Ok, so couple of things:

- I never looked at the crashing code, so I can't comment

- I don't like trancexxx's fix and it is in fact unnecessary in the current code base

If you simply reinsert

Dim $g_aResNamesAndLangs[1][2] = [[0, 0]] ; reset array

as the first line of the _EnumResourceNamesAndLangs() function, then you can remove your two fixes and it works for me. I suppose you could replace Dim with Global if you think it matters. But as long as the array is declared Global at the top of the script, then Dim and Global are equivalent.

My test script:

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Compile_both=y
#AutoIt3Wrapper_Res_LegalCopyright=UEZ 2008-2011
; commment any of the next 2 and problem is gone
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_RequestedExecutionLevel=RequireAdministrator
$a = 1
Edited by wraithdu

Share this post


Link to post
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
Sign in to follow this  
Followers 0