Jump to content

OEM Info Creator for Vista and XP


RichE
 Share

Recommended Posts

Hi All,

I rebuild peoples computers on a regular basis, so just to remind them who helped them out, I like to leave my contact info.

So i wrote the OEM Info creator, it's still work in progress and has been tested on vista and works fine, i've just got to do the XP Gui, as vista and xp store the info differently, anyways here's the code so far.

CODE
#RequireAdmin

#include <GUIConstants.au3>

GUICreate("OEM INFO Creator.", 419, 545, -1, -1)

$Quit = GUICtrlCreateButton("EXIT", 240, 508, 169, 33, 0)

GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")

$update = GUICtrlCreateButton("UPDATE", 8, 508, 169, 33, 0)

GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")

guictrlcreatepic("OIC_logo.jpg", 0,0,419, 100)

GUICtrlCreateTab(8, 108, 401, 393)

GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

if @OSVersion = "WIN_VISTA" Then

$VistaSheet = GUICtrlCreateTabItem("Windows Vista")

GUICtrlSetFont(-1, 8, 400, 0, "Terminal")

GUICtrlCreateLabel("Logo", 18, 155, 28, 12)

$LOGO_Input = GUICtrlCreateInput("Your Logo Here", 88, 150, 200, 21)

$Logo_btn = GUICtrlCreateButton("Browse", 300, 151, 96, 19)

GUICtrlCreateLabel("Manufacturer", 18, 180, 76, 12)

$Manu_input = GUICtrlCreateInput("Your Name Here", 88, 176, 200, 21)

GUICtrlCreateLabel("Model", 18, 205, 34, 12)

$Model_input = GUICtrlCreateInput("Computer Model Here", 88,200, 200, 21)

GUICtrlCreateLabel("Support URL", 18, 230, 70, 12)

$Url_input = GUICtrlCreateInput("Your Website Here", 88, 225, 200, 21)

guictrlcreategroup("OEMLOGO Preview", 18, 260, 180, 180)

$logo_preview = guictrlcreatepic("",22,275,165,160)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Quit

Exit

Case $Logo_btn

$logo_select = FileOpenDialog("OEM Logo Image", @MyDocumentsDir, "Images (*.bmp)", 1+2)

Guictrlsetdata($LOGO_Input, $logo_select, "")

GUICtrlSetImage($logo_preview, $logo_select)

Case $Update

$image = guictrlread($LOGO_Input)

$dest = @WindowsDir & "\system32"

if $image = "" or $image = "Your Logo Here" Then

msgbox(48, "Warning!", "No image selected!", 3)

Else

FileCopy($image, $dest, 1)

Msgbox(64, "Image Copy", "OEM Logo Image copied successfully", 3)

guictrlsetdata($LOGO_Input, $dest & "\OEMLogo.bmp", "")

$regoemlocation = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation"

RegWrite($regoemlocation, "Logo", "REG_SZ", guictrlread($LOGO_Input))

RegWrite($regoemlocation, "Manufacturer", "REG_SZ", guictrlread($manu_Input))

RegWrite($regoemlocation, "Model", "REG_SZ", guictrlread($Model_Input))

RegWrite($regoemlocation, "SupportURL", "REG_SZ", guictrlread($Url_input))

msgbox(64, "OEM Info Creator", "Update Successful!")

endif

EndSwitch

WEnd

Elseif @osversion = "WIN_XP" Then

$XPSheet = GUICtrlCreateTabItem("Windows XP")

GUICtrlSetFont(-1, 8, 400, 0, "Terminal")

GUICtrlCreateLabel("Logo", 18, 155, 28, 12)

$LOGO_Input = GUICtrlCreateInput("Your Logo Here", 88, 150, 200, 21)

$Logo_btn = GUICtrlCreateButton("Browse", 300, 151, 96, 19)

GUICtrlCreateLabel("Manufacturer", 18, 180, 76, 12)

$Manu_input = GUICtrlCreateInput("Your Name Here", 88, 176, 200, 21)

GUICtrlCreateLabel("Model", 18, 205, 34, 12)

$Model_input = GUICtrlCreateInput("Computer Model Here", 88,200, 200, 21)

$Url_input = GUICtrlCreateInput("Your Website Here", 88, 225, 200, 21)

GUICtrlCreateLabel("Support URL", 18, 230, 70, 12)

guictrlcreategroup("OEMLOGO Preview", 18, 260, 180, 180)

$logo_preview = guictrlcreatepic("",22,275,165,160)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Quit

Exit

Case $Logo_btn

$logo_select = FileOpenDialog("OEM Logo Image", @MyDocumentsDir, "Images (*.bmp)", 1+2)

Guictrlsetdata($LOGO_Input, $logo_select, "")

GUICtrlSetImage($logo_preview, $logo_select)

Case $Update

$image = guictrlread($LOGO_Input)

$dest = @WindowsDir & "\system32"

if $image = "" or $image = "Your Logo Here" Then

msgbox(48, "Warning!", "No image selected!", 3)

Else

FileCopy($image, $dest, 1)

Msgbox(64, "Image Copy", "OEM Logo Image copied successfully", 3)

guictrlsetdata($LOGO_Input, $dest & "\OEMLogo.bmp", "")

$regoemlocation = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation"

RegWrite($regoemlocation, "Logo", "REG_SZ", guictrlread($LOGO_Input))

RegWrite($regoemlocation, "Manufacturer", "REG_SZ", guictrlread($manu_Input))

RegWrite($regoemlocation, "Model", "REG_SZ", guictrlread($Model_Input))

RegWrite($regoemlocation, "SupportURL", "REG_SZ", guictrlread($Url_input))

msgbox(64, "OEM Info Creator", "Update Successful!")

endif

EndSwitch

WEnd

EndIf

I'll post more code up as I do it (and test it of course)

Edited by l15ard

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
Share on other sites

Check out my OEMWizard!

I am currently working on it right now! I am selling it to a couple of local areas, they are really interested in it!

Edit: Yours doesn't work. Firstly, no includes. Second, missing EndIf's.

Funny that, as i've just copy pasted the code into a new auto/Scite new and it works fine.

1. Hmmm, the paste didn't paste in the include, (which is fixed now:) )

2. no warnings bout missing endif's...??? and runs prefect....

also like i said in the first post, working with vista, I need to do the XP side, so if your using Xp it won't, but i did state that

OEM Wizard i'll check it out.

Note: I've checked out OEM Wizard, and it seems you've been having troubles yourself..., and mine looks better :P

Edited by l15ard

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
Share on other sites

Weird.

No problems with mine. I did when I first started with it, some problems here and there. And no way, mine has Vista Glass effect!

Edit: Look and see how mine checks for Vista or below in the case arguments. You don't need to write out a whole new While Wend if it's not Vista.

Edited by JamesBrooks
Link to comment
Share on other sites

I've finished my version of OI Creator, it has been tested on XP and Vista and works fine. though it doesn't have a coded vista glass effect it does windows native aero glass when ran on Vista and also has the following features:

Program Checks for O/S version and tailors the the gui accordingly.

OEM Logo preview window

Fade in and out of gui

Full inno installer setup with uninstaller.

Line9 (non vista O/S's) is the URL information.

Support Information line can be left blank (in non Vista O/S's)

I've put up some screen shots of the finished app, and if anyone is interested in it, please MSN or email me and i'll send it over.

also source code is available on request.

post-4818-1217328409_thumb.jpg

post-4818-1217328452_thumb.jpg

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
Share on other sites

Ok, yours looks a bit more organised. For XP though, you do not need to have a 97*97 icon, it's the big one you need. Vista requires a smaller logo, so it can fit in with it's bit Vista icon above.

you need 97x97 if your using large fonts 120x120 for small fonts, as per Microsofts site information

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
Share on other sites

Hey very nice l15ard! Thanks for sending it over. I don't understand why you would want to install it for a quick use on a new PC but the application works very well, and easy to use. Thanks for sharing...

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