Jump to content
Sign in to follow this  
Shadowpp

Pic not displaying when file is present

Recommended Posts

Shadowpp

I am running a WINPE based boot CD (not writable, tho not sure if that applies to my problem) which contains the bmp (verified from doing a DIR) with my script in the same directory. Everything works great except my pic does not display. When I run the script on another pc running XP (full version, not PE) everything works fine. Anyone have any thoughts as to why this isnt displaying the pic? Help is greatly appreciated.....I am completely frustrated.

Here is my code

#include <GuiConstants.au3>

; This value must be updated whenever the script is modified
Dim $Ver = "2.7"

; Declares Global variables
Dim $FULL, $USERID, $COMPNAME, $TIMEZONE = ""

Beep(500, 2000)

#region --- GUI Window Layout ---
GUICreate("Test", 415, 430, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Pic1 = GUICtrlCreatePic("Logo.bmp", 20, 10, 100, 100)

$Label = GUICtrlCreateLabel("Unattended Windows XP Install" & @CRLF & "Non-Store" & @CRLF & "Ver. " & $Ver, 230, 20, 150, 80)
GUICtrlSetFont($Label, 12, 700, "", "Comic Sans")

$Combo_1 = GUICtrlCreateInput("", 20, 150, 155, 20, BitOR($ES_UPPERCASE, $ES_NUMBER))
GUICtrlSetFont($Combo_1, 10, 600, "", "Comic Sans")
GUICtrlSetLimit($Combo_1, 5, 5)
$Label_1 = GUICtrlCreateLabel("Enter the Asset Tag Number", 20, 130, 155, 20)

$Combo_5 = GUICtrlCreateCombo("", 230, 150, 155, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "Eastern Time (U.S. & Canada)|Central Time (U.S. & Canada)|Mountain Time (U.S. & Canada)|Arizona|Pacific Time (U.S. & Canada)|Alaska|Hawaii")
GUICtrlSetFont($Combo_5, 10, 600, "", "Comic Sans")
$Label_5 = GUICtrlCreateLabel("Pick the Time Zone", 230, 130, 155, 20)

$Combo_2 = GUICtrlCreateInput("", 20, 210, 155, 20, $ES_UPPERCASE)
GUICtrlSetFont($Combo_2, 10, 600, "", "Comic Sans")
GUICtrlSetLimit($Combo_2, 8, 8)
$Label_2 = GUICtrlCreateLabel("Enter the User ID", 20, 190, 155, 20)

$Combo_6 = GUICtrlCreateCombo("", 230, 210, 155, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "Albuquerque, NM - Operations|Tolson, AZ - AZ Distribution Center|Phoenix, AZ - Washington Street|Altamonte Springs, FL - Operations|Boca Raton, FL - Operations|Ft. Mills, SC - Southeast Region|Corona, CA - West Coast Region|New Orleans, LA - Operations|Tempe, AZ - Warner Crossing|Pensacola, FL - Operations|El Paso, TX - West Coast Region|Shreveport, LA - Operations|Sarasota, FL - Operations|Tampa, FL - Florida/Gulf Coast Region|Tucson, AZ - Operations")
GUICtrlSetFont($Combo_6, 10, 600, "", "Comic Sans")
$Label_6 = GUICtrlCreateLabel("Pick the Build Site", 230, 190, 155, 20)

$Combo_3 = GUICtrlCreateInput("", 20, 270, 155, 20, $ES_UPPERCASE)
GUICtrlSetFont($Combo_3, 10, 600, "", "Comic Sans")
$Label_3 = GUICtrlCreateLabel("Enter the the Full Name", 20, 250, 155, 20)

$Combo_7 = GUICtrlCreateCombo("", 230, 270, 155, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "Denver, CO - Operations|Oklahoma City, OK - Operations|Albuquerque, NM - Operations|Tolson, AZ - AZ Distribution Center|Phoenix, AZ - Washington Street|Altamonte Springs, FL - Operations|Boca Raton, FL - Operations|Ft. Mills, SC - Southeast Region|Corona, CA - West Coast Region|New Orleans, LA - Operations|Tempe, AZ - Warner Crossing|Pensacola, FL - Operations|El Paso, TX - West Coast Region|Shreveport, LA - Operations|Sarasota, FL - Operations|Tampa, FL - Florida/Gulf Coast Region|Tucson, AZ - Operations|All Market Managers")
GUICtrlSetFont($Combo_7, 10, 600, "", "Comic Sans")
$Label_7 = GUICtrlCreateLabel("Pick the Destination Site", 230, 250, 155, 20)

$Combo_4 = GUICtrlCreateCombo("", 20, 330, 155, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "Desktop|Laptop")
GUICtrlSetFont($Combo_4, 10, 600, "", "Comic Sans")
$Label_4 = GUICtrlCreateLabel("Pick the Machine Type", 20, 310, 155, 20)

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

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button
            MsgBox (0, "Results", "You pressed the button!")
            ExitLoop
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites
Shadowpp

After much additional reading and testing I am still unable to get the pic to display. The bmp is present in the directory that the script is executing from so my understanding is that I do not required the FileInstall() command.

My testing so far:

1) I compiled the script and injected it and my bmp into a WINPE CD then booted it. After booting to the WINPE CD I executed the script from the directory containing the bmp. The pic did not appear.

2) I compiled the script and injected it and my bmp into a WINPE CD then booted it. After booting to the WINPE CD I then copied the script and bmp to a RAM drive and executed the script from there. The pic did not appear.

3) I built a WINPE bootable thumbdrive and copied my script and bmp to it. After booting to the thumbdrive and executing the script the pic DID appear.

GUICreate("Test", 415, 430, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Pic1 = GUICtrlCreatePic("Logo.bmp", 20, 10, 100, 100)

Has anyone experienced this? Any suggestions?

Share this post


Link to post
Share on other sites
Shadowpp

First off, Thank you for your assistance!

I did modify my script as you advised but was met with the same result. No pic displayed.

I'm beginning to wonder if this is somehow related to booting to WINPE from CD versus some read/write media (tho it seems a stretch to me) as I cannot get the pic to dislpay when booting to CD but can when booting to thumb or running on my desktop.

Share this post


Link to post
Share on other sites
Richard Robertson

You said it didn't work on a RAM drive, so read/write isn't the issue here. Did you check with a FileExists to see if the script maybe can't access the file?

Share this post


Link to post
Share on other sites
Shadowpp

While I had previously confirmed the file existed in the scriptdir via explorer, I have added the following to my script before the form displays:

$FOUND = FileExists(@ScriptDir & "\Logo.bmp")

If $FOUND = "1" Then
    MsgBox(0, "Results", "File Present")
Else
    MsgBox(0, "Results", "File Not Present")
EndIf

The result was the file is detected in the @ScriptDir but the form still does not display the bmp when the script is run from within WINPE. Running the script outside of a WINPE environment results in the bmp being displayed in the form.

Share this post


Link to post
Share on other sites
Shadowpp

Using Filemon before executing my script from the thumbdrive or from my desktop has shown that a .tmp file is created when my form displays.

Captuerd when ran on desktop:

nonstore.exe:2744 QUERY INFORMATION C:\DOCUME~1\spelosi\LOCALS~1\Temp SUCCESS Attributes: D

nonstore.exe:2744 QUERY INFORMATION C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Length: 0

nonstore.exe:2744 QUERY INFORMATION C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Length: 512

nonstore.exe:2744 QUERY INFORMATION C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Attributes: A

nonstore.exe:2744 LOCK C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Excl: Yes Offset: 2147483538 Length: 1

nonstore.exe:2744 LOCK C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Excl: Yes Offset: 2147483539 Length: 20

nonstore.exe:2744 UNLOCK C:\DOCUME~1\spelosi\LOCALS~1\Temp\~DF5B07.tmp SUCCESS Offset: 2147483539 Length: 20

<snipped>

Captuerd when ran on Thumbdrive:

nonstore.exe:928 QUERY INFORMATION X:\minint\~DFC477.tmp SUCCESS Length: 0

nonstore.exe:928 QUERY INFORMATION X:\minint\~DFC477.tmp SUCCESS Length: 512

nonstore.exe:928 QUERY INFORMATION X:\minint\~DFC477.tmp SUCCESS Attributes: A

nonstore.exe:928 LOCK X:\minint\~DFC477.tmp SUCCESS Excl: Yes Offset: 2147483538 Length: 1

nonstore.exe:928 LOCK X:\minint\~DFC477.tmp SUCCESS Excl: Yes Offset: 2147483539 Length: 20

nonstore.exe:928 UNLOCK X:\minint\~DFC477.tmp SUCCESS Offset: 2147483539 Length: 20

nonstore.exe:928 LOCK X:\minint\~DFC477.tmp SUCCESS Excl: Yes Offset: 2147483559 Length: 20

<snipped>

Filemon shows no .tmp file when running from my WINPE boot cd.

I executed a SET command to see what the current TEMP and TMP values were for the thumbdrive and WINPE environment but nither had any value set.

I am thinking that my problem is related to the creation of the tmp file - or failure to do so - when executing from the WINPE cd.

Share this post


Link to post
Share on other sites
Shadowpp

Additional searching of the forum has turned up a solution.

Here

and here

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  

×