Sign in to follow this  
Followers 0
Shadowpp

TMP file created after execution

5 posts in this topic

When I build a GUI that contains a GUICtrlCreatePic a .tmp file is created when the GUI displays. I determined this using Filemon to watch my script during it's execution.

#include <GuiConstants.au3>
GUICreate("Circle K Stores, Inc.", 415, 430, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Logo.bmp", 20, 10, 100, 100)

$Button = GUICtrlCreateButton("Start Install", 160, 400, 100, 20, $BS_DEFPUSHBUTTON)
#endregion --- GUI Window Layout End ---

GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
            MsgBox (0, "Results", "Button pressed - Exiting.")
            GUIDelete()
            ExitLoop
    EndSelect
WEnd
Exit

If I remark out the line with the pic, then no tmp file is created.

The problem I am seeing is my GUI does not display the GUICtrlCreatePic bmp when running from within my WINPE CD. I gather this is due to the CD being read-only and the script not being able to create the tmp file.

I do not understand why autoit creates this temp file or how it determines where to create it but I wonder if there is a way to redirect the tmp file creation to a RAM drive, for example.

Has anyone else experienced this? Is this a known issue? Any suggestions on how to work around this problem?

While I understand this post relates to GUI stuff and might belong in the GUI Help and Support section, the problem seems to be related to the underlying function which is why I am posting here.

Thanks in advance.

Share this post


Link to post
Share on other sites

Shadowpp,

Return Value

Success: Returns the identifier (controlID) of the new control. <----------------- It actually uses your picture and makes a new control out of it.

Failure: Returns 0 if picture cannot be created.

So in essence it copies your picture and turns it into a control. (Or at least that would make sense to me).

I'm not a 100% sure maby one of the moderators or experts can furnish an asnwer if they have time since I am a big Noob. :)

Share this post


Link to post
Share on other sites

Additional searching of the forum has turned up a solution.

Here

and here

Share this post


Link to post
Share on other sites

When I build a GUI that contains a GUICtrlCreatePic a .tmp file is created when the GUI displays. I determined this using Filemon to watch my script during it's execution.

#include <GuiConstants.au3><BR>GUICreate("Circle K Stores, Inc.", 415, 430, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))<BR><BR>$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Logo.bmp", 20, 10, 100, 100)<BR><BR>$Button = GUICtrlCreateButton("Start Install", 160, 400, 100, 20, $BS_DEFPUSHBUTTON)<BR>#endregion --- GUI Window Layout End ---<BR><BR>GUISetState(@SW_SHOW)<BR>While 1<BR>  $msg = GUIGetMsg()<BR>  Select<BR>      Case $msg = $GUI_EVENT_CLOSE<BR>            ExitLoop<BR>        Case $msg = $Button<BR>         MsgBox (0, "Results", "Button pressed - Exiting.")<BR>          GUIDelete()<BR>         ExitLoop<BR>    EndSelect<BR>WEnd<BR>Exit

If I remark out the line with the pic, then no tmp file is created.

The problem I am seeing is my GUI does not display the GUICtrlCreatePic bmp when running from within my WINPE CD. I gather this is due to the CD being read-only and the script not being able to create the tmp file.

I do not understand why autoit creates this temp file or how it determines where to create it but I wonder if there is a way to redirect the tmp file creation to a RAM drive, for example.

Has anyone else experienced this? Is this a known issue? Any suggestions on how to work around this problem?

While I understand this post relates to GUI stuff and might belong in the GUI Help and Support section, the problem seems to be related to the underlying function which is why I am posting here.

Thanks in advance.

I've got Several Solutions for you.

1.) Use a different media source for your WindowsPE source (i.e: copy all the files on your WinPE CD to a different type of media storage that is capable of booting.)

2.) Use a USB Flash Disk to store the temporary files (then unplug it after your application has loaded, the Application files will remain in memory until you exit the application)

3.) Use the hard disk drive already installed in the PC to store the files.

4.) Complie your script to an EXE file. Then download PE Explorer (30 day demo) and modify your application. If you would like me to do this for you then PM me. (I Have the full version of PE Explorer and will willingly help you with your application. I STRONGLY RECCOMMEND THIS METHOD)

5.) Reconfigure the script to use the image from the internet. Then upload the image in question to a website (i reccommend using t35 @ http://t35.com), When your application is launched it SHOULD load. (I do not reccommend this method.)


"To the well orgainized mind, Death is but the nextGreat Adventure" - Professor Dumbledore, Hogwarts Head Master(Excerpted from "Harry Potter and the Sorcers Stone" by J.K. Rowling)"Technology has a Life, Like Humans, and should be treated with respect. When You abuse it, You get abused!" - CRS Chairman of the Board of Directors (me)=================================================I will personally hand pick autoit scripters to join the CRS Corp Scripting Team.=================================================

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