Publishing windows application without delete file - visual-studio-2013

In my windows application, there's a file (option.xml) created by my application on the user's computer. It's created run-time with option selected by the user.
This file is in the bin directory.
When I make a new release, the installation (that I make publishing to a shared directory with visual studio wizard) delete this configuration file, so the user have to save the option again.
How can I publish a new release without delete this file?
I'm using visual studio 2013
I hope that the issue is clear.
thanks

Related

How to make Visual Studio Installer remove file during installation?

I already had trouble finding out where appSettings get stored when the app is installed in program files directory.
Now the next thing is finding out how to make the app installer update that location too. Because obviously, Microsoft Windows doesn't do it.
When the app is installed in program files and you try to update its settings file the setting file actually got saved to another location: C:\Users\user\AppData\Local\VirtualStore\Program Files (x86)\company\app
How to make Visual Studio Installer remove this file during installation?

Visual Studio 2013 Installer Project can't save .vdproj file

I just downloaded and installed the Installer Projects extension for VS 2013 and tried to make a new .vdproj project. I created new "Hello World" console application project, then added a new Visual Studio Installer project to the solution, added the output of the console project to it, and tried to build it. Visual Studio opened a file save dialog and prompted me to save my .vdproj file. When I clicked "Save", it complained that it could not find the file that it was prompting me to save.
Why can't I create this simple .vdproj project? VS had no problem with saving the console application project files to this location.
I don't know why, but if you go to the folder and manually create an empty file of the same name as your project, when you try to save, it will respond, "File exists, Overwrite?" and when you select [Yes], it creates the project without a problem.
This seems to be a permissions issue. If I run Visual Studio "as Administrator" it works.

Install files to each users Application Data Folder using Visual Studio Setup project

I have created a visual studio setup project that writes content files to User's Application Data Folder
C:\users\user\AppData\Roaming\CompanyName
I did this By adding User's Application Data Folder in File System on Target Machine link from setup project and adding content files to that folder.
When I install this setup it installs only for one user(active). I want this to install content files to all users AppData folders
Example folder locations:
1.C:\users\user1\AppData\Roaming\CompanyName
2.C:\users\user2\AppData\Roaming\CompanyName
How to install these content files to each and every user's AppData folder on the machine using Visual Studio Setup project.
Any help is greatly appreciated.
The short answer is that you can't. There's no way of enumerating all those folders and installing files to them, and that won't work anyway if a user account gets created after your setup has been installed.
The good news is that it should just work. Assuming your installed app has a shortcut to the program, and the setup was installed for Everyone, log on as another user and use the shortcut. What should happen is that Windows will notice that the user doesn't have the files and it will ask for the original MSI file to install them. This works even if the user account wasn't present at the time of the install, and will happen just once per new user of the app to install the files.

visual studio setup project updating at same location?

How can I ensure that the msi installer (created using visual studio installer project) installs the application at the same location where its previous version was installed ?
So for example the scenario is this.
User install the app using myapp-v1.msi installer at c:\program files\myapp
Now I fix a bug and create a new version of installer myapp-v2.msi
When the user installs myapp-v2.msi it should install at c:\program files\myapp (perhaps not giving the location choice to user)
I want to do that because I have data files present in the previous location and I want that new files go in the same location so that it picks up data files from it's current directory.
Thanks,
That should be done automatically, as default behavior in MSI packages. Have you tested it?
However, you should know that keeping data files next to the installed files is not recommended, nor standard practice. If these data files should be available to all users you should store them in CommonAppDataFolder.

Visual Studio Setup project should not delete file during uninstall

I created Visual Studio 2005 Setup project for my application. Windows Installer during installation put one xml file into AppData/myCustomFolder. I used File System Editor and added special folder - user's app data folder, then included that xml there.
When I uninstall application from Control Panel folder from Program Files is deleted, but also my xml file from AppData is deleted too. I need to leave this xml file in the AppData always, even when user re-install application.
How I could do it?
Set the Permanent property to True
Permanent Property

Resources