This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problems writing to INSTALLDIR on Vista
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 22, 2007
10:47 AM
Problems writing to INSTALLDIR on Vista
My application uses data files which are not user specific and hence I write them into [CommonAppData]/CompanyName/AppName in what appears to be "the Vista way". However, I'd really like this location to be configurable at install time. I therefore would like to write an INI file alongside the application file in c:\Program Files\... to tell the app where all these data files are.
The "solution" I've come up with involves me writing an INI file to INSTALLDIR from a custom action. However, it doesn't work - the call to WriteProfString fails.
I've tried adding Full Control to "Everyone" (no domain specified) on INSTALLDIR in the component view - but this appears to have had no effect.
Is there a workaround to this? An alternative might be to use the registry - but since I'm not user specific, I'd like to write to HKLM but I suspect I'm going to have similar permission problems with the registry.
Does anyone have any advice? I'm using IS2008.
Thanks,
Dave
The "solution" I've come up with involves me writing an INI file to INSTALLDIR from a custom action. However, it doesn't work - the call to WriteProfString fails.
I've tried adding Full Control to "Everyone" (no domain specified) on INSTALLDIR in the component view - but this appears to have had no effect.
Is there a workaround to this? An alternative might be to use the registry - but since I'm not user specific, I'd like to write to HKLM but I suspect I'm going to have similar permission problems with the registry.
Does anyone have any advice? I'm using IS2008.
Thanks,
Dave
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2007
05:04 AM
Why a custom action? Windows Installer supports writing INI files natively.
Stefan Krueger
InstallSite.org
InstallSite.org
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2007
05:54 AM
Two reasons I believe.
Firstly, I need to get this INI file set up after the install has taken place (or at least after the user has chosen file locations) - hence it needs to be in a script.
Second, I need to script it because I need the INI file to be in the App's directory rather than in a user-specific directory.
I'm not entirely clear whether I can avoid custom actions for this, but I'm not sure that the CA is the problem - it appears to be a permissions issue - though I'm not clear what the actual error coming out of WriteProfString is.
I will investigate further
Firstly, I need to get this INI file set up after the install has taken place (or at least after the user has chosen file locations) - hence it needs to be in a script.
Second, I need to script it because I need the INI file to be in the App's directory rather than in a user-specific directory.
I'm not entirely clear whether I can avoid custom actions for this, but I'm not sure that the CA is the problem - it appears to be a permissions issue - though I'm not clear what the actual error coming out of WriteProfString is.
I will investigate further
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 23, 2007
06:17 AM
INI entries you add in the INI Files view will be created after the files ahve been copied so that should work without custom actions.
I'm not sure why your custom action fails. I would need more information about where in which sequewnce it's called and what the in-script execution settings are. But you really shouldn't use a custom action for something that Windows Installer can do out of the box.
I'm not sure why your custom action fails. I would need more information about where in which sequewnce it's called and what the in-script execution settings are. But you really shouldn't use a custom action for something that Windows Installer can do out of the box.
Stefan Krueger
InstallSite.org
InstallSite.org