Old 7th September 2010, 08:18   #1
kzchris
Junior Member
 
Join Date: Dec 2007
Posts: 12
Question Instalation directory

Hi,
In my instalator I use
InstallDir "$PROGRAMFILES\foo"
as an installation directory.
In my program I use a configuration file (one for every user), which changes every time any user uses the program. The configuration file now is placed in the same directory as exe file.

The problem is in windows 7 when the user has not admin rights – my program have no rights to change the configuration file.

In which directory should I place the config file to solve the problem or what else should I do?

Regards,
Chris
kzchris is offline   Reply With Quote
Old 7th September 2010, 08:26   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Make a folder in $APPDATA.

Stu
Afrow UK is offline   Reply With Quote
Old 7th September 2010, 08:38   #3
kzchris
Junior Member
 
Join Date: Dec 2007
Posts: 12
Ok, thanks I will try.
Regards,
Chris
kzchris is offline   Reply With Quote
Old 7th September 2010, 09:10   #4
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
if you want the *same* configuration file to be accessible for all the users that have an account on the machine, don't forget to use
SetShellVarContext all
before
SetOutPath $APPDATA
Wizou is offline   Reply With Quote
Old 7th September 2010, 21:50   #5
kzchris
Junior Member
 
Join Date: Dec 2007
Posts: 12
How can I make InstallDir to point at $APPDATA for all users, if I can’t use “SetShellVarContext all” outside the section?
kzchris is offline   Reply With Quote
Old 7th September 2010, 22:28   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
In .onInit you can do:

SetShellVarContext all
StrCpy $INSTDIR $APPDATA

Stu
Afrow UK is offline   Reply With Quote
Old 8th September 2010, 10:20   #7
kzchris
Junior Member
 
Join Date: Dec 2007
Posts: 12
Smile

It works
Thanks
kzchris is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
installdir

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump