Sign in to follow this  
Followers 0
surveyor1

nesting jpg files in script for a .scr file

22 posts in this topic

How can I add jpg files in the script for a.scr file without having to call from another folder on the computer. I'm trying to write a screeen saver that includes jpg files that are actually in the scr file.

Thanks for any help.

Share this post


Link to post
Share on other sites



Look at my resources UDF

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

Or you may use FileInstall()

Thanks, I'm new at this. I'm trying to use jpg files for a screen saver of my wife's pictures, that the user could not have access to. If I use FileInstall, it seems I have to reference the path name\file name from a folder on the computer each time the scr is run. Or will FileInstall() actually add the jpg file to the script. If not and I need the use the UDF resourse, which one would I have to use for the jpg files and would I have to create a new folder to store these files in the script. I am probably confusing you. But any help will be appreciated.

Share this post


Link to post
Share on other sites

FileIstall() gives parameters to the compiler to include files :)

just that :)

Anyway... a method I saw here on hte forums tha I particularly liked was Reading the images in binary mode and put them in the script as strings assigned to variables... then write them and delete them each time.

I don't know if you get what I mean...


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

In my resources post look at

resource_test_min1.au3 - very simple example script for using UDF

Thanks, again. Do my jpg files go in resources.au3 and if so how? Or how do I tell the original script file where the jpg is?

I installed the Autoit software off the main website recently also with the script editor. Do I need to do anything else to compile the AutoIt3Wrapper script? Thanks, I'm sorry I'm don't know very much.

Share this post


Link to post
Share on other sites

Thanks, again. Do my jpg files go in resources.au3 and if so how? Or how do I tell the original script file where the jpg is?

I installed the Autoit software off the main website recently also with the script editor. Do I need to do anything else to compile the AutoIt3Wrapper script? Thanks, I'm sorry I'm don't know very much.

You must have installed Scite4Autoit3

Also read carefully WHOLE my resource UDF topic!

Share this post


Link to post
Share on other sites

You must have installed Scite4Autoit3

Also read carefully WHOLE my resource UDF topic!

Sorry to keep asking questons. Is the resource.au3 in the Autoit library or do I need to include your resource_.au3 code in my script? Aslo I have the Scite4AutoIt3 insatlled. Does it come with the reshacer.exe/upx.exe or do I need to install it as well?

Share this post


Link to post
Share on other sites

Sorry to keep asking questons. Is the resource.au3 in the Autoit library or do I need to include your resource_.au3 code in my script? Aslo I have the Scite4AutoIt3 insatlled. Does it come with the reshacer.exe/upx.exe or do I need to install it as well?

- latest version of Scite4Autoit3 doesn't need reshacker.exe

- upx.exe is in AutoIt3\Aut2Exe directory

- download my resources.zip and upcack resources.au3 and place it to the same directory as your script

   then in your script use:

...
#include "resources.au3"
...
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
...

see examples in my UDF post.

Share this post


Link to post
Share on other sites

- latest version of Scite4Autoit3 doesn't need reshacker.exe

- upx.exe is in AutoIt3\Aut2Exe directory

- download my resources.zip and upcack resources.au3 and place it to the same directory as your script

   then in your script use:

...
#include "resources.au3"
...
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
...

see examples in my UDF post.

THANKS FOR ALL THE HELP. I'll give it a try.

Share this post


Link to post
Share on other sites

THANKS FOR ALL THE HELP. I'll give it a try.

One more dumb question. How does my script know where to find my jpg. file? How do I define the jpgs I will be using? Do I list them somewhere? I guess that's 3 questions.

Thanks.

Share this post


Link to post
Share on other sites

One more dumb question. How does my script know where to find my jpg. file? How do I define the jpgs I will be using? Do I list them somewhere? I guess that's 3 questions.

Thanks.

Read carefully WHOLE my resource UDF topic!

Share this post


Link to post
Share on other sites

Read carefully WHOLE my resource UDF topic!

I'm lost. I put your resource_Test_min1.au3, resources.au3 and image3.jpg all in the same directory and tried to to run it and all I get is the "Data from resources simple example 1" window with nothing in it. What am I doing wrong?

Share this post


Link to post
Share on other sites

I'm lost. I put your resource_Test_min1.au3, resources.au3 and image3.jpg all in the same directory and tried to to run it and all I get is the "Data from resources simple example 1" window with nothing in it. What am I doing wrong?

You must compile script by F7 from Scite4Autoit3.

You must run compiled EXE (not run by F5 directly from Scite).

Share this post


Link to post
Share on other sites

You must compile script by F7 from Scite4Autoit3.

You must run compiled EXE (not run by F5 directly from Scite).

I'm still having trouble. I created a new folder and put your resources.au3, resource_test_min1.au3 and the image3.jpg in the folder. I then used F7 to compile and then ran the compiled exe of resource_test_min1.au3 and all I get is still the GUI window with a heading but nothing in the window.

Share this post


Link to post
Share on other sites

I'm still having trouble. I created a new folder and put your resources.au3, resource_test_min1.au3 and the image3.jpg in the folder. I then used F7 to compile and then ran the compiled exe of resource_test_min1.au3 and all I get is still the GUI window with a heading but nothing in the window.

Does it matter where the folder is that is holding the programs?

Share this post


Link to post
Share on other sites

Post output from your Scite (after F7).

Also check (by reshacker.exe) if image is in output compiled EXE file, it should be in RCDATA section.

How do I post the output. I looked under tools and options but could not find it. Also how do I run reshacker.ext, where is it located.

Share this post


Link to post
Share on other sites

Post output from your Scite (after F7).

Also check (by reshacker.exe) if image is in output compiled EXE file, it should be in RCDATA section.

Here is the post, but I haven't found reshacker.exe to run that.

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.au3" /autoit3dir "C:\Program Files\AutoIt3"

+>10:31:22 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 ANSI)

>Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3

+>10:31:23 AU3Check ended.rc:0

>Running:(3.2.12.1):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.au3" /out "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe" /comp 2 /pack /Bin C:\DOCUME~1\Tim\LOCALS~1\Temp\AutoItSC.bin

+>10:31:26 Aut2exe.exe ended.rc:0

+>10:31:26 Created program:C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe

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

>Running:ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, image3.jpg, rcdata, TEST_JPG_1, 0

'ResHacker.exe' is not recognized as an internal or external command,

operable program or batch file.

>ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, image3.jpg, rcdata, TEST_JPG_1, 0 Ended rc:1

>Running:upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe"

'upx.exe' is not recognized as an internal or external command,

operable program or batch file.

>upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe" Ended rc:1

+>10:31:27 AutoIt3Wrapper Finished

>Exit code: 0 Time: 5.454

Share this post


Link to post
Share on other sites

>Running:ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, image3.jpg, rcdata, TEST_JPG_1, 0

'ResHacker.exe' is not recognized as an internal or external command,

operable program or batch file.

>ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe, image3.jpg, rcdata, TEST_JPG_1, 0 Ended rc:1

>Running:upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\resosurce_test_min1.exe"

'upx.exe' is not recognized as an internal or external command,

operable program or batch file.

You probably use old version of AutoIt3Wrapper (Scite4AutoIt3)

because newer version doesn't need/run reshacker.exe

Also add upx.exe to your Windows system directory or Windows PATH directory.

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