Author Topic: Is it possible to automount cd images into a virtual drive?  (Read 3330 times)

Aeliss

  • Hero Member
  • *****
  • Posts: 915
Re: Is it possible to automount cd images into a virtual drive?
« Reply #2 on: June 30, 2020, 01:40:57 AM »
Ha ? There isn't script for it ?
I don't remember the reason.

A thing you can try
- Install DeamonTool, add a SCSI drive (not working with DT)
- Take a look in "mGalaxy\Data\Scripts"
- Copy paste the file "SSF [Script + DTlite].au3"
- Rename it "MagicEngine.au3"

edit the file

Code: (autoit) [Select]
;----------========== Parsing (common to every scripts) ==========----------
;
; There has been a call from mGalaxy to AutoIt and a commandline has been passed to it:
; Structure:/AutoIt3ExecuteScript "Path_to_script(between quotes)" Path_to_emu Emu_parameters(including a "Path_to_rom"(between quotes))
; Example:/AutoIt3ExecuteScript "C:\...\MESS [Script].au3" C:\...\mess64.exe a800 -flop1 "C:\...\Boulder_Dash.zip" -skip_gameinfo -nowindow
;
; 1. We don't need the part related to AutoiIt anymore [/AutoIt3ExecuteScript "Path to script (between quotes)"], the rest is assigned to '$commandline'
; 2. '$commandline' is then split in two: [Path_to_emu] goes to '$app', [parameters(including a "Path to rom" (between quotes))] goes to '$command'
; 3. Some apps (MESS for instance, when it searchs for a system Bios) need to know the path to their 'Working Directory'. We do 'extract' it from the full app path
;
; 1
Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )
; 2
Local $count2 = StringInStr($commandline, '.exe', 0 , 1, 1)
local $app = StringLeft ($commandline, $count2 + 3 )
local $command = StringTrimLeft($commandline, $count2 + 4 )
if not $command then exit 0
; 3
Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
FileChangeDir($workingDir)
;---------------------------------------------------------------------------

Local $openingCMD
Local $closingCMD

;Check path to DTLite.exe (way to detect and use DaemonTools v5)
Local $pathdaemon = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\DTLite.exe", "")
If not $pathdaemon Then
;Check path to DTAgent.exe (way to detect and use DaemonTools v10)
$pathdaemon = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "DAEMON Tools Lite Automount")
If not $pathdaemon Then
MsgBox(4096, "Search error", "DAEMON Tools Lite not found. Please install it!")
exit 0
Endif
$pathdaemon = StringTrimRight ( $pathdaemon, 9 )
$openingCMD = $pathdaemon & ' -mount dt,0,' & $command
$closingCMD = $pathdaemon & ' -unmount dt,0'
Else
$pathdaemon = '"' & $pathdaemon & '"'
$openingCMD = $pathdaemon & ' -mount scsi, 0,' & $command
$closingCMD = $pathdaemon & ' -unmount 0'
Endif

RunWait($openingCMD)
;RunWait('"' & $app & '-cd"')
$PID = Run( '"' & $app & '" -cd' )

While ProcessExists ( $PID )
      Sleep(500)
WEnd

RunWait($closingCMD)

Exit 0


;Functions
 Func Terminate()
     While ProcessExists ( $PID )
         ProcessClose ( $PID )
     WEnd
     RunWait($closingCMD)
     Exit 0

 EndFunc


This is for test, if it work you need to make a clean system just for this machine and change the script file according to it, else this script will be used for all game used by this emul, even the roms.

And this script is basic it don't work for both DT versions.

« Last Edit: June 30, 2020, 01:42:40 AM by Aeliss »

appollo147

  • Newbie
  • *
  • Posts: 13
Is it possible to automount cd images into a virtual drive?
« Reply #1 on: June 29, 2020, 06:05:27 AM »
Like the topic title says I need to auto load cd images into alcohol 120%. I use Magic Engine for TG-16 and TG-CD games and it requires the image to be mounted, or a CD in the physical drive to run CD games. And before anyone says anything I know their are newer emulators, but I still like magic engine the best. Could someone please tell me if it is possible for mgalaxy to auto mount an image? And if so please give me instructions on how to do it. Any help with this would be greatly appreciated.