1. Running a euphoria program from a CD
- Posted by Chris Burch <chriscrylex at aol.com> Dec 18, 2003
- 428 views
Hi I recently had to write a small front end for a CD for installing/running programs, and running a video. I wrote it in Euphoria with win32lib, a pretty picture, and a few buttons - ie a very simple program. It ran absolutely fine on the hard drive, bound and unbound. When I copied it onto a CD, first I got the message unable to write ex.err, so I added crash_file("c:\\xxx.tmp"), re-bound it and burnt another CD, and then I got a console list of errors - of little use unfortunateley because of the shrouded nature of the variables, although I suspect that they are from within win32lib. Anyway, I gave up and created an html interface. My question is this - is euphoria able to run directly from a CD, or is this a win32 lib issue? I have had problems with other programs trying to run from CD (CDMenu, Tony Steward), this wouldn't work under XP, but did under win98. Is this a fixable issue? Does euphoria, or win32lib require writable disc space on the drive where it runs? As I've said, I've solved the problem now, but it would be nice to use Eu for CD front ends, reliably without creating multiple coffe coasters (I already get lots from AOL) Just to show how simple the program is, here it is -- code generated by Win32Lib IDE v0.18.1 include machine.e crash_file("c:\\xxx.tmp") include Win32lib.ew without warning -------------------------------------------------------------------------------- -- Window Window1 -------- IDE generated routine ------------ integer IDEcenterWinX, IDEcenterWinY, IDEcenterScreenX, IDEcenterScreenY sequence IDEScreenSize integer IDEctrlX, IDEctrlY, IDEctrlCX, IDEctrlCY IDEctrlCX = 209 IDEctrlCY = 373 IDEScreenSize = getRect(Screen) IDEcenterWinX=floor( IDEctrlCX/2 ) IDEcenterScreenX = floor( IDEScreenSize[3]/2 ) IDEctrlX=IDEcenterScreenX-IDEcenterWinX IDEcenterWinY=floor( IDEctrlCY/2 ) IDEcenterScreenY=floor( IDEScreenSize[4]/2 ) IDEctrlY=IDEcenterScreenY - IDEcenterWinY constant Window1 = createEx( Window, "Nativity install", 0, IDEctrlX, IDEctrlY, 209, 373, {WS_DLGFRAME, WS_SYSMENU}, {WS_EX_DLGMODALFRAME} ) constant Bitmap4 = createEx( Bitmap, "Bitmap4", Window1, 0, 0, 200, 340, 0, 0 ) setBitmap( Bitmap4,"E:\\Documents and Settings\\Daddy\\My Documents\\My Videos\\original nativity files\\snowman1.bmp") constant PushButton5 = createEx( PushButton, "Run video", Window1, 52, 172, 96, 28, 0, 0 ) setBitmap( PushButton5,"E:\\Documents and Settings\\Daddy\\My Documents\\My Videos\\original nativity files\\snowman1.bmp") constant PushButton6 = createEx( PushButton, "Install divx", Window1, 52, 212, 96, 28, 0, 0 ) setHint( PushButton6,"This installs the compressor to view the video") constant PushButton7 = createEx( PushButton, "Install Real Player", Window1, 52, 252, 96, 28, 0, 0 ) constant LText8 = createEx( LText, "Or close this and start your", Window1, 40, 292, 132, 20, 0, 0 ) setWindowBackColor( LText8,16777215) constant LText9 = createEx( LText, "DVD player", Window1, 72, 312, 60, 20, 0, 0 ) setWindowBackColor( LText9,16777215) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure Window1_onOpen (integer self, integer event, sequence params)--params is () integer fn -- check for presence of divx5 dll fn = open("\\windows\\system32\\divx.dll","r") if fn > -1 then --disable install divx button setEnable(PushButton6, False) end if close(fn) end procedure setHandler( Window1, w32HOpen, routine_id("Window1_onOpen")) -------------------------------------------------------------------------------- procedure PushButton5_onClick (integer self, integer event, sequence params)--params is () integer exitcode exitcode = system_exec("explorer SH2003.avi", 0) end procedure setHandler( PushButton5, w32HClick, routine_id("PushButton5_onClick")) -------------------------------------------------------------------------------- procedure PushButton6_onClick (integer self, integer event, sequence params)--params is () integer exitcode exitcode = system_exec("divx50~1.exe", 0) end procedure setHandler( PushButton6, w32HClick, routine_id("PushButton6_onClick")) -------------------------------------------------------------------------------- procedure PushButton7_onClick (integer self, integer event, sequence params)--params is () integer exitcode exitcode = system_exec("realon~1.exe", 0) end procedure setHandler( PushButton7, w32HClick, routine_id("PushButton7_onClick")) WinMain( Window1,Normal ) And here's the first few lines of the crash file (which is BIG) G:\natinst.exe:8894 in procedure Bpz() bad file number (-1) BqA = 3 BqB = 13 BqC = {} BqD = -1 Regards, and a merry xmas and new year to all Chris
2. Re: Running a euphoria program from a CD
- Posted by akusaya at gmx.net Dec 18, 2003
- 420 views
C> -- check for presence of divx5 dll C> fn = open("\\windows\\system32\\divx.dll","r") C> if fn > -1 then --disable install divx button C> setEnable(PushButton6, False) C> end if I have another idea for this, why not just address = open_dll("divx.dll") and then check the value of address. Windows will search the divx.dll file in the system or system32 directory automatically.