- October 3, 2008
- 16
- 0
- Home Country
- Sweden
Yup that did work!
Yup that did work!
Hi
I've just downgraded to 1.2.3 and it now working fine for me.
Thanks
//css_reference "MpeCore.dll";
//css_reference "Utils.dll";
using MpeCore.Classes;
using MpeCore;
using System.Diagnostics;
using System;
using MediaPortal.Profile;
public class Script
{
public static void Main(PackageClass packageClass, ActionItem actionItem)
{
ProcessStartInfo psi = new ProcessStartInfo();
psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);
psi.FileName = "cmd.exe";
psi.Arguments = "/c regsvr32 /s \"" + MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax") + "\""; psi.Verb = "runas";
psi.CreateNoWindow = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.ErrorDialog = false;
try
{
Process p = System.Diagnostics.Process.Start(psi);
p.WaitForExit(10000);
addVideoExtension(".rar");
}
catch
{
}
}
// add the extension
static bool addVideoExtension(string extension)
{
using (MediaPortal.Profile.Settings xmlwriter = new MPSettings())
{
string currValue = xmlwriter.GetValue("movies", "extensions");
if(!currValue.ToLower().Contains(extension))
{
xmlwriter.SetValue("movies", "extensions", currValue + "," + extension);
MediaPortal.Profile.Settings.SaveCache();
return true;
}
}
return false;
}
}
//css_reference "Utils.dll";
using MpeCore.Classes;
using MpeCore;
using System.Diagnostics;
using System;
using System.IO;
using MediaPortal.Profile;
using System.Windows.Forms;
public class Script
{
public static void Main(PackageClass packageClass, UnInstallItem actionItem)
{
string rarfilter = MpeInstaller.TransformInRealPath(@"%Base%\RARFileSource.ax");
ProcessStartInfo psi = new ProcessStartInfo();
psi.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);
psi.FileName = "cmd.exe";
psi.Arguments = "/c regsvr32 /s /u \"" + rarfilter + "\"";
psi.Verb = "runas";
psi.CreateNoWindow = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.ErrorDialog = false;
try
{
Process p = System.Diagnostics.Process.Start(psi);
p.WaitForExit(10000);
if (File.Exists(rarfilter))
File.Delete(rarfilter );
removeVideoExtension(".rar");
}
catch
{
}
}
// remove the extension
static bool removeVideoExtension(string extension)
{
using (MediaPortal.Profile.Settings xmlwriter = new MPSettings())
{
string currValue = xmlwriter.GetValue("movies", "extensions");
if(currValue.ToLower().Contains(extension))
{
if (MessageBox.Show("Would you like to remove the .rar Extension as a Video Extension?", "Remove Extension", MessageBoxButtons.YesNo)
== DialogResult.Yes)
{
xmlwriter.SetValue("movies", "extensions", currValue.Replace("," + extension, ""));
MediaPortal.Profile.Settings.SaveCache();
return true;
}
}
}
return false;
}
Yeh, thanks, I actually just upgraded to 1.3 and it was working, but then I did something and it stopped again. So I've reverted to an partition image when it was working and so far so good. I'll gradually make the changes / updates I did before and see if I can pin the problem down.
So far so good tho.