Read only installation directory on Windows 7 - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

darrenlink
Posts: 2
Joined: Mon Jan 11, 2010 2:12 pm

Read only installation directory on Windows 7

Hi,

I have created an installation msi for my application using Advanced Installer version 7.3.1. Unfortunately I am having difficulties under Windows 7.

After my application has installed to C:\Program Files\Darren Link\ApplicationName my application gets an access denied error when the executable file tries to write a configuration file to this directory. The defult configuration files are created on first run, rather than being distributed with my application. My application is written in C# 2008 Express Edition. Once installed I need to change the permissions of directory C:\Program Files\Darren Link\ApplicationName so that "Users (Darren-PC\Users)" has full control. Only once this has been done can the the application create and update the configuration files. Obviosuly this is not satisfactory for the end user as they shouldn't need to make changes to directory permissions in order to get my application to run without reporting access denied errors.

Under Windows XP the application installs and is able to write the default configuration files without needing to change any of the access permissions. Under Windows 7 if I install my app to C:\ApplicationName everything works as expected. It is only a problem when installed under C:\Program Files

Is this a bug with Advanced Installer version 7.3.1 under Windows 7? If so, is a fix due soon? If I need to make changes to my Advanced Installer Project please can you give details so that I can fix my install msi for Windows 7 users?

I have excluded my configuration files from the generated msi file so that when the application is uninstalled it leaves the configuration files on the PC. The configuration files need to be retained so that when a later version of the application is installed it picks up the configuration files created by the previous version. This works fine if the user uninstalls my application via control panel before installing the new version. If however the application is left installed and a new version of the installer is ran, choosing to remove the application also removes the configuration files. Is there a reason for this inconsistency? Is there any way to ensure that the configuration files are always retained after uninstalling, no matter what the method?

Thanks and regards

Darren
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Read only installation directory on Windows 7

Hi Darren,
Is this a bug with Advanced Installer version 7.3.1 under Windows 7? If so, is a fix due soon? If I need to make changes to my Advanced Installer Project please can you give details so that I can fix my install msi for Windows 7 users?
This is not a bug in Advanced Installer is just the normal behavior of Windows 7. The Program Files folder is protected by the administrator that is why your application fails to write (modify) the configuration files.

You can easily set permissions for that folder using the Permissions tab from Advanced Installer. Please use this article in order to set the correct permissions for the folders.
Is there any way to ensure that the configuration files are always retained after uninstalling, no matter what the method?
Here is what you can try:
-- go to Files and Folders page and right click the file
-- from the context menu select "Go to Component"
-- now, when you are in the Organization page, on the corespondent component set its "Permanent" flag

This will make the file never to be uninstalled just as desired.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
darrenlink
Posts: 2
Joined: Mon Jan 11, 2010 2:12 pm

Re: Read only installation directory on Windows 7

Hi,

I am only using the freeware version of Advanced Installer using a 'Simple' project and it doesn't look like the Permission feature is available in this version.

My appliction is non-commercial and is being distributed to a very small user base (approximately 5 users at present) for free. It is being developed outside work in my spare time and is a totally free, non profit-making application that I am developing for fun, not financial gain. Unfortunately it therefore does not warrant a purchase of a professional license. My app consists of 1 exe, 3 dlls and the 2 xml config files that it creates on first run.

As this problem is only an issue on Windows 7 whilst installing to the Program Files directory is there a work around? The installer works fine when installing to Program Files on XP so it would be great if it could work under Windows 7 also. On Windows 7 installing to a non Program Files directory also works fine.

If there is no work around I may have to advise users using Windows 7 not to install to the Program Files directory. I may also investigate a programmatic solution to this problem. Perhaps my application when ran can change the permission of the directory that is running from so that it can create the configuration files in that same directory?

The above issue is my primary concern.

The solution to the other issue regarding leaving config files installed, after un-installing also appears to require a Professional license. The "Go to Component" link is greyed out in the shareware version.

I appreciate that you cannot offer every feature in your freeware version so I may just have to live with these issues or find an alternative free product to do my installs. I am developing in C# .Net 2008 Express Edition which does not allow me to create installation projects.

Thanks and regards

Darren
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Read only installation directory on Windows 7

Hi Darren,

You can take Google's example and install your application on a per-user basis. For example, GTalk installs in the AppData\Roaming folder.
You could set the install directory of your application to:

Code: Select all

[AppDataFolder][Manufacturer]\[ProductName]
Do this from the Install Parameters page in Advanced Installer.

Installing to this location does not require any kind of privilege. If the user wants to install per-machine, he is free to do so by changing the install directory during install. However, your product's default install folder will now be a standard location for applications that want to install without privileges. It is also recommended you install shortcuts in appropriate places for the user to be able to locate your app.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”