Author Topic: SSF Auto-mount script not working [DTLite + Win10]  (Read 7935 times)

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #12 on: July 31, 2016, 05:11:28 PM »
This final scripts is great, thx for the effort, on with premium :-)
Glad to help you!
Thanks for your support!

reaperke

  • Newbie
  • *
  • Posts: 14
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #11 on: July 31, 2016, 03:07:40 PM »
This final scripts is great, thx for the effort, on with premium :-)

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #10 on: July 31, 2016, 08:34:10 AM »
To conclude, here is the final script (available with next mGalaxy version).
With this script, no need to specify your local path to Daemon Tools v10, mGalaxy will find it by itself!

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)
;---------------------------------------------------------------------------

;Get path to DTAgent.exe
Local $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 )

RunWait($pathdaemon & ' -mount dt,0,' & $command )
RunWait('"' & $app & '"')
RunWait($pathdaemon & ' -unmount dt,0')

Exit 0

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #9 on: July 31, 2016, 05:24:42 AM »
Hi Koen,

Here is a working script, tested! :-)
Just type the path to DTagent.exe in line 13 (ex.: Local $pathdaemon = "C:\Program Files\DAEMON Tools Lite\DTAgent.exe")

Code: (autoit,13) [Select]
Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )

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

Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
FileChangeDir($workingDir)
;---------------------------------------------------------------------------

Local $pathdaemon = "Type here the path to DTagent.exe"

RunWait($pathdaemon & ' -mount dt,0,' & $command )
RunWait('"' & $app & '"')
RunWait($pathdaemon & ' -unmount dt,0')

Exit 0
« Last Edit: July 31, 2016, 05:39:39 AM by mgalaxy »

reaperke

  • Newbie
  • *
  • Posts: 14
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #8 on: July 31, 2016, 04:17:06 AM »
Hi,

We're certainly heading in the right direction here.

It now auto mounts and launches well in SSF however when quitting DT says "unknown switch in command line"

The help in this is greatly appreciated, nice to know a platform like this is well supported.

Kind regards
Koen

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #7 on: July 26, 2016, 11:30:59 AM »
reaperke,

Is your problem resolved? May we still help you?

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #6 on: July 21, 2016, 05:04:24 AM »
Many users revert to DTLite v5.0...the script I've joined here is working with that v5
I think (that must be verified) that you should use this command line if you're using DTLite v10:
Code: (autoit) [Select]
RunWait($pathdaemon & ' -mount dt,0,' & $command )
So, the script would be:
Code: (autoit) [Select]
Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )

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

Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
FileChangeDir($workingDir)
;---------------------------------------------------------------------------

Local $pathdaemon = "C:\Program Files\DAEMON Tools Lite\DTAgent.exe"

RunWait($pathdaemon & ' -mount dt,0,' & $command )
RunWait('"' & $app & '"')
RunWait('"' & $pathdaemon & '" -unmount,0')

Exit 0

reaperke

  • Newbie
  • *
  • Posts: 14
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #5 on: July 21, 2016, 04:55:18 AM »
Wow thanks for the update, the intermediate solutions doesn't do much though it just opens DTlite where I can than manually mount an image, closing it down launches SSF with the game, so workable for a while at least

mgalaxy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1167
    • Email
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #4 on: July 21, 2016, 01:48:06 AM »
reaperke,

Quote
Why does this use the registry key to begin with?
It uses a registry key to be "universal" and not require the user to hard code the path to the application!

I will fix this DTlite + Win10 problem while I'll be back from holiday!
In the meanwhile, I would suggest you to simply enter the path to your application in the script!
Simply copy/paste this code to replace the one you can find in "mGalaxy\Data\Scripts\SSF [Script + DTlite].au3"

You will of course edit the line: Local $pathdaemon = "Type here the path to DTlite.exe" with the real path to your DTlite.exe executable

Code: (autoit, 13) [Select]
Local $count = StringInStr($CmdLineRaw, '.au3"', 0 , 1, 1)
Local $commandline = StringTrimLeft( $CmdLineRaw, $count + 5 )

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

Local $workingDir = StringRegExpReplace($app, "\\[^\\]*$", "")
FileChangeDir($workingDir)
;---------------------------------------------------------------------------

Local $pathdaemon = "Type here the path to DTlite.exe"

RunWait('"' & $pathdaemon & '" -mount 0,' & $command )
RunWait('"' & $app & '"')
RunWait('"' & $pathdaemon & '" -unmount 0')

Exit 0
« Last Edit: July 21, 2016, 01:56:37 AM by mgalaxy »

reaperke

  • Newbie
  • *
  • Posts: 14
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #3 on: July 20, 2016, 04:39:12 PM »
As far as knowing what I'm doing I can only find two entries in the registry referring to DTAgent.exe, neither seems to solve the problem when changing the key in the script.

I can't imagine that I'm the only one having this issue, any more thoughts?

Why does this use the registry key to begin with?  Launchbox runs this proces very well using additional apps feature with a bat file, seems like this could be a similar approach to the new pre-launch feature for mgalaxy6

This issue is the only open keeping me from going to a premium version as I like mGalaxy quite a lot so it's a shame tha emulating one of ma favorite consoles is causing some grief

Aeliss

  • Hero Member
  • *****
  • Posts: 900
Re: SSF Auto-mount script not working [DTLite + Win10]
« Reply #2 on: July 19, 2016, 08:30:48 AM »
Ha yes, it's normal, I forget that.
On last deamon tool version (or only for win10) the executable isn't called "dtlite.exe" but "DTAgent.exe".

Try to edit the file "mGalaxy\Data\Scripts\SSF [Script + DTlite].au3" with this modification, you can edit it with notepad.

Or if it doesn't work, ca you take a look in the registry to find the correct key ?
« Last Edit: July 19, 2016, 08:33:01 AM by Aeliss »

reaperke

  • Newbie
  • *
  • Posts: 14
SSF Auto-mount script not working [DTLite + Win10]
« Reply #1 on: July 18, 2016, 05:44:24 PM »
Hi,

I had high hopes mgalaxy 6 would have tackled the auto mount issue I keep having with DTLite no being found but no luck.

The problem lies in the fact that my DTLite under Win10 seems to have no entries in the windows registry as opposed to what the autolt script expects so I always get the error "DTLite not found.Please install it!".

DTLite is installed yet nowhere in the registry and I have been uninstalling/reinstalling more than enough.

I've tried to change the script myself based on info with similar issues but I'm no coder and nothing I try seems to change anything.

Can someone please help me out with this? Much appreciated.

Gr.
Koen