Jump to content
Sign in to follow this  
Melba23

Creating a .res file

Recommended Posts

Melba23

Hi,

When I compile a script which includes any resources the first thing that appears in the small compiling window is the message "Creating resource file". For one of my scripts, which contains a fair number of icons and other resources, this takes very nearly half the time of the whole compile.

As the resources are unlikely to change, but I am often tinkering with the code of the script, is there a way to get the resource file compiled ahead of time, so that the overall compile time can be reduced?

I had a look at ResHacker, but it seems to allow only 1 resource to be saved at any one time. It does allow the creation of a .rc file, but this appears to be a list of resource names only.

Is there an AutoItWrapper directive which will produce a .res file? There seems to be one for everything else, but I cannot find one for this.

And if I manage to produce a .res file, how to include it in the compile process?

Thanks in advance for any pointers,

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Jos

Which version of autoit3wrapper are you using, because this is removed for a while since i coded the builin resource update functions.

EDIT: 02/16/2008

*** Updated AutoIt3Wrapper_Gui/AutoIt3Wrapper v1.10.1.4 (Jos)

- Added: Buildin Resource update functions instead of requiring RC.exe and Reshacker.

This also enables the resource update of x64 compiled scripts.

RC.exe is the program that used to create the res file from the generated rc file

Jos

Edited by Jos

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

Share this post


Link to post
Share on other sites
Mobius

@Melba23,

If you like Reshacker you could also::

create an empty (zero byte) file with a .res extension and either open it up with the reshacker gui and add resources from scratch,

or use reshackers excellent scriptable functions to add / Update mass amounts of resources ahead of time.

The wrapper method is probably loads easier and cleaner to implement, but I do not use standard build methods.

check out the reshack documentation for information regarding the scriptable functions. (which are similar to cmdline ones.)

Ed: Spelling

Edited by Mobius

Share this post


Link to post
Share on other sites
Melba23

Mobius,

Thank you for that tip about Reshacker. It is obvious when you think about it - I was fixated on saving the resources from the .exe and never thought of using the originals!

Jos,

I am using the 20-12-2008 download (I also have the latest beta since our "include source code" discussion yesterday). There is no RC.exe in my AutoIt folders (or anywhere else for that matter).

If I were to use the Reshacker method, how then to use the .res file when compiling with AutoItWrapper?

Thank you both for your quick replies.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Melba23

Jos,

Understood. I will continue with the AutoItWrapper directives and use the additional compile time to make some tea!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Jos

You could give it a try using RES.exe to create a standard RES file and run reshacker every compile to input these standard resources.

Could be this is faster... :)


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

Share this post


Link to post
Share on other sites
Melba23

Jos,

I will try over the weekend. I am betting your Wrapper directives will win, though!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Jos

Not so sure about that.

The reason I spent to time to code it all up in AutoIt3 native code was the fact that I had to include the res.exe + dlls and that people had to download reshacker and on top of that the main reason was that reshacker doesn't support x64 compiled script which the internal code does.

Jos :)


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

Share this post


Link to post
Share on other sites
Melba23

Jos,

Looking at just the compile time, ResHacker is very much quicker.

But if you factor in the time to create the .res file in the first place - and the time I spent learning how to get it all working! - I am not so sure.

In the case I spoke of - resources rarely changed, but code often tinkered with - a .res file is probably the way to go. But for anything else:

AutoItWrapper Rules

as I suspected!

Many thanks for all the effort you have put into it - I know I speak for many when I say: "Bedankt"

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Zedna

Look here at my older solution

http://www.autoitscript.com/forum/index.ph...st&p=169711

I prepared RES file from RC file first and then I added this RES file to compiled EXE file by reshacker -add

I used batch file for that but you can use #AutoIt3Wrapper_run_after=ResHacker.exe -add for that.

EDIT:

here is example for adding resources by reshacker

#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%, 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 --compress-resources=0 "%out%"

http://www.autoitscript.com/forum/index.php?showtopic=51103 Edited by Zedna

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  

×