f1nn
18th November 2006 13:59 UTC
All users
Hi
I am installing my app first by checking the user has admin rights and if so proceeding with the install. the application works well if it is the admin logged on to windows XP. However when I change users to just an ordinary user as the application is loading I get the Windows error dialog box appearing. The normal one asking the user to send mesaage to microsoft. The application exits when I cancel the error box. Can anyone help me understand what may be causing this. I use the setShellContextVar all to set the application to all users. Any advice would be great as I dont fully understand what is causing this.
Many thanks :confused:
kichik
18th November 2006 14:14 UTC
What exactly does the dialog box say? Click on "more details" and post the details here. Also post the script.
f1nn
20th November 2006 12:33 UTC
HI Kichik,
Thanks for the reply I have attached a folder with two images of the error boxs. The section were I set it for all users is as follows I am new to this so would be thankful if you can show me if I am going wrong
Thanks
Section Acc_type
ClearErrors
UserInfo::GetName
IfErrors Win9x
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +2
; MessageBox MB_OK 'User "$0" is in the Administrators group'
Goto Alluser
StrCmp $1 "Power" 0 +2
; MessageBox MB_OK 'User "$0" is in the Power Users group'
Goto Alluser
StrCmp $1 "User" 0 +2
; MessageBox MB_OK 'User "$0" is just a regular user'
Goto WrongPrivalage
StrCmp $1 "Guest" 0 +3
; MessageBox MB_OK 'User "$0" is a guest'
Goto WrongPrivalage
MessageBox MB_OK "Unknown error The installer will quit please contact your Administrator"
Quit
;Goto done
Win9x:
# This one means you don't need to care about admin or
# not admin because Windows 9x doesn't either The installer will quit
# if this error is thrown
MessageBox MB_OK "Error! This DLL can't run under Windows 9x! \
Your System does not meet Minimum requirements"
Quit
WrongPrivalage:
MessageBox MB_OK "You do not have the correct privilages to install software on this machine. Contact you Network administrator\
$\nIf you are not part of a network reset your user account to allow you Administrator privilages"
Quit ; Wrong privilages quit the installer
Alluser:
SetShellVarContext all
SectionEnd
f1nn
20th November 2006 12:40 UTC
sorry here are the error images
kichik
21st November 2006 18:40 UTC
Is riverdocs.exe your installer? If so, try a vanilla version of NSIS instead of a privately built version. If that really solves the problem, I'd need a full script reproducing this problem and the build options you've used so I can fix the incompatibility with VS2005.
f1nn
22nd November 2006 12:33 UTC
Hi Kichik,
Riverdocs.exe is the installer and I am usign a standard MUI setup script. I have found that it is a permissions problem, If the install folder C:\Program Files\ MY APP is read only this causes the problem. If it is not read only it appears to be ok. I have been trying to setFileAttributes to set the attributes to normal what I am trying to doing is, using the NSIS get parent function get the Riverdocs folder as the parent, if I check this $R0 is C:\Program Files\Riverdocs I then use the getfile Attributes command like this ${GetFileAttributes} "C:\Program Files\RiverDocs" "ALL" $Var Then I am hoping to use setfileAttributes $var normal I thought I could have just used the setfileattributes command with out the getfileattributes. would that be OK. When I use the getfilesattributes command I get the error invalid command. I have used !include "FileFunc.nsh"
would that be right? or do I need to insert anything else. I am proberly not using thse commands right and have tryed to follow them to the letter from the help documentation so can you explain where I am going wrong. It is not the best solution to make the folder writable rather than read only but should work as a temporary fix, would apprecipate your help on this,
Many thanks
N
kichik
23rd November 2006 18:01 UTC
I'm sorry, I have misread your original post. You said it was your program that crashed when switching to a normal user and not the installer.
That's a problem with your program which probably tries to write the Program Files directory and doesn't check for failure. When running under a normal user, you can't write to that folder and shouldn't be able to. You shouldn't set the permissions to enable this. Instead, you should modify your program so it uses the Application Data directory. To get that directory, use SHGetSpecialFolderLocation or SHGetFolderPath with shfolder.dll.