Update application silently while running - c#

My App will be initially deployed with Windows Installer.
The key characteristics of the solution I am looking for include:
Support silent update while app is
running (or automatically restart
client)
Easy to maintain and manage packing
process
Avoid complex customizations or
installation scripts
Do you have any ideas on how can I achieve this? Even if it means to modify the app code to support any idea.
Application is .net 2.0

Have you considered using ClickOnce for deployment? It has a facility to programatically check for updates and optionally force them to be installed - see http://msdn.microsoft.com/en-us/library/ms404263.aspx

You can silently update your application by using the Restart Manager (available in Vista and Win7).
Don't forget that a user is not alway the administrator. Since Vista if you sign your Windows Installer package you can update the application without needing administrator rights from the current user.
For all this to work you need to install your application using the Windows Installer technology. You can use Wix to create an xml file and compile it to an .msi package. Wix integrates nicely with VS.

The Proxy Design Pattern will help you achieve this while this is the pattern used for plugins.
Another short explanation is with the Gang of Four - Proxy Design Pattern.
Having an eye out the Shadow Copying of assemblies is definitely useful for the trick, as you shadow copy your updated assembly to your application assemblies folder, then you can make your application aware of changes, then unload the old assembly and load the new one for the changes to take effect, that is, without even having to restart your application, and this will be absolutely transparent for the end-user.
A more simple approach might be the ClickOnce Deployment which you might be interested to read about following the sugested link.

Related

Manually Configuring Windows Installer Settings

I have inherited a C# software application which has an auto-update component. This component works pretty well, it stops the application, updates any files which have changed, then restarts the application. The software is initially installed using an MSI file.
However what this auto-updater doesn't do is update the windows installer database with the new application version number, nor does it register any new files which didn't exist in the original installation.
Looking at the installer API (https://msdn.microsoft.com/en-us/library/aa369426(v=vs.85).aspx) there doesn't appear to be any way to modify the configuration in this way.
And from what I have read (http://blogs.msdn.com/b/windows_installer_team/archive/2006/05/12/595950.aspx) modifying the registry entries directly isn't recommended.
Somehow many applications manage to accomplish this e.g. Google Chrome.
Is there a way to accomplish this without directly modifying the registry?
If not, can someone tell me (or point me to) the exact registry entries that would need to be changed. Including how to find the guid of the product entry in the installer registry section.
Windows Installer updates can be installed with upgrade .msi packages or patches. There's no other supported way of updating MSI's internal registration.
Google doesn't use MSI to install Chrome, so they had to invent their own patching system.

Install WPF application using only .Net Framework

I have developed WPF application using VS 2013.
How do I install this application and run in some other PC without Visual Studio, using just only framework?
A good way to distribute WPF applications, is ClickOnce
You can place your application on a server, users can click on the link to install it. If you like, you can provide settings to automatically check for updates.
The application can be made to run in an offline mode, and will make an entry under the Start button as well as in Control Panel to allow uninstall.
It will run in an Isolated Storage sandbox, so this may not be appropriate for all applications, or may require some minor code changes. But, I have had many programs that just worked when turned into ClickOnce deployments.
NOTE: You may want to invest in a code signing cert to remove any warnings the end user will see. Or adjust Code Access Security of the destination machines if they are within your control.
The right answer ready depends on a few factors;
Where are your users (anywhere, corp. network)
How often do you want to update the application, should it be automatic
Will you deploy a database
As it stands this link provides some options
Deploying a WPF Application (WPF)
If you update the questions with more detail, perhaps we can provide more specific suggestions.
The easiest way - ClickOnce. To use it: Project -> Property -> Publish. Another popular option - InnoSetup (http://www.jrsoftware.org/isinfo.php).

Programmatically Installing Windows Service from Application

I currently have a windows service that needs to run in the background while a main application I have written handles UI and other tasks. I install and maintain the GUI application using ClickOnce Deployment and would like to find a way to bundle my Windows Service in as well.
They are in separate projects at the moment since I was still learning how to use the Windows Service.
My question is, is it possible given MyService.exe that I install and start MyService.exe from MyApp.exe? I can assume that I have access to InstallUtil.exe and could write a script to install and run it manually, but I would like a cleaner solution if there is one.
The only resources I've found all seem to assume I want to have the Service install itself, which is not the case.
In general, ClickOnce can't be used to install services. There is typically a lack of permissions, but also the location is incorrect, etc. For details, see MSDN on Choosing Between ClickOnce and Windows Installer for more details.
If you want to install a service, you should do a traditional installation.

Installation Tools for ASP.Net C# application

We have developed an ASP.Net/C#/SQL Server application and use SetupBuilder (from LinderSoft) and MSI for software installation purposes.
We are having all sorts trouble with the MSI component - in that installations regularly fail and we appear to have limited control over the MSI interface/process.
Are there any installation tools that give us more control over the MSI install process and can anyone recommend a better set of tools for software deployment purposes?
WIX provides a lot of control in creating MSI's.
Takes a bit of learning but we have used it for creating MSI's in our projects and it has worked for all of our needs.
From their site:
The Windows Installer XML (WiX) is a toolset that builds Windows
installation
packages from XML source code. The toolset supports a command line
environment that developers may integrate into their build processes
to build MSI and MSM setup packages
Sorry for the generic answer, but if you could provide more details regarding the errors that you are facing or exactly what areas you want to be able to control, then might be able to throw some light on it.
Most asp.net applications i've ever used have had a partly manual installation process, eg they ask you to create a sql server database and user, then copy the application in and update the web.config to reflect the sql user, then create the IIS application manually, and any further installation (eg creating the db schema) is handled automatically by the app the first time you use it.
It's always seemed acceptable to me, so long as everything is documented well i've been happy to accept it, worth considering?
I guess it depends upon the expected technical skills of your target user base...

Advanced installation regarding to C#

I want to make an advanced installer for my C# application. |I want my application continue its installation after the pre-requisites been installed.
My scenario is:
myApplication requires .net Framework 2
it redirects the user to the Microsoft website.
the user installs the framework.
the installation requires to restart the PC.
STOPPED INSTALLATION
After this step (after restarting) I want myApplication to continue the installation (go to the last stage of the installation)
Any suggestion on how I do this ?!?!
I would suggest taking a look at the nullsoft install system. Use the Modern UI theme and the DotNET macro (http://nsis.sourceforge.net/DotNET). That's everything that you are looking for prebuilt, for free, and you can be up and running with very little effort.
I've had experience releasing applications with this route and it works very well.
Things like InstallShield, or one of the other installer creation tools would be able to handle the pre-requisite side of things for you. If you want to roll your own, then you could check for the framework, perform the various steps you mentioned to install it, then add you setup application to the RunOnce registry key so it starts again on startup.
Looking at something that would handle all the pre-requisites etc for you would be my choice though :-)
Install in this order:
Install the .NET framework
Install your app.
Restart if needed.
You can create an installation project in VS2005/8 to handle installing your app and any needed dependencies.
Are you aware that your compiled c# app itself will do this? The bootstrapper compiled into a .Net exe will contain a redirect to get the framework with a working link to the microsoft website.

Categories

Resources