Jump to content

Resources UDF


Zedna
 Share

Recommended Posts

Very nice Zedna!

This is a lot better than FileInstall() which is outdated and in major need of an overhaul.

But there's an issue at hand.. I don't have AutoIt, or Scite4AutoIt installed on my machine, AutoIt it is located in C:\Portables\AutoIt and Scite4AutoIt is in C:\Portables\AutoIt\Scite4AutoIt. I copied reshacker.exe and upx.exe to the path C:\Portables\AutoIt\Scite4AutoIt\AutoIt3Wrapper and in C:\Windows

Try to put it into C:\WINDOWS\system32\

instead of C:\WINDOWS\

Link to comment
Share on other sites

  • 2 weeks later...

NO, you have to save it to disk beofre use.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

I noticed it is on to do list but I have to ask is there a way to load dlls directly from resources...

I thought maybe it is possible already and zedna will just write a function to make it easier for us :P ...

No you are wrong in your ideas.

About DLL files it's the same as about EXE files - you can't run it directly from memory, you must save it to disk firstly.

My functions _ResourceLoadDLL(),_ResourceFreeDLL() on TODO list are meant to preload external EXE/DLL file (from disk to memory)

and then later extract resources from it. It's effective in case you extract more resources from one EXE/DLL.

Link to comment
Share on other sites

OK I have another question then... maybe I can get something from this angle...

How 7za.exe works for example?

Does it have 7z.dll as a resource or does it use a different method?

Please make your own new thread for this.

This has nothing to do with my resources UDF.

Edited by Zedna
Link to comment
Share on other sites

  • 2 weeks later...

How would I use this feature if I want to embed a .exe file into my complied Script.exe then execute that .exe from within the Script.exe

Or Copy the .exe from within the Script.exe to a specified directory location..??

EXE files can't be executed directly from resources (or memory).

You must save it to disk first with my _ResourceSaveToFile() or native AutoIt;s FileInstall()

Edited by Zedna
Link to comment
Share on other sites

When using AutoIt's FileInstall() will your embedded files always be Automatically dropped to disk once your script.exe is executed..??

Or can you dynamically call for the embedded files to be dropped to disk on demand so then they can be executed or whatnot..??

Does your _ResourceSaveToFile() Function operate in the way I described above..??

Link to comment
Share on other sites

Or can you dynamically call for the embedded files to be dropped to disk on demand so then they can be executed or whatnot..??

Both my _ResourceSaveToFile() or native AutoIt's FileInstall() works this way.

If you place it into some (IF) condition then it will extract/save file only if condition is true.

Link to comment
Share on other sites

So I ran this bit of code and after compiling it and opening my compiled exe in reshacker I can see the picture I wanted to add but it isn't setting that picture to the control or saving it. What am I doing wrong?

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_Res_File_Add=D:\4sq.jpg, jpg, TEST_JPG_1
#AutoIt3Wrapper_run_after="C:\Program Files (x86)\AutoIt3\Aut2Exe\upx.exe" --best "%out%"

#include <Resources.au3>
#include <WindowsConstants.au3>

$about = GUICreate("About", 471, 675, -1, -1, $WS_CAPTION + $WS_POPUP + $WS_SYSMENU, $WS_EX_TOPMOST)
$Pic1 = GUICtrlCreatePic("", 0, 0, 468, 604)
_ResourceSetImageToCtrl($Pic1, "TEST_JPG_1")
MsgBox(0,"",_ResourceSaveToFile(@ScriptDir & "\test.jpg", "TEST_JPG_1"))
GUISetState()

While 1
    Sleep(500)
WEnd
Link to comment
Share on other sites

So I ran this bit of code and after compiling it and opening my compiled exe in reshacker I can see the picture I wanted to add but it isn't setting that picture to the control or saving it. What am I doing wrong?

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_Res_File_Add=D:\4sq.jpg, jpg, TEST_JPG_1
#AutoIt3Wrapper_run_after="C:\Program Files (x86)\AutoIt3\Aut2Exe\upx.exe" --best "%out%"

#include <Resources.au3>
#include <WindowsConstants.au3>

$about = GUICreate("About", 471, 675, -1, -1, $WS_CAPTION + $WS_POPUP + $WS_SYSMENU, $WS_EX_TOPMOST)
$Pic1 = GUICtrlCreatePic("", 0, 0, 468, 604)
_ResourceSetImageToCtrl($Pic1, "TEST_JPG_1")
MsgBox(0,"",_ResourceSaveToFile(@ScriptDir & "\test.jpg", "TEST_JPG_1"))
GUISetState()

While 1
    Sleep(500)
WEnd
Read my first topic once more.

You must use (generally)

#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, test_1.txt, rcdata, TEST_TXT_1, 0

instead of

#AutoIt3Wrapper_Res_File_Add=Filename [,Section [,ResName]]

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