Duckware
 You are here: Duckware » WinOpen   Contact us  

WinOpen 6.0c
Open HTML files in a CD AUTORUN.INF
For Windows 7, Vista, XP, 2003, 2000, NT, Me, 98, 95, etc.
 

 
  1. What is WinOpen?
 
WinOpen Manual Index
1. What is WinOpen
2. WinOpen Examples
3. WinOpen Command Line
4. Adding AutoInstall Support
5. Internet Explorer Kiosk Mode
6. AUTORUN.INF Reference Guide
7. Troubleshooting Guide
8. Release History
9. License Agreement
WinOpen allows apps to be run or documents to be opened in a CD AUTORUN.INF.

WinOpen is a very small Win32 application that gives you much better control over what application is run or what file is opened within an AUTORUN.INF file.
TIP: Actually WinOpen will open any file type as long as the computer running your CD has a program associated with that file type (eg: pdf, avi, mpg, doc, txt, bmp, jpg). Use AutoInstall [§4] to dynamically install application support, as needed.
The WinOpen command line syntax is:
winopen document-file
winopen appname.exe exe-options
The normal AUTORUN.INF syntax is (see autorun.inf reference [§6] below for more information):
[autorun]
open=program.exe exe-options
However, the problem with this syntax is that is does not allow you to specify an HTML file to be opened, like:
[autorun]
open=index.html (this does not work)
The solution is WinOpen. Instead, ask WinOpen to open the HTML file for you. The following allows index.html to be opened in the default browser window:
[autorun]
open=winopen \index.html (this works!)
label=Duckware CD
action=View Duckware Manual
icon=duckware.ico
Please note that the back slash ("\") in front of your target file ("index.html") is required. It may work fine on your computer without it, but some computers will fail without it, so it is best to be safe and include it. "\index.html" is just the file specification without the CD drive letter and colon (eg: F:) in front of it. So "\index.html" means try to find index.html in the root of the current drive (which will be the CD drive).  

Filenames with spaces: It is best to avoid filenames with spaces. Other programs (not WinOpen) may have problems with spaces. But, if you still need/want to use a filename that contains spaces, just be sure to enclose the entire filename in double quotation marks, as in:
[autorun]
open=winopen /op:play "\My Vacation Video.avi"
label=My Vacation Video
action=Play Vacation Video
icon=coolvideo.ico
How does WinOpen work? WinOpen simply passes the first filename from the WinOpen command line to the Windows shell, asking the shell to 'open' the command line text. If the command line is an HTML file (see example [§2]), the HTML file is opened within a browser window (in whatever browser is configured to be the 'default' web browser on the computer). If the command line is a program, the program is run (see the Internet Explorer Kiosk example [§5]).
 
  2. WinOpen Examples
HTML: To create a CD where your index.html HTML file automatically appears in the default web browser when your CD is inserted into a customer's computer, create/burn a CD with the following files in the root of the CD:
autorun.inf
winopen.exe
index.html
Where index.html is an HTML file that you have created, winopen.exe is the WinOpen program, and autorun.inf is a file created by you (or use this example file) that looks like:
[autorun]
open=winopen \index.html
label=Acme Product Manual
action=View Acme Product Manual
icon=acme.ico
That is all you need!

Refer to the trouble shooting guide [§7] if you run into any problems.

PDF: Here is an example that uses many of the optional autorun features (see autorun.inf reference [§6]) to allow the viewing of a PDF file. And the AutoInstall [§4] feature of WinOpen is used to automatically install the PDF Adobe Acrobat Reader if the computer does not already have the reader installed:
[autorun]
shell=1040
shell\1040=View 1040
shell\1040\command=winopen /max \i1040.pdf
shell\pdf=Install &Adobe Acrobat Reader 9.0
shell\pdf\command=install\ar90eng.exe
label=Tax Form 1040
action=View Tax Form 1040
icon=taxes.ico
AVI: Here is an example that causes an AVI video file to play when the CD is inserted into the computer:
[autorun]
open=winopen /op:play \myvideo.avi
label=Skiiing Video
action=Play Skiiing Video
icon=skiiing.ico
 
  3. WinOpen Command Line
The WinOpen command line syntax looks like:
winopen [/d] [/min] [/max] [/op:CMD] filename [file-options]
Debug Mode: During your testing of WinOpen, you can use the "/d" command line option, which displays a debug popup dialog every time WinOpen is run. This allows you to see how WinOpen parses the command line, in order to diagnose any problems. Please note that this debug option should never be used on a CD sent to your customers.

Starting a Document or Application Maximized or Minimized [1.1a]: WinOpen takes an optional "/max" or "/min" (notice the space before and after the option below) at the beginning of the command line that will cause a signal to be sent to the application to start 'maximized' or 'minimized'. Most applications will obey that signal and start maximized or minimized (some applications may not). Here is an example of an autorun.inf changed to use this feature:
[autorun]
open=winopen /max \index.html
label=Acme Product Manual
action=View Acme Product Manual
icon=acme.ico
Specifying the shell operation [1.2a]: WinOpen takes an optional "/op:CMD", where CMD is a shell operation command (verb) such as:
VerbDescription
openopens file for viewing
editopens file for editing
playplay video/sound files
printprints a file
runasruns EXE asking for username/password
exploreexplores a folder
propertiesopens property sheet for object
If this option is not specified on the command line, "/op:open" is the default shell operation. For example, if you wanted to play a video, you would probably want to force the video to play (instead of possibly just 'open for editing' on some systems). You would use something like:
[autorun]
open=winopen /op:play \yourvideo.mpg
label=Skiiing Video
action=Play Skiiing Video
icon=skiiing.ico
All file types should support the edit, open, and print command verbs. Many other file types will support other custom verbs (such as play, etc).

Variable substitution [2.0a]: WinOpen supports the following variables on the winopen command line:
$EXEDIR$ - the directory that winopen.exe is in (usually the root of the CD drive)
For example, "$EXEDIR$" may be "E:" or "F:". Variable substitution is required to get Internet Explorer Kiosk mode [§5] to work.
 
  4. Adding AutoInstall Support [2.1a]
What do you do if you place a "winopen filename.EXT" open command into an autorun.inf file and a computer viewing your CD does not have an application installed that is capable of viewing "EXT" file types? For example, consider the following autorun.inf:
[autorun]
open=winopen \i1040.pdf
label=Tax Form 1040
action=View Tax Form 1040
icon=taxes.ico
This autorun.inf attempts to open a PDF document file, which requires Adobe's Acrobat Reader. Normally, if PDF support is not installed, the user would see a WinOpen error message saying that PDF support is not installed.

AutoInstall: The solution is AutoInstall, a feature of WinOpen that will attempt to automatically install the proper document support based upon the filename extension (eg: PDF) and a properly named "Shell\verb" (see autorun.inf reference [§6]), with a verb set to the document extension (eg: PDF, MPG, etc). To add AutoInstall support, use the following autorun.inf syntax:
[autorun]
open=winopen filename.ext
shell\ext=MenuText
shell\ext\command=install.exe exe-options
label=Label for CD in Explorer
action=Label for AutoPlay query dialog in Vista
icon=custom-icon-for-cd-seen-in-explorer.ico
For example, adding WinOpen AutoInstall support for PDF files might look like:
[autorun]
open=winopen \i1040.pdf
shell\pdf=Install &Adobe Acrobat Reader 9.0
shell\pdf\command=install\ar90eng.exe
label=Tax Form 1040
action=View Tax Form 1040
icon=taxes.ico
Where "install\" represents the folder location on the CD where you placed the appropriate setup program. However, if the program is located in the root of the CD drive (instead of the install folder in this example), you would remove "install\".

Then, if the computer using your CD does not have a PDF viewer installed, the user will be asked if they want to automatically install PDF support.
Notice that the configured "MenuText" appears in the dialog title. If the user answers "Yes", the "shell\pdf\command" is run to install PDF support. When the install finishes, WinOpen attempts to open "i1040.pdf" again, which now should work! Of course, you also need to burn the Acrobat installation program, "install\ar90eng.exe" onto the CD for all of this to work. For the Adobe Acrobat Reader Program, you are usually allowed to redistribute the reader installation program.

The advantage of using the "Shell\verb" syntax to configure AutoInstall is that the installation choice is also provided in the CD right mouse click context menu -- which is also very useful for testing to make sure you have configured the autorun file properly -- and for power users who might want to configure support themselves via the menu option.

Tip: If the installation process for whatever document type you are attempting to open with WinOpen is quite complicated, you can also set the "shell\ext\command" command to just 'winopen' another one of your HTML files, containing detailed installation instructions for the "ext" file type.

Note: For AutoInstall to work properly, the winopen.exe program must be located in the same folder as the autorun.inf file -- which means winopen.exe must be located in the root of the CD.
 
  5. Internet Explorer Kiosk Mode [2.0a]
WinOpen allows you to open your autorun.inf HTML file in a browser independent manner. Most of the time you do not (and should not) care about what web browser is configured as the default web browser on a computer (like Internet Explorer, Netscape, Opera, etc).

However, if you do not mind requiring people to use Internet Explorer, it is possible to use the kiosk mode feature of Internet Explorer, which opens up a browser window full-screen with no title bar, menu, buttons, etc.

To see what Kiosk mode looks like, go to "Start / Run" and type "iexplore -k page", where "page" is a web page or web site. For example:
iexplore -k www.duckware.com
Then press ALT-F4 to exit the kiosk mode window. To use Internet Explorer Kiosk mode in an autorun file, just use winopen in an autorun.inf as follows:
[autorun]
open=winopen iexplore.exe -k $EXEDIR$\index.html
label=Acme Full Screen
action=View Acme Full Screen
icon=custom.ico
Please refer to Microsoft's support article, Q154780, which describes Kiosk mode in more detail, and other keyboard shortcuts that are available to you.

TIP: You should provide instructions on your CD (and probably in the opening HTML file) that pressing ALT+F4 will close the kiosk mode browser window -- otherwise viewers will probably not know how to exit the full screen browser window! Take advantage of JavaScript and provide a 'close' link in your 'close instructions'. For example:
Close this window (ALT-F4)
which is implemented in JavaScript as follows:
<a href="javascript:self.close()">Close this window (ALT-F4)</a>
 
  6. AUTORUN.INF Reference Guide
Open: The autorun.inf file has many optional commands. In the sections above, we focused on the open command:
[autorun]
open=program.exe exe-options
label=Label seen in Windows Explorer
action=Label for AutoPlay query dialog in Vista
icon=custom-icon-for-cd-seen-in-explorer.ico
Here are other optional commands in autorun.inf files that you may find very useful for making your CD more professional and user friendly.


Where 'Label' text is displayed
Label: The syntax is "label=text" and it defines the text seen under the CD icon under 'My Computer' (or in the AutoPlay dialog for Windows Vista). For example:
label=AutoRun SlideShow

Where 'Action' text is displayed
Action: Mostly to make the CD look much nicer under Windows Vista, the syntax is "action=text", which is displayed in the Autoplay query dialog that the user sees. For example:
action=Play AutoRun SlideShow
Icon: Allows you to configure an icon that the user sees for the CD drive in Windows explorer. Syntax:
icon=iconfilename[,index]
where iconfilename is the filename to a file on your CD. The file is usually an .ICO file, but can be a .BMP, .EXE, or .DLL file as well. If the file contains more than one icon (EXE and DLL files may), use the optional ",index" setting (a zero based number -- the icons are numbered, starting at zero) to select which icon to use in the file. Examples:
icon=cool.ico
icon=tetris.exe,1
Shell\verb: Allows you to add a custom command (called a 'verb') to the CD drive's shortcut menu! You must specify the verb, the menu text, and the command to run as follows:
shell\verb=MenuText
shell\verb\command=program.exe exe-options
Autorun Menu
Custom menu verbs
Hopefully some examples will help to make this syntax understandable. See how the CD popup menu (seen to the right) has been changed:

shell\viewreadme=Read &Me
shell\viewreadme\command=winopen \readme.html

shell\pdf=Install &Adobe Acrobat Reader 9.0
shell\pdf\command=install\ar90eng.exe

shell\msjavavm=Install Microsoft's VM
shell\msjavavm\command=install\msjavx86.exe


TIP: To create a shortcut to your new menu item, place an ampersand (&) just before the letter that you want underlined. And, of course, you need to actually burn/write the winopen.exe, readme.html, install\ar90eng.exe and install\msjavx86.exe files (referenced in the shell verb commands above) to the CD in order for these shell extensions to work.

Shell: Specifies that one of your shell verbs, as defined above, should be the default command verb instead of the "open" command. The command associated with the default command verb is run whenever your CD is inserted in a CD drive, or the end user double-clicks on your CD in Windows explorer. The syntax is as follows:
shell=verb
For example, to make the viewreadme verb defined above the default verb, you would use the following example:
shell=viewreadme
This may all seem to be pointless because you can always just configure the "open" command to whatever you like, right? Well, the significant advantage of using "shell=" is that it essentially allows you to customize/remove "AutoPlay" from the context menu text.

Namely, do not configure an "open" command. Instead, configure a "shell=" command (along with the shell verb commands) and your menu text is now bolded and the default action -- and 'AutoPlay' is no longer in the menu.
 
  7. WinOpen Trouble Shooting Guide
If your target file does not automatically open when your CD is inserted into your computer, please follow the steps in this trouble shooting guide:

Restart your computer: Some CD burning software will remain in your computer, even after you exit the program, and interfere with the CD autorun process. Remove your test CD, restart your computer, and attempt to load your CD once again.

Verify that the CD is readable: In "My Computer", right click on the CD icon and select 'explore' from the context menu. Do you see winopen.exe, autorun.inf, etc. You should. If not, verify that your CD was written properly and that you wrote all the necessary files to the CD.

Verify that the target filename contains 'no spaces': Windows allows filenames to contain spaces, but we have seen some instances (like with *.PPS) where the entire process failes if the filename contains spaces. While WinOpen can easily deal with filenames with spaces, other programs can not.

Verify that the target file 'opens': With the CD open in explorer from the previous step, double click on the target file (as specified on the autorun.inf "open" line -- which is index.html, or whatever other file you listed on the winopen command line). If your target file opens (in a web browser for an HTML file, or a media player for a video, etc), then exit the application and proceed to the next step. Otherwise, there is most likely a problem with a program being associated with the type of your target file (a web browser for .html file; a media player for .mpg files, etc). Review the installation instructions for the program that you think should be associated with your target file to verify how to configure this association (most products do this automatically during the install process).

Verify the CD autorun: To verify that there is an autorun.inf file on the CD that Windows recognizes, go to "My Computer" and right click on the CD icon. In the context menu that appears do you see a bolded "AutoPlay" as an option? If not, the CD does not have an autorun.inf file (or if you think it does, it is probably misnamed). Please review the files that you placed onto the CD.

Verify the CD autoplay: If you do see "AutoPlay" in the menu (from the previous step), click on the "AutoPlay" menu item. Does your target file open (like index.html in a web browser, or your video clip in a media player)? If so, 'AutoPlay' for your CD drive has probably been disabled since it did not run automatically when you inserted a CD into the drive, but autorun worked when run manually.
For help enabling AutoRun on a computer, go to Start / Help and search on 'auto insert notification' or search Google for 'enable windows autoplay'.
Verify the autorun.inf syntax: Verify that the autorun.inf "open" line is formatted properly (TIP: Run notepad and open the autorun.inf file to verify file contents). The 'open' line in the autorun.inf file should look like "open=winopen \index.html". See the WinOpen Example [§2] above for details.

Verify that winopen.exe is on the CD: In "My Computer", go to the CD drive and verify that winopen.exe is in the root of the CD. See the WinOpen Example [§2] above for details.
 
  8. Release History
Version/Date    Changes made in release
6.0c - 06/08/2011  · EXE is no longer signed to 'Duckware'
6.0a - 08/21/2010  · Work around IE8 and Windows Vista/7 HTML security problem
5.0b - 02/25/2009  · copyright notice update
5.0a - 07/19/2008  · Better AutoInstall support with Vista UAC
· Work around an incorrect function return code in Vista
4.0b - 09/19/2007  · popup help changes
4.0a - 09/18/2007  · code signing changes
3.3a - 09/02/2006  · minor popup help change
3.2c - 02/17/2006  · exe signed by 'Duckware'
3.2b - 01/22/2006  · change popup help slightly
3.2a - 01/09/2006  · change popup help slightly
3.1b - 02/07/2005  · Internet Explorer classpath bug fix; 2005 copyright
3.1a - 03/22/2004  · if no command line, attempt to obtain one from autorun.inf
3.0c - 02/12/2004  · more verbose help message; 2004 copyright
3.0a - 04/22/2003  · 2003 copyright
2.2a - 07/11/2002  · error message when exec of AutoInstall program fails
2.1b - 05/04/2002  · better help; 2002 copyright
2.1a - 11/26/2001  · AutoInstall support
2.0a - 11/23/2001  · Added support for opening EXE's with arguments (IE kiosk mode)
1.2a - 04/27/2001  · Ability to specify shell operation (open, play, etc) on command line
1.1b - 04/25/2001  · Changed shell action to allow video to 'play' (instead of 'open' for editing)
1.1a - 02/15/2001  · Added 'maximized' support
1.0a - 11/22/2000  · First release
 
  9. No Nonsense License Agreement
WinOpen is affordware. That means that you (a business or person) may try it for free to see if it works for you. If you can afford the license fee, you should purchase a license. If you find anything wrong with the software, let me know and I will try to fix the problem immediately. You assume the entire risk and liability of using this software. You may not modify the software in any way. The software may not be used on adult sites nor to display adult material. If you violate this license agreement you agree to stop using this software. If you do not agree to these license terms, do not use this software.

If you do agree to these license terms, you may purchase a license and use WinOpen on your CDs royalty-free.

Copyright © 2000-2024 Duckware