Coffeehouse Thread

23 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Windows Installer .Net?

Back to Forum: Coffeehouse
  • User profile image
    Minh

    I'd like my .Net assembly to be able to install itself into the "Add/Remove Programs" section of the Control Panel... without going through the MSI / creating a Setup project.

    Does anyone know if Windows Installer is exposed via a .Net class?

    TIA.

  • User profile image
    Sven Groot

    I don't understand. You want to be able to create an installation without creating an installation? Isn't that a contradiction?

  • User profile image
    Massif

    Why do you want to avoid the MSI route? It's not exactly a huge overhead. (aside from the way it adds exes to install the installer if it's not present... which makes every install look huge... but can be avoided by just using the MSI.)

  • User profile image
    Minh

    I saw uTorrent do this and it was so simple:

    1) There's a single file .EXE

    2) User launches the .EXE

    3) The app senses that it hasn't been "properly" installed, and offers the user to:

    a) Install itself into C:\Program Files, Add/Remove Programs, Start menu... or...

    b) Left where it is and just run

    I like this approach because you can have the cake & eat it, too. It passes the XCOPY deployment criteria for advanced user, and "proper" installation for the rest.

    I've been poking around, it it seems that some people are doing interop w/ the Windows Installer Win32 API...

    We'll see what turns up...

    Sven wrote:

    I don't understand. You want to be able to create an installation without creating an installation? Isn't that a contradiction?

    I don't know if it's a contradiction, I just want it Smiley

    Massif wrote:

    Why do you want to avoid the MSI route?
    I want the XCOPY aspect of it. And to deploy the MSI, you'd need admin priv... which I would assume the same if I were to talk to the installer API, but at least, I can shut down that alternative if I don't have the priv.

  • User profile image
    Sven Groot

    You can easily make an MSI that can be installed by limited users (as long as they install to a location that they can write to, e.g. their user folder).

  • User profile image
    Massif

    Sounds interesting, but also sounds like a poor risk / reward payback.

    I'll stick to tried and true thanks, or I'll go through clickonce. The only problem I ever had with MSI was caused by over-jealous roaming profiles deleting all the cached MSIs whenever a user logged off. Which meant that every time a use ran the app it detected that the install was borked and re-installed.

    Sigh...

    [edit:] Can't a standard user install an app via MSI without requiring admin privileges? (so long as they avoid installing to somewhere which requires admin privileges to install to.) It's been a while since I wasn't running as admin, so can't remember the specifics.

  • User profile image
    Rossj

    I take it by everyone telling Minh that he shouldn't do it, that nobody knows the answer.

    I quite like the way uTorrent installs, nice and simple and clean and very little interaction required.

  • User profile image
    AndyC

    Rossj wrote:

    I quite like the way uTorrent installs, nice and simple and clean and very little interaction required.


    I've seen a few installer/applications try to do this. It's a really, really, broken practice. It annoys sysadmins no end. Don't do it.

  • User profile image
    Sven Groot

    Rossj wrote:
    I take it by everyone telling Minh that he shouldn't do it, that nobody knows the answer.

    Well, there's more than one way to get into the Add/Remove programs list, MSI is not the only one. I would venture a guess that uTorrent isn't using MSI or any part of Windows Installer.

    All it takes is a registry entry. What uTorrent probably does is copy the files manually and then makes that registry entry.

    Some information about the registry entry you need is at the bottom of this article.

  • User profile image
    Minh

    Massif wrote:
    I'll stick to tried and true thanks, or I'll go through clickonce.

    ClickOnce isn't without it problems as Sven can attest to.

    Sven wrote:

    You can easily make an MSI that can be installed by limited users (as long as they install to a location that they can write to, e.g. their user folder).
    Installing to User? That just smell all kind of wrong... But I guess that's what I'm trying to do...


    But as I'm thinking more about this issue, XCOPY deployment & self-updating is definitely more important to me than self-installation, but it'd be nice.

  • User profile image
    littleguru

    What's the deal? Check if the app has been started before. If not copy yourself into the program files folder and create the registry keys that sven provided in the article he linked to. That's it. No big deal... or am I completely on the wrong horse now?

  • User profile image
    AndyC

    littleguru wrote:
    What's the deal? Check if the app has been started before. If not copy yourself into the program files folder and create the registry keys that sven proposed. That's it. No big deal... or am I completely on the wrong horse now?


    That breaks.

    Especially under Vista.

    Or, god forbid, if somebody actually wants to install it somewhere else.


    Windows Installer, whilst admittedly not perfect, is a much better solution than a home-baked installer.

  • User profile image
    littleguru

    AndyC wrote:
    
    littleguru wrote:
    What's the deal? Check if the app has been started before. If not copy yourself into the program files folder and create the registry keys that sven proposed. That's it. No big deal... or am I completely on the wrong horse now?


    That breaks.

    Especially under Vista.

    Or, god forbid, if somebody actually wants to install it somewhere else.


    Windows Installer, whilst admittedly not perfect, is a much better solution than a home-baked installer.


    Well uTorrent also starts itself as admin, when you do updates...

  • User profile image
    AndyC

    littleguru wrote:
    
    Well uTorrent also starts itself as admin, when you do updates...


    And if your not admin?

    Or you don't want to update?

    Or you want to update 10,000 computers without having to go round running the app on every single one of them as admin?


    It's just broken thinking.

  • User profile image
    littleguru

    Although - when I think about it twice - I have never been a fan of having the app install itself... I was always in favour for another external app that did it for the app. Like encapsulation and separation of tasks etc.

  • User profile image
    littleguru

    AndyC wrote:
    
    littleguru wrote:
    
    Well uTorrent also starts itself as admin, when you do updates...


    And if your not admin?

    Or you don't want to update?

    Or you want to update 10,000 computers without having to go round running the app on every single one of them as admin?


    It's just broken thinking.


    It asks you about if to perform the update and the UAC prompts up etc. How would you install into Program Files via MSI when you don't have admin rights? You aren't - the same as with uTorrents own updater thing.

  • User profile image
    Rossj

    AndyC wrote:
    
    I've seen a few installer/applications try to do this. It's a really, really, broken practice. It annoys sysadmins no end. Don't do it.


    With all due respect Andy, there is more to the world that Corporations and their IT teams.  I know this is probably a PITA for you - but why should someone at home not do this?

  • User profile image
    Minh

    littleguru wrote:
    ... create the registry keys that sven provided in the article he linked to.

    When you do an Add/Remove Program --> Remove ... how would that work if you go the Registry route?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.