Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

AutoIt script (mounting image)


ShAddiX

Recommended Posts

I want to write a script in AutoIt but I can't really figure out how to do this.

It should do the following steps:

- mount the cd image in daemon tools (without autoplay, no idea how to do this :/ )

- then run the exe of the game/program

- after exit, it should unmount the cd image and back to GameEx

I know it's quite easy, but especially the auoplay of games confuses me.

Hope someone can help. :)

Link to comment
Share on other sites

I use batchfiles for this. Deamon Tools has the ability to mount via the commandline. You can diable all prompting and autorun via the program.

Why would it need to ummount the image though? You could just end the program,Gameex will regain focus..Next game you select it will then mount that image. It is possable though.

I use batchfiles to call my PSX isos I will post an example later this evening if you wish.

@ECHO OFF

c:

CD "c:\program files\daemon tools\"

daemon.exe -mount 0, "G:\Games\psx\CRONO2PSX.nrg"

g:

CD "G:\Console\psx\epsxe160"

epsxe.exe -nogui

cd g:

pskill epsxe.exe

Link to comment
Share on other sites

Well you'll need to disable the Auto Start for Daemon Tools, then you'll need to grab a copy of TweakUI and disable the Windows Auto Start...so basically you have two layers of Auto Start that must be disabled first off.

Now are you looking to write a script per disc or are you looking at doing something different?

Link to comment
Share on other sites

You'll need to edit the User Vars as needed....the rest of the script shouldn't require any changes.

Per Disc Script

; User Vars
$image = "D:\Games\This_Is_My_Disc_Image.nrg"; Disc Image To Load
$execute = "E:\Run_This_Executable.exe" ; Disc Executable To Run

; Mount CD\DVD Image
RunWait ( 'C:\Program Files\Daemon Tools\daemon.exe -mount 0, "' & $image & '"' )

; Launch Executable
$PID = Run ( $execute )

; Launch Child Termination
Run ( @ScriptDir & '\Kill_Child.exe "' & @AutoItPID & '" "' & $PID & '"' )

; Wait for Emu to Exit
ProcessWaitClose ( $PID )

; Close Loader
Exit

; EOF

Kill_Child

Opt ( 'TrayIconHide' , 1 )

; Wait on Parent to Exit
ProcessWaitClose( $CmdLine[1] )

; Kill Child Process
ProcessClose ( $CmdLine[2] )

RunWait ( 'C:\Program Files\DAEMON Tools\daemon.exe -unmount 0' )

; Close Loader
Exit

; EOF

*Updated*

Forgot to unmount CD\DVD image in Kill_Child

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...