[Help Us!] Windows native ISO support (2 Viewers)

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Yes, the 'AttachVirtualDisk' function is supported on Win 7, but not for mounting ISO images.

    The first line on the MSDN page says "Attaches a virtual hard disk (VHD) or CD or DVD image file (ISO)"
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Hi,
    I have pushed some change because at first i wasn't able to build the branch. (using nuget to use the correct dll) ;)

    There is a fix also that @red5goahead detected here :
    https://forum.team-mediaportal.com/...-an-amd-video-card.132066/page-8#post-1153924

    I get some others issues, seems to be timing related (maybe impacted by anydvd or anti-virus) :
    Code didn't detect the newly mounted drive and then failed to open the ISO and when it happen, the unmount can't be done because drive letter is unknown from MP side.
    Opening the same ISO multiple times and i get random result lol.

    Not sure if we can use something else than PowerShell API or maybe force PowerShell API to use always the same drive.

    Thanks @regeszter :p
     
    Last edited:

    regeszter

    Retired Team Member
  • Premium Supporter
  • October 29, 2005
    5,335
    4,954
    Home Country
    Hungary Hungary
    maybe force PowerShell API to use always the same drive.

    There is no parameter which pass the drive letter to the API. We can only get the result using Get-Volume. :(

    Seb,

    can you upload a log when the mount is failed?
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    There is no parameter which pass the drive letter to the API. We can only get the result using Get-Volume. :(
    Can't you use Set-Volume after mounting to change to the desired drive letter?
    Yep it's a really code idea, like it seems on my side to failed to get the return result of the mount (but the mouting is ok, i can see it in explorer) if we can force the drive letter right after the mounting when the drive letter set in config, we surely are good to go :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    It's seems that adding :

    Code:
              ps.AddCommand("Mount-DiskImage")
                .AddParameter("ImagePath", IsoFile)
                .AddParameter("PassThru")
                .AddCommand("Set-Volume").AddParameter("DriveLetter", "M");
    And it works, the drive is set to M for testing and ISO seems to always mounted to M:
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Ok, it seems to work :

    Code:
    using (var ps = PowerShell.Create())
            {
              Log.Debug("Mount-DiskImage {0}", IsoFile);
              ps.AddCommand("Mount-DiskImage")
                .AddParameter("ImagePath", IsoFile)
                .AddParameter("PassThru")
                .AddCommand("Set-Volume").AddParameter("DriveLetter", _Drive.Remove(_Drive.Length - 1));
              ps.Invoke();
              Log.Debug("Mount-DiskImage DriveLetter {0}", _Drive);
            }

    I will test more later :) need to go to bed lol
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Finally, i have push the change, need to be tested, i have modified MP config to be able to set a drive letter not used by windows.
    Will see what happen :)
     

    Users who are viewing this thread

    Top Bottom