# Visual Studio 2010 Installer Project



## shuggans (Sep 11, 2011)

So, I have an installer project inside my solution file for my application.  I have a couple questions with install projects.

1.  The issue now is that I need to add a way in the setup to configure the my.settings settings my application relies on to run.  What is the best way to do this? 
2.  Does signing my code somehow keep my code safe?  Or is it just for peace of mind to end users?  How do I go about doing it?  And Do I really need to for a commercial application I plan to market?
3.  My application throws an access denied exception when accessing anything in a folder created by it's installer... how do I avoid this?

I really appreciate all your guys help with me as I try to learn .net


----------



## FordGT90Concept (Sep 11, 2011)

1. Make an application that runs post or pre to the installation.  It's in the properties page of the install windows, I think.
2. Peace of mind.  Verisign is a good place to look about that.  It depends if your users expect to see a signature on it or not. Small applications like I make and release freely aren't signed but if you're making something big and for profit, I'd sign it.  The primary advantage of signing applications is to distinguish the real deal from potential knock-offs and clones.
3. Install as administrator and/or be an Administrator on the computer.  Program Files is read-only on limited user accounts.


----------



## shuggans (Sep 11, 2011)

Thanks ford.  I also noticed that when creating directories in the app path using directory.createdirectory method with  





> application.startuppath


 or 





> System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())


 It installs it in the folder @ 





> C:\Users\<user>\AppData\Local\VirtualStore\Program Files\<CompanyName>\<Product Name>\Reports


.  I need this to create it in the actual program files directory for the program.  Any clue?  I am running this on an admin account.


----------



## shuggans (Sep 11, 2011)

I just installed my application on a clean machine and ran it as the administrator.  The problem above was fixxed.  Is there any way to keep an end user from having to always "run as administrator"? This is a server software designed to run at start up...


----------



## FordGT90Concept (Sep 11, 2011)

Make sure you're using the %ProgramFiles% path (might not be 100% correct on the syntax) in the InstallDir parameter.  Pretty sure you have to do that in the Folders view of the installer project where you can visualize where everything ends up on the target computer.


----------



## shuggans (Sep 11, 2011)

I resolved the issue.  The program always needs to be run as administrator.  

Visual Studio 2010 ( and probably Visual Studio 2008 ):Under the Application tab of the project properties, you have to click "Application Settings" to access the App.Manifest file.  Pretty close to the top you find this:


> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
> <!-- UAC Manifest Options
> If you want to change the Windows User Account Control level replace the
> requestedExecutionLevel node with one of the following.
> ...



Changing that last line to <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" /> solved my problem and created a new one.  

NOW it threw the error: 





> ClickOnce does not support the request execution level 'requireAdministrator'.


Disabling Click Once security under the security tab of the projects properties took care of this.  Now there is a prompt for elevation when the program starts.  If there is a way around this anyone knows of besides disabling UAC all together, I'd love to know.

Thanks for all your help guys.


----------

