What is the best way to deploy a VB.NET application? - vb.net

Generally when I use ClickOnce when I build a VB.NET program but it has a few downsides. I've never really used anything else, so I'm not sure
what my options are.
Downsides to ClickOnce:
Consists of multiple files - Seems easier to distribute one file than manageing a bunch of file and the downloader to download those files.
You have to build it again for CD installations (for when the end user dosn't have internet)
Program does not end up in Program Files - It ends up hidden away in some application catch folder, making it much harder to shortcut to.
Pros to ClickOnce:
It works. Magically. And it's built
into VisualStudio 2008 express.
Makes it easy to upgrade the
application.
Does Windows Installer do these things as well? I know it dosen't have any of the ClickOnce cons, but It would be nice to know if it also has the ClickOnce pros.
Update:
I ended up using Wix 2 (Wix 3 was available but at the time I did the project, no one had a competent tutorial). It was nice because it supported the three things I (eventually) needed. An optional start-up-with-windows shortcut, a start-up-when-the-installer-is-done option, and three paragraphs of text that my boss thinks will keep uses from clicking the wrong option.

Have you seen WiX yet?
http://wix.sourceforge.net/
It builds windows installers using an XML file and has additional libraries to use if you want to fancify your installers and the like. I'll admit the learning curve for me was medium-high in getting things started, but afterwards I was able to build a second installer without any hassles.
It will handle updates and other items if you so desire, and you can apply folder permissions and the like to the installers. It also gives you greater control on where exactly you want to install files and is compatible with all the standardized Windows folder conventions, so you can specify "PROGRAM_DATA" or something to that effect and the installer knows to put it in C:\Documents and Settings\All Users\Application Data or C:\ProgramData depending on if you're running XP or Vista.
The rumor is that Office 2007 and Visual Studio 2008 used WiX to create their installer, but I haven't been able to verify that anywhere. I do believe is is developed by some Microsoft folks on the inside.

I agree with Joseph, my experience with ClickOnce is its great for the vast majority of projects especially in a corporate environment where it makes build, publish and deployment easy. Implementing the "forced upgrade" to ensure users have the latest version when running is so much easier in ClickOnce, and a main reason for my usage of it.
Issues with ClickOnce: In a corporate environment it has issues with proxy servers and the workarounds are less than ideal. I've had to deploy a few apps in those cases from UNC paths...but you can't do that all the time. Its "sandbox" is great, until you want to find the executable or create a desktop shortcut.
Have not deployed out of 2008 yet so not sure if those issues still exist.

Creating an installer project, with a dependency on your EXE (which in turn depends on whatever it needs) is a fairly straightforward process - but you'll need at least VS Standard Edition for that.
Inside the installer project, you can create custom tasks and dialog steps that allow you to do anything you code up.
What's missing is the auto-upgrade and version-checking magic you get with ClickOnce. You can still build it in, it's just not automatic.

I don't believe there is any easy way to make a Windows Installer project have the ease or upgradability of ClickOnce. I use ClickOnce for all the internal .NET apps I develop (with the exception of Console Apps). I find that in an enterprise environment, the ease of deployment outweighs the lack of flexibility.

ClickOnce can be problematic if you have 3rd party components that need to be installed along with your product. You can skirt this to some extent by creating installers for the components however with ClickOnce deployment you have to create the logic to update said component installers.
I've in a previous life used Wise For Windows Installer to create installation packages. While creating upgrades with it were not automatic like ClickOnce is, they were more precise and less headache filled when it came to other components that needed to be registered/added.

Related

Application works without installation

I created a program in vb.net in vb language. After that I created an installer (.msi) for the same in Advanced Installer program. I installed it on the computer and everything seems professional.
I copied the folder that contains the program and all its dependees and sent to to a different computer. I was surprised that the application (.exe) file works without installation!!
How can I make my application works only with installation?
Appreciate the help.
Advanced Installer has a licensing module that works for VB.NET apps too, which you can easily integrate into your installer.
However, this is in the Enterprise edition, and I assume you are using the free edition, as this sounds like quite a simple application/installer.
In this case you can try looking for an alternative OSS solution for a licensing/trial library.
Basically with this library every user that needs to use the software will need a key to activate it, so even if they copy the folder with the application files from Programs Folder, they will still not be able to run your app.

WiX - how to modularise by features?

I want to make a MSI installation using WiX and EmbeddedGUI. I really want to make it highly modular - ie the main MSI will contain only the basic files (the required ones), and all other features will be split into separate MSI files, which will be downloaded from internet if not present on hard drive and installed only if selected in my EmbeddedGUI.
But I am totally new to WiX, and I can't find a way to actually how to make that modules? MS Office and MS Visual Studio seems to be using this scheme, by using the modules which it downloads over internet and installs them in case of need - something like this:
It seems that Fragments is mostly like "static libraries", not "dynamic libraries" which would be more useful in such a situation. There is also the Chaining mechanism, but I'm not sure I will be able to bundle the features as the same application (only one entry in "Install/Delete" window) because it seems to be calling external MSIs completely separately (more like invoking "separate exes" instead of loading "dynamic libraries").
So, what is the way to go for making a highly modular setup package with WiX?
Use a bundle (chain). The Burn engine, which manages bundles, will show only the bundle in Add/Remove Programs and can download any packages that aren't already present -- for example, using the MsiPackage/#DownloadURL attribute.

How to deliver only changes through .Net setup or patch technique

we have our business apps and size is 64 MB. every time add new functionality or change existing one then we rebuild our setup and deliver to client. so this means every time we are delivering 64 MB or more than that to our client.
we have our main win form project and also there many other class library project in our project solution. i am looking for easy way out to deliver only changes to our client.
may be changes could be there in our win form project or could be there in any class library.
so wherever changes made i just only deliver changes through setup and i want just client would install that setup or run any exe file and could see the changes we made in code.
i create setup with VS2005 setup creation option. how suggest me the best option for creating patch like apps which any client just install and get the changes in his apps. give me the best idea to implement in detail. thanks
When using Wix to generate an installer for your project, you can use it to also generate a patch file which will update only changed files.
Visual Studio 2005 setup projects don't really support Patch building and such. It's meant as a rudimentary solution for building installers. Wix, however, is what Microsoft uses internally to build the setup experience for Visual Studio 2012 and other products. There is a very extensive walk-through available here.
Wix does come with a steep learning curve. Would you have been using Visual Studio 2010 or 2012, then you could take advantage of a couple of templates that make it much easier to build a setup for a given type of application. I don't believe these will work with Visual Studio 2005.
This book might also guide you.

Windows Service - Creating an installer Visual studio 2012 How?

I'm developing a Windows service in VS2012 and the setup/deployment part has been removed. So I'm not able to create a setup project. I would like to hear what you guys could recommend for a good easy to use the installer. I need to take some inputs, only strings, under the installation of the service. I've been looking at WiX but that seems a bit complex, and I only got 1 or 2 days to make this installer.
So what installer should I use other than Wix?
I've had really bad experiences with InstallShield LE (the one that comes with Visual Studio 2012), especially for Windows Services. The features that you need to install a service (custom actions, etc), don't come with the light version.
What I'm planning to do for the current Windows service I'm working on is to build it with Topshelf, which (amongst other things) means installing your service is as simple as running MyServiceApp.exe install. I'm sure even InstallShield will let you run your app once it's installed, and then your app/Topshelf can install the service component.
If InstallShield doesn't work for you, I've had good results before with NSIS. Simple, powerful, free, decent documentation. It looks a bit clunky.
Here is a list of setup tools which can get you started:
http://en.wikipedia.org/wiki/List_of_installation_software
If you don't have a lot of time for creating the installer, I recommend using a commercial tool like Advanced Installer or InstallShield. You need a license, but they are focused on usability (do more in less time).
You can do it with InstallShield LE... You can add custom actions "After Register Product" for install and for "After System Changes". These custom actions can run an EXE on the machine.
Make sure you run the command line tools "in system context"
After Register Product run the version of InstallUtil to your version of .NET
eg.
path=C:\Windows\Microsoft.NET\Framework\v4.0.30319
command=InstallUtil.exe "C:\Program Files (x86)\XXX\YYY\ZZZ.exe"
replacing XXX YYY and ZZZ to match your install
After System Changes to delete your service name run
e.g.
sc delete "servicename"
Note you need support for the custom actions within your own service executable (you needed this in earlier VS too).
You can find more information about SC here:
http://support.microsoft.com/kb/251192
To add an installer for a service, you just need to right-click on the designer for the service and click "Add Installer".
Here's the walkthrough:
http://msdn.microsoft.com/en-us/library/zt39148a.aspx

another way to publish besides clickonce?

does vb.net have a different way to build an application without using clickonce?
If your application doesn't need an installer then you don't need to use ClickOnce at all. Just do a build in Visual Studio to produce your exe and off you go. There are actually quite a few single-file applications on the internet that are done this way.
If you do need a proper installer, I still wouldn't normally suggest ClickOnce. ClickOnce was designed to allow a user to literally click a button in a web browser just "once" to install your product into a secure-but-limited sandbox. The sandbox where the application lives will then have limited permissions to the file system and such. It's pretty cool in theory. But in practice the limitations involved can become a pain for any but the most basic of applications.
For a powerful installer system for Windows, I'd suggest NSIS. It's free, open source, and scriptable. I've used it to build the installer for a couple of VB.NET software applications. One of them has been downloaded & installed by thousands of users. I'm also the main point of contact for technical support and I haven't heard a single report of a problem with the installer itself.
I could go on and on, but suffice it to say that I've tried others such as InstallShield and Wise and even ClickOnce (that was short-lived). But nothing could compare to the speed, power, reliability, and lightweight-edness of NSIS.
Command line:
vbc /out:MyProg.exe MyFile.vb