PDA

View Full Version : Userprofile



Greg Palmer
12-27-2006, 10:12 PM
Hi

When I use the get system information command to retrieve the userprofile variable It returns the adminstrators path instead of the path I am logged in with.

I can use the set command after the install has started and it is displaying the correct userprofile but setupbuilder is returning the wrong one.

Log on as a standard user and run an install to reproduce the problem.

Thanks
Greg

linder
12-28-2006, 01:27 AM
Greg,

Which "Get System Information" function do you use to retrieve the "userprofile variable"?

Thanks,
Friedrich

Greg Palmer
12-28-2006, 08:37 AM
Hi

I am using the Expand Environment Variable and retrieving userprofile.

Thanks
Greg

linder
12-28-2006, 08:47 AM
Hi Greg,

The "Expand Environment Variable" is a call to the native Windows API ExpandEnvironmentStrings().

See: http://msdn2.microsoft.com/en-us/library/ms724265.aspx

HTH,
Friedrich

Greg Palmer
12-28-2006, 08:58 AM
Do you now why it would be returning the wrong info? I can use the set command and see the correct info.

The way that it is working know makes it useless.

Is there another way that I can retrieve the userprofile?

If the best place to install files in vista is in the user directory then we are going to need a way to do it.

Thanks
Greg

linder
12-28-2006, 09:03 AM
Greg,

What about using the "Get Special Folder" function?

Friedrich

Greg Palmer
12-28-2006, 10:06 AM
Hi

Same problem doing it the new way. It pulls up the administrator info instead of the user info your logged in with.

What do I need to do?

Greg

linder
12-28-2006, 10:09 AM
Greg,

I would suggest to consult MSDN because this is not a SetupBuilder installer issue.

BTW, we are using the following without any problem in our own SB6 installation procedure:

Set Variable %APPDATA% to ScriptItem->Get Special Folder("CSIDL_APPDATA")

Does this help?

Friedrich

Greg Palmer
12-28-2006, 10:14 AM
That is what I just tried and it doesn't work for me.

I can use the set command and it is returning the correct info.

Greg

linder
12-28-2006, 10:25 AM
Hi Greg,

You can use any Windows API from the installer. If you think it is an installer issue, just call a direct Windows API using "Call DLL".

Does this help?

BTW, please keep me posted.

Friedrich

Greg Palmer
12-28-2006, 10:29 AM
I just tried to install setupbuilder on vista and it doesn't work correctly either.

I log in with a user called tom.
When I run the install it asks me for an admin password to install.
It then uses the admin info instead of the user called tom's info.

The set command is showing the correct information but setupbuilder is pickuping up the info from the user I had to give the admin password for.

Greg

linder
12-28-2006, 11:03 AM
Greg,

Yes, this is absolutely correct and works as expected. The installer requires administrator execution level because it installs a Mixed User Application - the SetupBuilder 6 IDE can run as a Standard User or Administrator on Vista!!!

Does this help?

Again, if you think there is a bug in the installer, just use your own Windows API call - but you'll get the same results ;-)

Greg Palmer
12-28-2006, 11:28 AM
I guess the question is what good is it if it installs to the wrong place?

If everything should be installed into the user directory there has to be a way to be able to do it without changing the path each time.

Again I can use the set command in windows and it is displaying the correct info. Is there a way setupbuilder can retrieve the same info that is in the set command? I thought that was what get system information did but it is not working correctly.

I can't expect user's to know they need to change to there directory before installing.

The way it works now it would install into the admins directory and they when the user tried to use it they would not have permissions to be able to.

Greg

linder
12-28-2006, 11:45 AM
Greg,

Results from the command line and your Vista-aware application are two pair of shoes ;-)

Write a simple Windows application (e.g. using Clarion or VS2005) and let me know what the Windows API returns.

Then, if you have the "correct" result returned from your app, let me know what it is and I can tell you how to do the same with SetupBuilder.

BTW, we are using the same Windows API functions from the SB6 IDE (written in Clarion). Both the installer and Clarion app return the same result!

The installer cannot return a wrong value because it calls a Windows function. It does not modify the value returned from Windows.

HTH,
Friedrich

Greg Palmer
12-28-2006, 11:58 AM
It may be two pair of shoes but the one comming from setup builder is wrong.
We need the information from the other shoes.

I really don't care how microsoft is doing it now all I care about is how I am going to get my software installed on my customers computers.

If setupbuilder is comming up with the wrong path each time and we need the correct path to make our programs work correctly then it doesn't matter wether setup builder is getting the path from because it is still the wrong path and your program won't run after it is installed.

The way the installs work know you have to install in the user directory's to not have any problems. Setupbuilder needs to be able to do this.

Please help
Greg

linder
12-29-2006, 02:30 AM
Hi Greg,

Sorry, but that is how Vista works!!! Again, SetupBuilder does not return the wrong information. It returns what Windows provides and what you requested. That is the new Vista UAC feature!!!!

If you get another value from the command line then this only means that command does not request administrator execution level.

If you request Administrator Execution Level then it returns the administrator information.

Set the installer "Request Execution Level" (General Information -> Generator Settings) to "asInvoker" and you'll get the info for (in your case) "tom".

Does this help?

Friedrich

Greg Palmer
12-29-2006, 01:04 PM
Thanks

That fixed the problem. I wish I would have seen that sooner it would have saved a lot of time.

Greg