The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

MSI not create Registry Entries

Last post 10-09-2008, 1:36 AM by mthornal. 8 replies.
Sort Posts: Previous Next
  •  09-26-2008, 1:24 PM 8426

    MSI not create Registry Entries

    Ive create an install project for my addin, which works fine, except all of the registry entries arent added so VMC recognizes my addin.  I have the registry key defined in my install project, and I've doubled check that they are find, but nothing is added.  If I run the MCE Register app my addin run fine.  So, two questions; 1) is there a trick to the registry stuff in an install project 2) is there a better way to register an addin with an installer?
  •  09-27-2008, 6:21 AM 8427 in reply to 8426

    Re: MSI not create Registry Entries

    You should always use the MCE register app to register your addin, as you can't guarantee that the current registry format will stay the same.  You can find an example of how to incorporate this into your WiX installer in the SDK, or here http://blogs.msdn.com/astebner/archive/2007/07/25/4049553.aspx

    Cheers,
    Andrew

  •  10-06-2008, 1:18 PM 8446 in reply to 8427

    Re: MSI not create Registry Entries

    So I have my msi registering the addin fine when being installed.  I want to unregister when the user uninstalls the addin.  I'm using the following code but it doesnt work, I'm assuming there is something wrong with the argument string...

     

    Process.Start("c:\Windows\ehome\RegisterMCEApp.exe", "/U ""c:\Program Files\...addin path\App.xml""

     

    any ideas? 

  •  10-06-2008, 1:24 PM 8447 in reply to 8446

    Re: MSI not create Registry Entries

    Did you use the /allusers switch when installing? If so, you need the use the /allusers switch also when uninstalling your application - otherwise uninstalling routine will fail.
  •  10-06-2008, 1:35 PM 8449 in reply to 8447

    Re: MSI not create Registry Entries

    no I didn't use the /allusers switch.  does the argument string look correct?
  •  10-06-2008, 2:14 PM 8450 in reply to 8449

    Re: MSI not create Registry Entries

    Try this:

    string fileName = Environment.GetEnvironmentVariable("windir") + @"\ehome\RegisterMCEApp.exe";
    string args = @"/u ""c:\Program Files\...addin path\App.xml""";
    Process.Start(fileName, args);

    I guess, ""c:\Program Files\...addin path\App.xml"" does exist - maybe you should check if the file exists or if you may have used different XML files.

  •  10-06-2008, 11:17 PM 8457 in reply to 8446

    Re: MSI not create Registry Entries

    mjp14:
    So I have my msi registering the addin fine when being installed.  I want to unregister when the user uninstalls the addin.  I'm using the following code but it doesnt work, I'm assuming there is something wrong with the argument string...

    Process.Start("c:\Windows\ehome\RegisterMCEApp.exe", "/U ""c:\Program Files\...addin path\App.xml""

    any ideas? 

    You can unregister your add-in through the Windows Installer - have a look at Aaron's example, it registers the add-in on install, and unregisters it on uninstall.  If you're not using WiX for your installer, I'd strongly recommend you do - it makes life a lot easier than running "setup helper" DLLs under the Visual Studio MSI builder.

    Cheers,
    Andrew

  •  10-08-2008, 1:54 PM 8473 in reply to 8457

    Re: MSI not create Registry Entries

    Im trying to unregister the addin on the installer 'Installer_BeforeUninstall' event.  It fires, but the addin still remains in VMC.  If I run a batch file with the exact same code before the uninstaller it works fine.  My guess is that the files the uninstaller needs (ie.  the app.xml) have been remove by the time the Installer_BeforeUninstall event is fired.  which doesn't make sense to me... I looked at the WIXS installer briefly, it just seems convoluted for what I need.  The a default MSI project is VS is so easy...
  •  10-09-2008, 1:36 AM 8474 in reply to 8473

    Re: MSI not create Registry Entries

    Just seconding Andrew's comments about using WiX for your Media Center add-in installers.  It really is the easiest way to build them. The WiX XML is well commented and there's plenty of experience in these forums if you're having trouble with it.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems