3

What I mean is something like the installers for Visual Studio, where the installer is a very small application, which in turn downloads the actual application. What I'm trying to achieve is to have more control over installations - If we release a new version - we want all installations to be of the new version (as opposed to a regular installer which will install the same version no matter when it's used).

I know of Clickonce but that installs a program for one user only.

Is there some standard way of doing it? Is there some template for it? I'm not looking for any 3rd party software. I'm looking for a standard way of coding this or something in Visual Studio / any other Microsoft technology.

ispiro
  • 26,556
  • 38
  • 136
  • 291
  • take a look [at this](http://stackoverflow.com/questions/276916/click-once-all-users) for reference – Yuliam Chandra Jul 07 '14 at 09:56
  • 1
    I regularly need to install things onto non-networked machines, and download-only-installers are the bane of my life. Please consider also offering standard installers (or an 'install from cached files' option) if you think some of your users may need them! – jam Jul 07 '14 at 10:01
  • 1
    @jam Thanks for the comment! Perhaps we could offer both types. – ispiro Jul 07 '14 at 10:10
  • @YuliamChandra Thanks. If we do go with clickonce that's a nice idea. – ispiro Jul 07 '14 at 10:18
  • Maybe if you are using .net only, you could use the Codebase setting in the application config file to redirect the loader to pick up your latest code. http://msdn.microsoft.com/en-us/library/efs781xb(v=vs.110).aspx – PhillipH Jul 07 '14 at 21:18

1 Answers1

1

This isn't tested, but could you call msiexec? It takes a remote URL as a valid location for your msi file. I found a couple articles that may be helpful regarding this:

Says it is possible to do: http://msdn.microsoft.com/en-us/library/aa368328(v=vs.85).aspx

This answer has the C# code to do it using the windows installer COM object: Programatically installing MSI packages

Answer snippet from the question: using System; using WindowsInstaller;

namespace TestApp
{
    public class InstallerTest
    {
        public static void Install()
        {
            Type type = Type.GetTypeFromProgID("WindowsInstaller.Installer");
            Installer installer = (Installer)Activator.CreateInstance(type);
            installer.InstallProduct("YourPackage.msi");
        }
    }
}

If you need to add switches to the installer or deploy a .msp upgrade when you update your version, here is the full blown model:

http://msdn.microsoft.com/en-us/library/aa369432%28v=VS.85%29.aspx

Community
  • 1
  • 1
Bill Sambrone
  • 4,334
  • 4
  • 48
  • 70