Create a Self-Burning ISO with AutoIt

Trackback or

For those of us who have been working with computer systems for a number of years, dealing with ISO files has become a trivial matter. You simply download the ISO, burn it to a CD and away you go!

Unfortunately, this is not always the case for new users. I have heard numerous people who have burned an ISO for the first time and ended up with a coaster. This can be very frustrating and could even discourage someone to the point where they completely give up.

This is why I have created a process by which anyone can create a self-burning ISO (or SBISO, as I have called it). This means that the user does not need to know how to burn an ISO or find the software. Also, because the executable will not run if the download fails, there is no risk of a failed burn if the file is bad.

Fill Your Toolbox

To begin, you are going to need a couple of things. The first is a working setup of AutoIt. If you haven’t done this, go over to Installing AutoIt for a complete step-by-step article.

The next thing that you will need is to download some files. I have created a SelfBurningISO.zip archive with everything in it except for the ISO. This you will have to download yourself. Optionally, you can download each of these files separately (as described below).

You will have to download BurnCDCC from Terabyte Unlimited that is located in their freeware utilities section. This is the actual burning software that will create the CD from the ISO.

You will also need an ISO. Any ISO will work but I am using the ISO from FreeNAS for this example. I am using this ISO because it is relatively small and works great for testing.

You may also optionally download an icon for the SBISO. This is not required because AutoIt comes with some icons but it is nice to customize it if you would like.

The AutoIt Scripts

The final things that you will need are the two files that I have created to build the self-burning ISO. The first is the actual AutoIt script called SelfBurningISO.au3. Here is what mine looks like to create the FreeNAS SBISO:

#include <File.au3>
#include <GUIConstants.au3>
 
$TempFolder = _TempFile()
;Change 'FreeNAS-0.671.iso' in the following line to the name of your ISO
$ISOName = $TempFolder & "\FreeNAS-0.671.iso"
$BurnEXE = $TempFolder & "\BURNCDCC.EXE"
$License = $TempFolder & "\LICENSE.TXT"
$ReadMe = $TempFolder & "\README.TXT"
$BurnCommand = """" & $BurnEXE & """ /I=""" & $ISOName & """ /V /F"
 
DirCreate($TempFolder)
 
FileInstall("LICENSE.TXT",$License)
$LicenseContent = FileRead($License)
 
$frmLicense = GUICreate("BurnCDCC License", 513, 363, 192, 125)
$rdoAccept = GUICtrlCreateRadio("I accept this license", 24, 312, 113, 17)
$rdoReject = GUICtrlCreateRadio("I DO NOT accept this license", 24, 336, 169, 17)
$txtLicense = GUICtrlCreateEdit("", 8, 8, 497, 301, BitOR($ES_READONLY,$WS_VSCROLL,$WS_HSCROLL), $WS_EX_CLIENTEDGE)
GUICtrlSetData($txtLicense,$LicenseContent)
$btnBurn = GUICtrlCreateButton("Burn", 344, 328, 75, 25)
GUICtrlSetState($btnBurn,$GUI_DISABLE)
$btnCancel = GUICtrlCreateButton("Cancel", 432, 328, 75, 25)
GUISetState(@SW_SHOW)
 
While 1
	$Message = GuiGetMsg()

	Switch $Message

	Case $GUI_EVENT_CLOSE
		ExitLoop

	Case $btnBurn
		GUISetState(@SW_HIDE)
		TrayTip("Preparing Files...","Preparing files for burning.  Please wait...",5,1)
		FileInstall("BURNCDCC.EXE",$BurnEXE)
		FileInstall("README.TXT",$ReadMe)
		;Change 'FreeNAS-0.671.iso' in the following line to the name of your ISO
		FileInstall("FreeNAS-0.671.iso",$ISOName)
		TrayTip("Starting Burn...","Burn process has begin.  Please wait...",0,1)

		$BurnProcess = RunWait($BurnCommand)
		ExitLoop

	Case $btnCancel
		ExitLoop
	Case $rdoAccept
		GUICtrlSetState($btnBurn,$GUI_ENABLE)
	Case $rdoReject
		GUICtrlSetState($btnBurn,$GUI_DISABLE)
 
	EndSwitch
WEnd
 
GUIDelete($frmLicense)
DirRemove($TempFolder)

Download this code: SelfBurningISO.au3

You will also need the AutoItWrapper configuration file so that when you compile the SBISO in SciTE4AutoIt3, it knows where to find everything. Here is my configuration file:

[Autoit]
aut2exe=C:\Program Files\AutoIt3\Aut2Exe\Aut2Exe.exe
icon=CD.ico
;Set 'outfile' to the name of executable you want to generate
outfile=FreeNAS-0.671.iso.exe
Compression=4
PassPhrase=
Allow_Decompile=4
[Res]
UpdateInformation=1
;Set 'Comment' to something meaningful
Comment=FreeNAS is a free NAS (Network-Attached Storage) server, supporting: CIFS (samba), FTP, NFS, RSYNC protocols, local user authentication, Software RAID (0,1,5) with a Full WEB configuration interface. FreeNAS takes less than 32MB once installed on Compact Flash, hard drive or USB key.
;Set 'Description' to something meaningful
Description=FreeNAS 0.671 Self-Burning ISO
;Set 'Fileversion' to the version number of the ISO you will burn
Fileversion=0.671
Fileversion_AutoIncrement=n
;Set 'LegalCopyright' to copyright for the ISO you are burning
LegalCopyright=© 2006 FreeNAS.org
;Leave 'Field1Name', 'Field1Value', 'Field2Name', and 'Field2Value' if you want to show your thanks to Daily Cup of Tech and 
Field1Name=Self-Burning ISO Designed By
Field1Value=http://DailyCupOfTech.com
Field2Name=BurnCDCC by
Field2Value=http://terabyteunlimited.com
[Other]
Run_AU3Check=1
AU3Check_Parameter=
Run_Before=
Run_After=

Download this code: SelfBurningISO.au3.ini

Creating the Build Folder

Once you have downloaded everything, place all of the files in the same folder. It does not matter what the folder is called. Just to recap, you should have the following files in that folder:

  • BURNCDCC.EXE - The BurnCDCC executable file.
  • LICENSE.TXT - License file for BurnCDCC.
  • README.TXT - Readme file for BurnCDCC.
  • SelfBurningISO.au3 - The SBISO AutoIt Script
  • SelfBurningISO.au3.ini - The AutoItWrapper configuration file.
  • ISOFile.ISO - The ISO file that will be converted into a SBISO. In this example, I am using FreeNAS-0.671.iso
  • icon.ico (optional) - The icon that the SBISO will use. In this example, I am using CD.ico

Once everything is in the build folder, you are ready to customize your SBISO.

Customize Your SBISO

If you are building the exact same SBISO that I anm using in the example, you can skip this part and go onto actually building it. Otherwise, you will need to modify a couple of entries in both SelfBurningISO.au3 and SelfBurningISO.au3.ini. Start by opening these two files in SciTE4AutoIt3.

In SelfBurningISO.au3, there are only two places that you need to potentially make changes. On lines 6 and 41 (just after the comments to change the following line), change the name of the ISO to the name of the ISO that you are going to use. You can do a simple search and replace for FreeNAS-0.671.iso on the file and replace it with your one ISO file name. Make sure you save this file again.

SelfBurningISO.au3.ini has a few more options that can be tweaked. Some need to comply with certain standards while others can be set to pretty much whatever you want.

Line 3 is the name of the icon that you want to use. On line 5, set outfile= to what you want the executable to be. Lines 12, 14, 16, and 19 are all completely customizable to your heart’s content. These will show up in the properties of the file when you right click on the file and select Properties.

Create your SBISO

When you have completed all of the modifications, all you need to do is make sure the SelfBurningISO.au3 is the active file in SciTE4AutoIt3 and press the F7 key (or go to Tools, Build if you are a point and click kind of person). The system will whir away for a bit as it compiles all of the needed files together. When you are done, you will have your completed SBISO!

Note: I have noticed that on some machines it does not rename the SBISO properly as specified in SelfBurningISO.au3.ini. It names it the default name which is the same as the script name with an exe extension instead of an au3 extension. You may need to rename it manually.

Now, when you double click on the SBISO, you should have a quick license to accept and then an ISO burner with all of the fields already entered. All you need to do is click Start.

Here are some screenshots that I have put together:

sbiso03.png
A SBISO File

sbiso04.png
The SBISO General Properties

sbiso05.png
The SBISO Version Information

sbiso06.png
More Version Information

sbiso07.png
More Version Information

sbiso08.png
More Version Information

sbiso09.png
More Version Information

sbiso00.png
The BurnCDCC License (Not Accepted)

sbiso01.png
The BurnCDCC License (Accepted)

sbiso10.png
The BurnCDCC Application

To see this in action, feel free to download my copy of the FreeNAS SBISO. Be warned that the file is 30 MB. Don’t try this with dial-up!

Conclusion

I believe that this simple little AutoIt script, implemented properly, could help new users immensely. Once the ISO burning hurdle is overcome, they can begin to experience all types of new computing realms.

Trackback link - http://www.dailycupoftech.com/create-a-self-burning-iso-with-autoit-work-in-progress/trackback/
Tim Fehlman

4 Responses to “Create a Self-Burning ISO with AutoIt”

  1. Rob Dunn Says:

    Nice job - so many people try to burn the ISO -to- the disc instead of thinking of it like an archive -of- the disc…

    common mistake made by all when we try to burn ISOs for the first time…

  2. Tim Fehlman Says:

    Excellent way of describing what an ISO is. Thanks for the kind words.

    Tim

  3. Mikorist Says:

    This is my method:

    Put:

    BURNCDCC.EXE &

    test.iso into

    Test Folder

    Go to Winrar

    Add to archive,

    Create SFX archive,

    Advanced SFX options,

    :P

    Mikorist

  4. Jamie Says:

    Can’t get this to work - tried twice - I get MANY errors when compiling. $txtLicense - GUICtrlCreateEdit….(many different lines)all are READONLY. Created the .exe file. When I click it I get an error in “line -1: Error: Variable used withut being declared - OK” I’m not a programmer…just been assigned to create a self-burning iso. Any ideas?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>