3
votes

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.

1
take a look at this for referenceYuliam Chandra
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
@jam Thanks for the comment! Perhaps we could offer both types.ispiro
@YuliamChandra Thanks. If we do go with clickonce that's a nice idea.ispiro
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. msdn.microsoft.com/en-us/library/efs781xb(v=vs.110).aspxPhillipH

1 Answers

1
votes

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