Unable to change App_Data permissions in msi instalation - asp.net-mvc-3

In the file system of setup i had given Read & Write permissions to the app_data folder. But when installed it has only Read permissions.
I'm running on VS2010 , Windows 7, IIS 7 , MVC3

Visual Studio Setup Projects don't support the underlying Windows Installer LockPermissions table. One of the many reasons this project type is removed from VS2012. Switch to a different tool or reinvent the wheel with a custom action.

Related

Visual Studio 2015 Update 3 installation failed

I have a problem with installation Visual Studio Professional 2015 Update 3. I don't know what cause the problem, but setup is failed every time in each setup configuration. Setup manager shows me following error and warning:
Microsoft Visual Studio Services Hub
The system cannot open the device or file specified
I really don't know how to solve this problem. Does anyone know what is wrong and how can I install this program?
Greetings
SOLUTION
I know what was the problem! I didn't check thoroughly the default location where Visual Studio wants to install. On my PC I have installed a 64-bit Windows 7. After many tries of installation I saw that installator chose wrong Program Files folder. It tries to install Visual Studio in Program Files (x86) (dedicated for 32-bit programs). I really don't know why VS installator chose a default folder for a 32-bit programs while my VS is a 64-bit version and also Windows is a 64-bit version.
I hope that this solution will help someone who has the same problem.
Most likely this is because of Windows Installer cannot access the %TEMP% folder (I had similar error once, but with MSSQL setup). So:
First of all check if you %TEMP% environment variable points to the
right location
Then check if the account which is running VS setup has privileges to
access TEMP folder. Better yet, make sure you run setup as
administrator
Finally make sure you have disabled all disk or folder encryption
features
Also just to be sure disable any antivirus software you have running
The error message “The system cannot open the device or file specified” often related to the specific folder is encrypted, you can have a look at this article and try the following methods:
Save the VS installer file to a folder that is not encrypted
Install the VS to a folder that is not encrypted
Turn off encryption on the %temp% folder
To check the encryption of the specific folder, you can right click the folder and select ‘Properties’— ‘General’ tab, click ‘Advanced’ button and confirm the checkbox of ‘Encrypt contents to secure data’ is checked or not.
You can click the ‘log file’ in the VS installer screen that you shared, and find the specific folders that these 2 components ‘Microsoft Visual Studio Services Hub’ and ‘Visual C++ IDE Common Package’ stores and check if those folders are encrypted or not.

Creating custom registry settings during installation of Office addins

Is there a way to inject a custom registry setting during installation of Office plugins? Using Visual Studio 2013 and regular "publish" method that generates an .MSI file
You have 2 options for installing: Click Once and Windows Installer (.msi)
Are you sure Publish is creating an .MSI, because in a previous version of Visual Studio it makes a ClickOnce installer which is totally different from an .MSI.
Start here: http://msdn.microsoft.com/en-us/library/bb386179.aspx
I don't think the ClickOnce option gives you the ability to add your own registry settings. If you go the ClickOnce route then it would probably be easiest to add the registry setting in your addin code, assuming the registry location is something like HKCU that the user would have access to. If you need to write to HKLM hive then that requires admin privileges and you shouldn't try doing that from your addin, it will need to be added in a .MSI that runs with admin rights. You can use the InstallShield LE as mentioned in the article, or you could obtain the just released addin for Visual Studio that brings back the old Setup Project (http://blogs.msdn.com/b/visualstudio/archive/2014/04/17/visual-studio-installer-projects-extension.aspx)

How to deploy database files with Visual Studio Setup Project?

I have to find a suitable location to deploy my SDF (database) file.
The file must be the same to all users
Windows applications can't write to the ProgramFiles folder.
One user can't access other user's AppData folder
A good choice would be %ProgramData%
In Visual Studio Setup Project File System view, when I right click the output folders I don't have the %ProgramData% option
How to write to that folder?
Check this out:
Specifying c:\ProgramData folder in Setup project?
Winforms Deployment
string path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
CommonApplicationData is C:\ProgramData on Windows > Vista, and something like C:\Documents and Settings\All Users on XP.
Actually this question is a duplicate. Here is the real way tell VDPROJ to deploy to that location:
Writing to AppData from a Setup & Deployment Project
But that will leave another problem: Standard Users won't have write privs to that directory. You'll either have to write a custom action to open it up or you'll have to use a better MSI authoring tool such as Windows Installer XML (open source) or InstallShield 2010LE ( free ) that has proper support for defining resource permissions.

EntityException: Access to the database file is not allowed

I am working on a Visual Sudio 2010 Setup Project to install an Entity Framework / SQL Compact app. The app needs to install an SDF file on the user's machine. As I understand the Microsoft guidance, I should install the SDF file to a company\application subfolder under C:\ProgramsData on the user's machine, which I have done in the setup project by creating a custom folder in the File System Editor with a DefaultLocation property of [CommonAppDataFolder]. All works well, and the SDF file is installed to C:\ProgramData\MyCompany\MyApp\MyFile.sdf.
Here is my problem: On the client machine, my app is throwing an EntityException with the following message: "SqlCeException: Access to the database file is not allowed." Sounds like a permissions issue.
Is there a way to set permissions on the SDF installation folders from within a VS Setup project? How would I do it? Any examples? Thanks for your help.
The answer is to create a small DLL that gets executed as a Custom Action by the Visual Studio Setup Project. There is a walkthrough on creating Custom actons here.

Installation of demo project - best practices

Using Windows Installer (targeting XP and Vista), is there a best practice for installing demo projects and files with your application?
From experience installing on Vista/XP I would recommend...
1, Install the source code/project/solution files into the 'Users' directory for Vista. That way when the user opens up the demo and compiles they have write access for generating the output files. If you put the files into the 'Program Files' directory under Vista you do not have write access and so the compile will just fail.
2, Add a shortcut to the solution to either the desktop or the start menu so that the user can then get access to it without having to know the exact location. Under Vista/XP when you install into the 'Users'/'Documents and Settings' directory it is not easy to find the installed files because they are placed inside a directory that is not shown unless you select 'Show Hidden Files' in file explorer.
3, I would recommend you sign the installer using your publisher certificate so that when the user gets a UAC dialog on Vista they can see the name of the publiser and be more likely to continue with the process.
4, At the moment the split between Visual Studio 2005/2008 is about 50%/50% and so make sure you provide both versions of the project/solutions files. Alternatively just supply the VS2005 files and let the user upgrade using the wizard in VS2008.

Resources