Help - Search - Members - Calendar
Full Version: Imagex GUI Open Source
MSFN Forums > Unattended Windows Discussion & Support > Windows PE

   
Google Internet Forums Unattended CD/DVD Guide
p4ntb0y
Hi guys I have a Imagex gui here which I hope you will like.

The whole thing has been re-done all the code has been done in VB6.

This has been tested in vista pe and winpe 2005.


here are a couple of screenshots...



Added different compression types.






As you can see you can Mount Images, extract well do everything that the cmd line imagex can do, as all that the code does is call imagex behind the GUI, The cmd for imagex will be displayed at the botton of the gui for debug.

Anyone that would like to have the source files are welcome please PM me and I will mail you untill I can host them somewhere. The current size is 1.5mb

I have added a place on the front of the gui so that you can place a OEMLOGO.JPG for your company or yourself (I made a mistake and left it at jpg instead of bmp

trtkrom was kind enougth to post the VB6 api calls, I am way out of my depth here with the coding :-(

You do need the following files within the same location..
imagex.exe
intclg.exe
winfltr.ini
winfltr.sys
wimgapi.dll
COMDLG32.OCX
MSCOMCTL.OCX
MSVBVM60.DLL
tabctl32.ocx

and if you want to add your own exclude list...
include a custom Wimscript.ini file

If you would like the Source files then Please PM me and I will send it out. The above ocx and dll files apart from wimgapi are included.

This is all I have at the moment which is a a bit lame as I need to learn a hell of a lot more vb and c++

I would be willing to fund a project if someone can code a proper gui with api calls and a progress bar!

I have included a new attachment but it does not have the MSCOMCTL.OCX or MSVBVM60.DLL due to the size
mmarable
I like the idea. The transparancy is a bit distracting, but other than that it looks interesting.
mmarable
Okay, a couple of questions. When making a WIM, what is the "Output Folder" as compared to the "Destination Folder"? Will there be an option to use a config file for exclusions? Does it have any dependencies (i.e. you have to have the WAIK installed, etc.)?
p4ntb0y
Nearly done a new version of this GUI.

I have binned the transparent window.
Added an option for Checkdisk.

And as soon as I have worked out the split wims that will be an option as well.

Was thinking of adding support to intergrate drivers and change HAL type.

any other options reguired?

Once finsihed I will post it.
geezery
I didn't get the PM, but can you send me the source code. I could look it a bit. Does it use the wimgapi.dll directly?

I think that the mounting won't work in WinPe, but I'm nota 100% sure about that.
pretender69
looks sweet
can't wait smile.gif
geezery
wrong thread
p4ntb0y
just a litle update on what the gui looks like at the moment.

screenshots....



I am going to add the option for the different compressions I think.



The WimInfo button gives you all the info about WIMS in a nice laid out window from the xml output this includes total sizes so I may use this option for the split wims accross CD's /DVD's



The check wim on capture option is the the checkdisk option

I really want to be able to convert the c++ header file for the wimgapi.dll api's to vb6 any takers on this?

what other options would be needed? diskpart GUI to go along side this? map network share? inject drivers option? change hal option?
pretender69
wow thumbup.gif

this is looking awesome, great work smile.gif
can't wait to try this out!
hehe

all those options sound really good to me smile.gif

wow!!
woodswalker
Looks great. Can't wait to try this one out!
rabiddachshund
Awesome work. One question though: If the command line won't work, this won't force it, will it?
<imagex /mount e:\preload\base5.wim 1 c:\vistamount>
returns: The request is not supported.

....why? Please help. I'm desperate


----------------------------------
There's no place like 127.0.0.1.
p4ntb0y
sorry for the late reply..

I have only got the mount thing working when the waik is installed on your machine.

I will be releaseing a new version which is just about finished.

the finished version and open source will be avaiable later this week.

As before this does not use any API Calls, however I am trying to learn a c++ so that I can use API's from the wimgapi.dll but like like everything trying to learn a new langauge, and exams to study for it may be some time.

But the new version looks plain but works for my Engineers and me.
aaron818
Can't wait for your next post. thumbup.gif
trtkron
QUOTE (p4ntb0y @ Jun 30 2007, 06:58 PM) *
As before this does not use any API Calls, however I am trying to learn a c++ so that I can use API's from the wimgapi.dll but like like everything trying to learn a new langauge, and exams to study for it may be some time.



Here is some code to get you started. I belive this is everything in wimgapi.h and a couple examples. Some tricky ones are the progress bar ones. Wimgapi is multithreaded so you have to create a form + callback for it on the fly to track the progress when using VB6.

CODE
Option Explicit

Public Declare Function WIMApplyImage Lib "WIMGAPI.DLL" (ByVal hImage As Long, ByVal lpszPath As String, ByVal dzApplyFlags As Long) As Boolean
Public Declare Function WIMCaptureImage Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal lpszPath As String, ByVal dwCaptureFlags As Long) As Boolean
Public Declare Function WIMCloseHandle Lib "WIMGAPI.DLL" (ByVal hObject As Long) As Boolean
Public Declare Function WIMCreateFile Lib "WIMGAPI.DLL" (ByVal lpszWimPath As String, ByVal dwDesiredAccess As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwCompressionType As Long, ByRef CreationResult As Boolean) As Long
Public Declare Function WIMMountImage Lib "WIMGAPI.DLL" (ByVal lpszMountPath As String, ByVal lpszWimFileName As String, ByVal dwImageIndex As Long, Optional ByVal lpszTempPath As String) As Boolean
Public Declare Function WIMDeleteImage Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal dwApplyFlags As Integer) As Boolean
Public Declare Function WIMExportImage Lib "WIMGAPI.DLL" (ByVal hImage As Long, ByVal hwim As Long, ByVal dwApplyFlags As Integer) As Boolean
Public Declare Function WIMGetImageCount Lib "WIMGAPI.DLL" (ByVal hwim As Long) As Integer
Public Declare Function WIMGetMessagecallbackCount Lib "WIMGAPI.DLL" (ByVal hwim As Long) As Integer
Public Declare Function WIMLoadImage Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal dwImageIndex As Integer) As Long
Public Declare Function WIMSetBootImage Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal dwImageIndex As Integer) As Boolean
Public Declare Function WIMSetReferenceFile Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal lpszPath As String, ByVal dwFlags As Integer) As Boolean
Public Declare Function WIMSplitFile Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal lpszPartPath As String, ByRef pliPartSize As Integer, ByVal dwFlags As Integer) As Boolean
Public Declare Function WIMUnmountImage Lib "WIMGAPI.DLL" (ByVal lpszMountPath As String, ByVal lpszWimFileName As String, ByVal dwImageIndex As Integer, ByVal bCommitChanges As Boolean) As Boolean
Public Declare Function WIMSetTemporaryPath Lib "WIMGAPI.DLL" (ByVal hwim As Long, ByVal lpszPath As String) As Boolean
Public Declare Function WIMGetImageInformation Lib "WIMGAPI.DLL" (ByVal hImage As Long, ByRef lplpvImageInfo As Long, ByRef lpcbImageInfo As Integer) As Boolean
Public Declare Function WIMSetImageInformation Lib "WIMGAPI.DLL" (ByVal hImage As Long, ByVal lpvImageInfo As Long, ByVal cbImageInfo As Integer) As Boolean
Public Declare Function WIMMessageCallback Lib "WIMGAPI.DLL" (ByVal dwMessageId As Integer, ByVal wParam As Long, ByVal lParam As Long, ByVal lpvUserData As Long) As Integer
Public Declare Function WIMCopyFile Lib "WIMGAPI.DLL" (ByVal lpszExistingFileName As String, ByVal lpszNewFileName As String, ByVal lpProgressRoutine As Any, ByVal lpvData As Long, ByVal pbCancel As Boolean, ByVal dwCopyFlags As Integer) As Boolean

Public Const WIM_GENERIC_READ As Long = &H80000000
Public Const WIM_GENERIC_WRITE As Long = &H40000000
Public Const WIM_CREATE_NEW As Byte = &H1
Public Const WIM_CREATE_ALWAYS As Byte = &H2
Public Const WIM_OPEN_EXISTING As Byte = &H3
Public Const WIM_OPEN_ALWAYS As Byte = &H4
Public Const WIM_COMPRESS_NONE As Byte = 0
Public Const WIM_COMPRESS_XPRESS As Byte = 1
Public Const WIM_COMPRESS_LZX As Byte = 2
Public Const WIM_CREATED_NEW As Byte = 0
Public Const WIM_OPENED_EXISTING As Byte = 1
Public Const WIM_FLAG_RESERVED As Byte = &H1
Public Const WIM_FLAG_VERIFY As Byte = &H2
Public Const WIM_FLAG_INDEX As Byte = &H4
Public Const WIM_FLAG_NO_APPLY As Byte = &H8
Public Const WIM_FLAG_NO_DIRACL As Byte = &H10
Public Const WIM_FLAG_NO_FILEACL As Byte = &H20
Public Const WIM_FLAG_SHARE_WRITE As Byte = &H40
Public Const WIM_FLAG_FILEINFO As Byte = &H80
Public Const WIM_FLAG_NO_RP_FIX As Integer = &H100
Public Const WIM_REFERENCE_APPEND As Long = &H10000
Public Const WIM_REFERENCE_REPLACE As Long = &H20000
Public Const WIM_EXPORT_ALLOW_DUPLICATES As Byte = &H1
Public Const WIM_EXPORT_ONLY_RESOURCES As Byte = &H2
Public Const WIM_EXPORT_ONLY_METADATA As Byte = &H4
Public Const INVALID_CALLBACK_VALUE As Long = &HFFFFFFFF
Public Const WIM_COPY_FILE_RETRY As Long = &H1000000
Public Const WIM_MSG_SUCCESS As Byte = 0&
Public Const WIM_MSG_DONE As Long = &HFFFFFFF0
Public Const WIM_MSG_SKIP_ERROR As Long = &HFFFFFFFE
Public Const WIM_MSG_ABORT_IMAGE As Long = &HFFFFFFFF
Public Const WIM_ATTRIBUTE_NORMAL As Byte = &H0
Public Const WIM_ATTRIBUTE_RESOURCE_ONLY As Byte = &H1
Public Const WIM_ATTRIBUTE_METADATA_ONLY As Byte = &H2
Public Const WIM_ATTRIBUTE_VERIFY_DATA As Byte = &H4
Public Const WIM_ATTRIBUTE_RP_FIX As Byte = &H8
Public Const WIM_ATTRIBUTE_SPANNED As Byte = &H10
Public Const WIM_ATTRIBUTE_READONLY As Byte = &H20


Delete

CODE
lHandle = WIMCreateFile(ConvertToUniCode("Path_To_Wim"), WIM_GENERIC_WRITE, WIM_OPEN_EXISTING, WIM_FLAG_SHARE_WRITE, WIM_COMPRESS_XPRESS, 0)
WIMSetTemporaryPath(lHandle, ConvertToUniCode(oWSHShell.ExpandEnvironmentStrings("%Temp%")))            
WIMDeleteImage(lHandle, cmbImageNumber.Text)
WIMCloseHandle (lHandle)


Mount

CODE
WIMMountImage(ConvertToUniCode("Path_To_Mount"), ConvertToUniCode("Path_To_Wim"), ImageNumber, ConvertToUniCode("Path_To_Temp"))


Unmount

CODE
WIMUnmountImage(ConvertToUniCode("Path_To_Mount"), ConvertToUniCode("Path_To_Wim"), ImageNumber, True/FalseSaveChanges))


Get Number of Images in WIM file

CODE
lHandle = WIMCreateFile(ConvertToUniCode("Path_To_Wim"), WIM_GENERIC_WRITE, WIM_OPEN_EXISTING, WIM_FLAG_SHARE_WRITE, WIM_COMPRESS_XPRESS, 0)
iNumberOfImages = WIMGetImageCount(lHandle)
WIMCloseHandle (lHandle)
chiners_68
where do you get these two files from..

winfltr.ini
winfltr.sys



ive got the rest but searching on my whole drive but they dont exist. Ill search the web but it might benefit others if they know where to locate them from.
madsbrodersen
QUOTE (trtkron @ Jul 2 2007, 10:15 PM) *
Delete

CODE
lHandle = WIMCreateFile(ConvertToUniCode("Path_To_Wim"), WIM_GENERIC_WRITE, WIM_OPEN_EXISTING, WIM_FLAG_SHARE_WRITE, WIM_COMPRESS_XPRESS, 0)
WIMSetTemporaryPath(lHandle, ConvertToUniCode(oWSHShell.ExpandEnvironmentStrings("%Temp%")))            
WIMDeleteImage(lHandle, cmbImageNumber.Text)
WIMCloseHandle (lHandle)


Mount

CODE
WIMMountImage(ConvertToUniCode("Path_To_Mount"), ConvertToUniCode("Path_To_Wim"), ImageNumber, ConvertToUniCode("Path_To_Temp"))


Unmount

CODE
WIMUnmountImage(ConvertToUniCode("Path_To_Mount"), ConvertToUniCode("Path_To_Wim"), ImageNumber, True/FalseSaveChanges))


Get Number of Images in WIM file

CODE
lHandle = WIMCreateFile(ConvertToUniCode("Path_To_Wim"), WIM_GENERIC_WRITE, WIM_OPEN_EXISTING, WIM_FLAG_SHARE_WRITE, WIM_COMPRESS_XPRESS, 0)
iNumberOfImages = WIMGetImageCount(lHandle)
WIMCloseHandle (lHandle)


Do you have any samplecode involving WIMMessageCallback function?

I have been writing a wrapper for WIMGAPI.dll in vb6, but im having trouble obtaining the progress in applying and capturing the image.
killerlp
Hi

I managed to get it running in vista and xp os itself. However in Vista PE, i get a Run-time error '429' ActiveX component cant create object". The GUI launches but i cannot do anything with it.

Any help?
Thx
smile.gif

Daniel
trtkron
QUOTE (madsbrodersen @ Jul 26 2007, 11:55 PM) *
Do you have any samplecode involving WIMMessageCallback function?

I have been writing a wrapper for WIMGAPI.dll in vb6, but im having trouble obtaining the progress in applying and capturing the image.


No I don't.

The reason for you problem is that Wimgapi is multithreaded so you have to create a form/progressbar/whatever + callback for it on the fly to track the progress when using VB6.
ubernerd
I have done some coding with the wimgapi.dll and there is no way you can make vb6 callbacks with the WIMMessageCallback function as VB6 uses a STA (single threaded appartment) model for all its events, and wimgapi.dll uses the MTA (multi threaded appartment) model for the callbacks.

The only solution I found was to built an ActiveX component (in native C++ code) that receives the callbacks and handles the callback as an normal ActiveX events.

I'm unable to share the code as it is part of our commerical solution, but I'll provide hint and pointers if anyone is interrested.

If anyone has another solution to this I'd like to know about it. Preferable one that does not include endless hours of C++ coding (not my strongest language)
p4ntb0y
Intresting...

I way out of my depth here with the coding but I am trying to learn as I go.

Basically what be nice is a standard gui with all the options that has a progress bar and will work in winpe 2005 and winpe 2.

Maybe I should bin the vb stuff and just code in c++
I have seen smartwim.dll but it costs $299!
chiners_68
Hi Guys, i cannot get this to run in vistaPE. can somone help.


ive got all these files in windows directory
imagex.exe
intclg.exe
winfltr.ini
winfltr.sys
wimgapi.dll

& getwiminfo.bat & ondanswin.exe.

When i run the exe file from the cmd prompt in PE nothing happens. Where am i going wrong..?
p4ntb0y
Sorry for the late reply..

Add the following files...

tabctl32.ocx
mscomctl.ocx

I will update soon with source files I am not a coder you see so I am on a rapid learning curve.

chiners 68 if you pm me I give you my mail address seen your in the UK same as me.
solutionone
Hi, this project looks awesome, I had been using the Imagex HTA but have found several limitations and the project itself unfortunately seems to have ground to a halt on the MSFN board.

I have read through all the posts and was wondering if someone could tell me the current status of the gui itself. Does it currently work in Vista PE, what features currently don't work, and is there a completion time frame?
p4ntb0y
Please see first post for edits
SamboA
Hi Guys, i cannot get this to run in WinPE 2.0. can somone help.


I've got all these files on a flash drive in same directory
I'm booted to a Win PE 2.0 Boot CD.
imagex.exe
intclg.exe--->Can't find this exe ???????? Where it be ????
winfltr.ini
winfltr.sys
wimgapi.dll
tabctl32.ocx
mscomctl.ocx
getwiminfo.bat
ondanswin.exe.

When I run the exe file from the cmd prompt in WinPE
I get.....
Run-Time Error '429'
ActiveX Component Can't
Create Object.
I click OK on that.
Imagex GUI Dialog Box Comes up but headings for
Partition to Capture is missing.
And also Heading for Backup Filename Missing too.
I enter the info in the boxes anyway but when I click
Button to Start the imaging it Does Nothing.

Where am I going wrong..?
p4ntb0y
Hi when your making your winpe image I would mount the boot.wim within sources and add the files there in system32 so that you do not have to do the full path for imagex.

The intclg.exe is in my windows aik\tools\x86\intclg.exe

This is just a wrapper dont forget the cmd will be displayed at the bottom of the gui if you cant run the cmd by the cmd then its not going to work in the gui
SamboA
QUOTE (p4ntb0y @ Sep 2 2007, 05:02 AM) *
Hi when your making your winpe image I would mount the boot.wim within sources and add the files there in system32 so that you do not have to do the full path for imagex.

The intclg.exe is in my windows aik\tools\x86\intclg.exe

This is just a wrapper dont forget the cmd will be displayed at the bottom of the gui if you cant run the cmd by the cmd then its not going to work in the gui

I did copy to my Flash Drive Folder from my windows aik\tools\x86\intclg.exe hoping it would cause the
GUI to execute ok but I still get a dialog box that appears to be missing headings for the entries to be filled in with
Drive to capture and Backup location and description. When I click on the "Capture WIM Image button" Nothing Happens. Oh Well !!! I must be missing something. I've used ImageX command line out of this Flash Drive folder
as it is and it works fine. I wanted to try this GUI because it really speeds up the process of getting things started and
eliminating my "Fat Finger" mistakes. My command line is pretty long.
"G:\Imagex GUI\imagex.exe" /config "G:\Imagex GUI\Skipmore.ini" /COMPRESS maximum /capture C: "D:\Images-WIM4-24-2007 Data C-Image.WIM" "04-24-2007 Data C-Image.WIM"

I'll watch the forum some more and maybe these old eyes will see the errors of my ways !!!!
Thanks
p4ntb0y
can you try and re create your problem in vmware and send me a screenshot?
martinr
QUOTE (p4ntb0y @ Aug 1 2007, 05:41 PM) *
Basically what be nice is a standard gui with all the options that has a progress bar and will work in winpe 2005 and winpe 2.

Maybe I should bin the vb stuff and just code in c++

You inspired me to do this, and I have just finished my project.

I have written a program called WIMMaster which gives a graphical interface to the Wimgapi library. I wrote the program in C using Visual Studio 2005. It is similar in looks to OnDansWIM, but is quite different below the surface.

I was able to get the progress bar going for Capture/Append and Export, but had no success with Apply. The reason for this is that the WIMApplyImage function in wimgapi apparently spawns a separate thread for its work, and somehow this blocks the communication needed to run the progress bar. I used a modeless dialog instead to indicate that something was going on.

I have a file which contains all my source code, and also a BartPE plugin and a VistaPE script with all the files encoded into it, except for wimgapi.dll and wimfltr.sys which are of course required for both the plugin and the script. My file is too big to upload here, although it is not all that large. It is available for download here.

Anyone wishing to use the source code will need the Wimgapi SDK which comes with the WAIK, and also Visual Studio 2005. Visual Studio 2003 seemed to have problems reading wimgapi.h, because of all the __in, __out and other similar descriptors it uses.

A number of interesting points arise in the source code. One of them is that the use of a file name for an image is not mandatory as it is with imagex, although it obviously makes sense to have one in a multi-image file. It is actually quite complicated to get the names and descriptions into the wim; I had to write a special function to edit the image to achieve this.

I hope that some will find the coding instructive, and the program useful. It seems to work as well as imagex does.
geezery
Looks very nice.
killerlp
I have also seen the error SamboA encounter. Any updates or error in how we set up??

unsure.gif
spacesurfer
If you're having the problem of nothing happening, are you sure your wimfltr service is started?

Try the following before trying to capture in command prompt:

CODE
net start wimfltr

This will start the wimfltr service necessary for imagex.
mrphrosty
You guys may want to check out GImageX and WIMMaster (much more refined set of tools IMO):
http://www.msfn.org/board/GImageX-WIMMaste...ls-t107920.html
moose-jimsim
cheers m8 looks good smile.gif
moose-jimsim
cheers m8 looks good smile.gif
Mr.John_Doe
Hello,

can I ask you some Questions please.
How does you created this form? Can I use visual Studio express and what do you have to put on the CD to run self builded programs?
Or is there an other way to create a gui? I have created some vbscripts which then I have to port to visual Studio VB ...

Thanks for your help...
jdoman
How can I get this thing to work in WinPE? No matter what I do, it will not start up when I boot to a WinPE CD. What are the prerequisites?
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.