what is the difference between publish project and setup project - c#

I have a project in c# VS2010 and I want to make .exe file and make a setup.Here I will make it with add setup and deployment project. But I have one more option of publish project.
I don't know
what is the meaning when I create the .exe with Publish project.
What is better and why & where I can use Publish project.

When To Use Click Once Deployment:
ClickOnce is a new deployment technology that Microsoft developed to
address several problems with deployment namely
Difficulty in providing regular updates The inability of
nonadministrative users to install applications
The dependence of multiple programs on shared components
Installation folder will be isolated storage
ClickOnce deals with
all of these problems and allows you to create a deployment strategy
that is easily updateable, isolated from other applications, and
installable by nonadministrative users.
When to use the Setup Project:
Although ClickOnce provides simple and easy deployment for a variety of applications, you
might need a more configurable environment for complex programs. Setup projects allow you to create highly confi gurable deployment plans.
Allows you to create the directories on the target computers
Windows Service installation
Registry Modifications during installation
Execute Custom Actions during installation
Copy files to target machine
Hope It Helps :)

I guess what you're talking about is ClickOnce technology. ClickOnce allows you to publish the application and all accompanying files to a location (for example a network share or a web site) and users can just install it by navigating there. You can even publish your application to a shared hosting provider and people can just install your application.
The application will then be installed in the user's profile.
The advantage of this is: You can publish updates easily if you configure your application to automatically check for updates - just publish the new version to the previous location. Every user will get the update upon the next start of the application. Users don't need admin rights to install your tool!
The drawback is: Every user (even on the same machine) will need to install the application in his own profile. There's no common installation for all users.
The advantage of creating setup projects is of course that you follow the traditional approach of installing an application on the system, making it available for all users. The drawback is that installing updates is far more difficult, and users need admin rights to install it!

Related

attempt to write a read-only database sqlite Wpf inno setup [duplicate]

I am developing desktop database application. Using rdlc report and reportviewer. Everything was fine in developing process, reportviewer was showing all data smoothly. I deploy app with Inno Setup. But when I install the app, the reportviewer is not showing data. While data is correctly inserted in the tables.
For applications that work incorrectly or fail completely, when installed by Inno Setup to Program Files folder, the first thing to test, is to try to deploy the application manually to the same folder.
If the application fails even after a manual deployment, the most usual problem is that the application requires a user to have write permissions to application folder. As on modern versions of Windows a user typically does not have write permissions to the Program Files folder, the application does not work. So the problem usually has nothing to do with Inno Setup, but it's a problem of the application itself.
To solve the problem:
The best solution is to redesign the application so that it does not require write permissions to its folder. Windows applications should not require write permissions to their folder. That's against Windows guidelines. The application should write data to a user profile folder (C:\Users\username\AppData) or to a common data folder (C:\ProgramData).
A dirty workaround is have the installer grant a user(s) write permissions to the installation folder. Do that only, if you cannot get the application fixed (e.g. it's 3rd party application).
See Inno Setup - How to set permissions of installation folder.
Even more gross workaround is to configure the application to be executed with elevated (Administrator) privileges.
See Inno Setup desktop shortcut (link) which has "Run as administrator" advanced property set
or How to set 'Run as administrator' on a file using Inno Setup.
Another solution is enabling legacy compatibility mode that makes Windows redirect all application write attempts to a virtual store. See also Application installed with Inno Setup writes files to unknown location instead of its installation folder.
There are numerous other possible reasons, why the application might be failing when installed, including:
You omitted some dependency:
DLL library
.NET assembly
.NET Framework
Java Runtime Environment
other runtime
COM/ActiveX object, etc.
The application requires some configuration:
a file
a registry key [including COM/ActiveX object registration]
an environment variable, etc.
The application is not designed to be executed from a folder that has a space in its name (Program Files).
The application gets confused by Windows File virtualization (though it's unlikely). See Application installed with Inno Setup writes files to unknown location instead of its installation folder.

Automatic windows app installation without admin rights

We have a business application which requires to use windows API libraries such as user32.dll etc. to take screenshots of the user desktop. This is currently built using C#.NET / VB.NET.
The business requirement now is to find a way to be able to execute/deploy the application to user machines with least user intervention. Additionally, the user might not have admin rights on his machine.
Please share any suggestions on the options. It would have been great to move the windows application into a web application, but I can only think of options such as ActiveX or Silverlight which might be able to user low level APIs, but these are already being discontinued.
ideal would have been some approach, where the user visits a website, maybe cliska button to install, and that website installs this windows application on the user machine.
The target environment is Windows 8. So I believe we may can assume that the .net framework would be existing already, BUT we do not know if in future perhaps the application in future might require any external referenced dll which might need to be pushed to the user machine.
If you use the standard clickonce application deployment that comes with Visual Studio, you can deploy the website to a website, and users can install form the webpage, installing any prerequisites for the program.
In addition, it installs to a user's appdata, so no admin rights are required. The only time admin rights are needed is when you install/update the .Net framework.
For bonus points, the clickonce deployment will automatically update the application on the client's PC when you publish new updates.

Project Deployment

I have developed a C# windows form application.
How should i create an .exe file in Visual Studio 2008 so that it can be installed in other machines?
A Simple "Setup and Deployment" project would work for most cases. WiX if you want to learn a powerful installer, or any of the other OSS installers out there. You could even zip up your release dir if that is all you needed and didn't want the app in the start menu or any such thing. Your question is somewhat vague.
I suggest you take a look at ClickOnce deployment. There's a video here: http://windowsclient.net/learn/video.aspx?v=14105
If you just want the .exe file, it is located in the bin\debug or bin\release folder of your project's directory depending on the current configuration setting.
My advice would be to use ClickOnce technology to deploy your application. There are details in this previous question. But here is an excerpt:
Directly from the words of MS, ClickOnce overcomes three issues in deployment:
Difficulties in updating
applications. With Microsoft Windows
Installer deployment, whenever an
application is updated, the user must
reinstall the entire application;
with ClickOnce deployment, you can
provide updates automatically. Only
those portions of the application
that have changed are downloaded,
then the full, updated application is
reinstalled from a new side-by-side
folder.
Impact to the user's computer. With
Windows Installer deployment,
applications often rely on shared
components, with the potential for
versioning conflicts; with ClickOnce
deployment, each application is
self-contained and cannot interfere
with other applications.
Security permissions. Windows
Installer deployment requires
administrative permissions and allows
only limited user installation;
ClickOnce deployment allows
non-administrative users to install
and grants only those Code Access
Security permissions necessary for
the application.

Need suggestion for how to manage the web application

I have developed a web application also that has been deployed in many client area.
I have created a installer to install this application at client area for first time.
If i done any bug fix or add any new functionality to this site, should i create new installer for site? or How to update the existing site without creating new installer with latest bug fix?
Or, Is there any other option to update existing application?
Or, we can create a installer only install the latest updates?
Please guide me
You can start your journey using the built in web installer (part of Visual Studio).
Important thing is it will only install to a Virtual Directory of an existing web site.
If virtual directories are fine, you then need to worry about bug fixing and updates.
here is a solution...
If you are at the client or have easy access to the web sites via FTP.
You can map drives on your development / test environment to the production FTP sites, then just create a batch to copy stuff over.... best part is - if you're hosting on IIS, if you make any changes to the web.config or any assembly in \Bin you'll trigger an IIS Reset, so this means you shouldn't need to have remote access to their servers.
Make sure that batch updates all web applications in the farm.
You can also fully rely on the application installer - IF YOU'VE FULLY TESTED THAT IT DOES INFACT UPDATE YOUR FILES, LIKE IT SAYS IT SHOULD. Don't just assume it will, test that installer, and retest it... because I have had lots of problems with upgrading a web site, and you can't expect your client to uninstall, reinstall every time.
I wouldn't worry about creating a "patch installer" Web apps are relatively small anyways - and copying unchanged files won't make a huge differance.
Just be sure when you create the installer, you add project outputs to the installer file... and work with project outputs, rather than having to copy stuff in manually to the installer every time you make a change.
Hope this is at least a good starting point.

How can I deploy my C# project?

How can I deploy a C# Visual Studio 2005 project so that I can run the application in another system? My project has a few dependencies and files that have to be integrated while deploying the project.
What is the best way to handle this?
You need to know what dependencies you have.
you need to have .Net framework installed
you have to explicitly install all dependencies that you used from the GAC on your target machine (some 3rd party components)
and then you just need to copy files from your \bin\Release folder
install all services, etc. if you have any
In the simplest cases only copying files should be enough.
Have you looked into ClickOnce deployment?
It's far from perfect, but for projects without a huge amount of overhead, it's generally good enough.
What kind of project?
Assuming it's a regular winforms application, just copy everything from either the obj\debug or obj\release directory to the new computer. Then run your executable
You can right click on the project file in visual studio and publish to a different location. This will build the site and copy it to the specified directory.
Also, if you need to do anything extra during the build, you can specify custom build actions on the build tab of the project's properties.
EDIT: now that I see you added that it's a windows application my answer doesn't matter. I'd try adding a setup and deployment project in visual studio to handle installing/deploying your windows application.
You more or less have three options (maybe 4?) as I see it.
Windows Installer
ClickOnce
Just distribute
the exe itself
In your particular case I would suggest ClickOnce as long as the project is not massive with too many dependencies.
For other alternatives.
The right answer depends on many criteria.
The simplest way to deploy is by copying files. Just put your .exe, the dependent .dll's, and the .config file in a directory and copy it onto the target machine. It's simple, but there are many restrictions to this approach:
It assumes that the target machine has the right version of the .NET framework installed
It assumes a certain technical competence on the part of the person installing the software.
The installation won't do basic things like create start menu items.
Publishing the program for ClickOnce deployment addresses a lot of these issues, but it's got its own set of limitations. I haven't used it much, so there are probably more than these, though these alone are pretty significant:
Programs are installed into the ClickOnce cache, not the Program Files directory.
If your program does anything outside of the ClickOnce sandbox, you have to deal with security elevation and code signing.
You can create a VS Setup and Deployment project and build an .msi file to install the program. The most obvious drawback to this is that it's complicated: .msi files can do many, many things, and the Setup and Deployment object model is complex, with documentation that is, let us say, fanciful. But there are things you can do with .msi installation that you can't readily do with other approaches, including (and certainly not limited to):
Cleanly uninstall the program through Add/Remove Programs.
Provide an actual UI for installation that lets the user decide where to put the program.
Support scripted installation via MSIEXEC.
Install components besides the program, e.g. databases, COM objects, etc.
Put components in the target machine's GAC.

Categories