home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Area 51 - Testing Area
Windows native ISO support
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sebastiii" data-source="post: 1154095" data-attributes="member: 60104"><p>No way to force to use fixed letter drive, i succeed to make it work from powershell but don't succeed to port to C# lol.</p><p>So i have let the selection to MP config for now and back the old way and it seems but i need to test more than using that code :</p><p></p><p>[CODE=C#] using (var ps = PowerShell.Create())</p><p> {</p><p> // Set mounted ISO file to be able to unmount it if something failed to load.</p><p> _MountedIsoFile = IsoFile;</p><p> Log.Debug("Mount-DiskImage {0}", IsoFile);</p><p> ps.AddCommand("Mount-DiskImage").AddParameter("ImagePath", IsoFile).AddParameter("PassThru");</p><p> Log.Debug("Mount-DiskImage Result {0}", psResult.Count);</p><p> }</p><p></p><p> using (var ps = PowerShell.Create())</p><p> {</p><p> ps.AddCommand("Get-DiskImage").AddParameter("ImagePath", IsoFile).AddCommand("Get-Volume");</p><p> var psResult = ps.Invoke();</p><p> Log.Debug("Mount-DiskImage Result {0}", psResult.Count);</p><p> foreach (var driveLetter in psResult.Select(result => result.Members["DriveLetter"].Value.ToString()))</p><p> {</p><p> _Drive = String.Format("{0}:", driveLetter);</p><p> Log.Debug("Mount-DiskImage DriveLetter {0}", _Drive);</p><p> }</p><p> }[/CODE]</p><p></p><p>The newest letter drive is always get (result.count = 1).</p><p>But i fear it's timing issue and then it will failed one day to another or one minute to another lol</p><p>Attached is the modified file.</p><p></p><p>The first i mount the iso and the second i ask from driveletter, when i use all ps.command in one, sometimes (most of the time), i didn't get result but doing that twice ps.addcommand and it seems to work better.</p><p></p><p>Otherwise the powershell command used to change drive letter :</p><p></p><p>$drive = Get-WmiObject -Class win32_volume -Filter "DriveLetter = 'e:'"</p><p>Set-WmiInstance -input $drive -Arguments @{DriveLetter="O:"; Label="Label"}</p><p></p><p>We really need to have this syntax : -Filter "DriveLetter = <strong>'e:'</strong>" -> 'e:' is the current mounted drive</p><p>And i change it to O: by -Arguments @{DriveLetter="<strong>O:</strong>"; Label="Label"}</p><p></p><p><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" /></p><p></p><p>Edit : re-uploaded the zip.</p></blockquote><p></p>
[QUOTE="Sebastiii, post: 1154095, member: 60104"] No way to force to use fixed letter drive, i succeed to make it work from powershell but don't succeed to port to C# lol. So i have let the selection to MP config for now and back the old way and it seems but i need to test more than using that code : [CODE=C#] using (var ps = PowerShell.Create()) { // Set mounted ISO file to be able to unmount it if something failed to load. _MountedIsoFile = IsoFile; Log.Debug("Mount-DiskImage {0}", IsoFile); ps.AddCommand("Mount-DiskImage").AddParameter("ImagePath", IsoFile).AddParameter("PassThru"); Log.Debug("Mount-DiskImage Result {0}", psResult.Count); } using (var ps = PowerShell.Create()) { ps.AddCommand("Get-DiskImage").AddParameter("ImagePath", IsoFile).AddCommand("Get-Volume"); var psResult = ps.Invoke(); Log.Debug("Mount-DiskImage Result {0}", psResult.Count); foreach (var driveLetter in psResult.Select(result => result.Members["DriveLetter"].Value.ToString())) { _Drive = String.Format("{0}:", driveLetter); Log.Debug("Mount-DiskImage DriveLetter {0}", _Drive); } }[/CODE] The newest letter drive is always get (result.count = 1). But i fear it's timing issue and then it will failed one day to another or one minute to another lol Attached is the modified file. The first i mount the iso and the second i ask from driveletter, when i use all ps.command in one, sometimes (most of the time), i didn't get result but doing that twice ps.addcommand and it seems to work better. Otherwise the powershell command used to change drive letter : $drive = Get-WmiObject -Class win32_volume -Filter "DriveLetter = 'e:'" Set-WmiInstance -input $drive -Arguments @{DriveLetter="O:"; Label="Label"} We really need to have this syntax : -Filter "DriveLetter = [B]'e:'[/B]" -> 'e:' is the current mounted drive And i change it to O: by -Arguments @{DriveLetter="[B]O:[/B]"; Label="Label"} :p Edit : re-uploaded the zip. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Area 51 - Testing Area
Windows native ISO support
Contact us
RSS
Top
Bottom