/// <summary> /// Unregister or Register the Groove Service, to hide or enable the context menu entry /// </summary> /// <param name="groove">RegsvGroove.Disable or RegsvGroove.Enable to determinate unregister or register job</param> private void ContextChange(RegsvGroove groove) { string grooveexPath = textBoxInstallationPath.Text + "GROOVEEX.DLL"; //if 'GROOVEEX.DLL' not exist inform user and exit if (!File.Exists(grooveexPath)) { MessageBox.Show("GROOVEEX.DLL not found in " + textBoxInstallationPath.Text, "File not found!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //run 'regsvr32' to register/unregister the groove service Process regsvProc = new Process(); regsvProc.StartInfo.FileName = "regsvr32.exe"; if (groove == RegsvGroove.Disable) { regsvProc.StartInfo.Arguments = "/u \"" + grooveexPath + "\""; } else { regsvProc.StartInfo.Arguments = "\"" + grooveexPath + "\""; } regsvProc.Start(); regsvProc.WaitForExit(); }
/// <summary> /// Unregister or Register the Groove Service, to hide or enable the context menu entry /// </summary> /// <param name="groove">RegsvGroove.Disable or RegsvGroove.Enable to determinate unregister or register job</param> private void ContextChange(RegsvGroove groove) { string grooveexPath = textBoxInstallationPath.Text + "GROOVEEX.DLL" ; //if 'GROOVEEX.DLL' not exist inform user and exit if(!File.Exists(grooveexPath)){ MessageBox.Show("GROOVEEX.DLL not found in " + textBoxInstallationPath.Text, "File not found!", MessageBoxButtons.OK, MessageBoxIcon.Error) ; return ; } //run 'regsvr32' to register/unregister the groove service Process regsvProc = new Process() ; regsvProc.StartInfo.FileName = "regsvr32.exe" ; if(groove == RegsvGroove.Disable){ regsvProc.StartInfo.Arguments = "/u \"" + grooveexPath + "\"" ; }else{ regsvProc.StartInfo.Arguments = "\"" + grooveexPath + "\"" ; } regsvProc.Start() ; regsvProc.WaitForExit() ; }