PDA

View Full Version : Csidl_appdata



NewsArchive
10-07-2014, 02:11 PM
SetupBuilder 8.1
If I issue the Install Files command to a folder that does not exist,
the Install Files command creates the folder, correct?
If the folder being created is in the CSIDL_APPDATA, what attributes are
being assigned to the folder?
Should I create the folder before installing files to it?

The issue is that the end user is getting an error that they cannot open
one of mey product's files if it is in the CSIDL_APPDATA
folder. If I changes the folder options for my folder to not hidden, it
works. Does this make sense?


--
Darrel (Dee) Witham
Professional Data Services, Inc

NewsArchive
10-07-2014, 02:11 PM
Hi Darrel,

CSIDL_APPDATA is the file system directory that serves as a common
repository for application-specific data. A typical path is
C:\Users\<user>\AppData\Roaming

An installer running elevated (PER-MACHINE) and an application running
non-elevated (PER_USER) access a completely different folder.

It's not a good idea to install into this folder.

Friedrich

NewsArchive
10-07-2014, 02:12 PM
By the way, I might be wrong, but I think you are using an incorrect folder.
What are you trying to do and why do you install into a "per-user"
CSIDL_APPDATA folder? (impossible from a per-machine install)

Friedrich

NewsArchive
10-07-2014, 02:12 PM
Well, CSIDL_APPDATA returns the same folder whether there is elevation
or not.

So I'm guessing it's an ownership thing if he actually installs it in
that folder.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
10-07-2014, 02:13 PM
Thanks all - I will check ownership issue.

--
Darrel (Dee) Witham
Professional Data Services, Inc

NewsArchive
10-08-2014, 02:29 AM
Jeff,

> Well, CSIDL_APPDATA returns the same folder whether there is elevation
> or not.
>
> So I'm guessing it's an ownership thing if he actually installs it in
> that folder.

IMO, it is caused by the "per-user" thing.

See attached screenshots. Let us assume, "Robert" is the administrator of
the machine. In a typical corporate environment, the user lives in a
"Standard User" account. In our case, the normal user is "JoeUser".

When you run a typical "per-machine" installer (ELEVATED), you access the
"Robert" user profile. But the installed application runs non-elevated per
default and can NOT access the C:\Users\Robert\AppData folder. So if your
installer copied files into CSIDL_APPDATA then your own application can
NOT see it.

When you run a "per-user" installer (NON-ELEVATED), you access the "JoeUser"
user profile. The installed application runs non-elevated per default and
CAN access the C:\Users\JoeUser\AppData folder. If your installer copied
files into CSIDL_APPDATA then your own application CAN see it. BTW, 99% of
all application installations are per-machine!

As I understand it, Darrel has an application design that is not really
"mixed-mode" enabled (does not work as expected ELEVATED and NON-ELEVATED).

Friedrich

NewsArchive
10-08-2014, 07:48 AM
That's what I had thought before too. Thanks for confirming my
understanding.

In this case, the thing that threw me was that I tried it with my own
exe and was getting the same result whether elevated or not.
c:\users\jslarve\AppData\Roaming

I wonder why that is.

I tried with SHGetSpecialFolderPath and also reading the "APPDATA"
evnvironment variable.

Sorry I muddied your support thread.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
10-08-2014, 08:05 AM
Hi Jeff,

> That's what I had thought before too. Thanks for confirming my
> understanding.
>
> In this case, the thing that threw me was that I tried it with my own
> exe and was getting the same result whether elevated or not.
> c:\users\jslarve\AppData\Roaming
>
> I wonder why that is.
>
> I tried with SHGetSpecialFolderPath and also reading the "APPDATA"
> evnvironment variable.
>
> Sorry I muddied your support thread.

Absolutely no problem :) It's an interesting question.

Two options:

1. You are logged-in as "jslarve" and you have an "Administrator" account.
So both elevated and NON-elevated running apps access the same CSIDL_APPDATA
location (c:\users\jslarve\AppData\Roaming).

But if you create a new "Standard user" account (e.g. "flinder") and you
login to that account, then any elevated running app will access
c:\users\jslarve\AppData\Roaming (your Administrator profile) and the
NON-elevated running application will access
c:\users\flinder\AppData\Roaming (the Standard user profile). This is the
typical corporate environment scenario. UAC enabled, one Administrator
account (to install software and setup the machine) and one or more Standard
user accounts (for the "real" users).

2. What happens when UAC is disabled? Well, in this case,
"over-the-shoulder" elevation is not available for Standard users and so
they ALWAYS access their own profile (e.g.
c:\users\flinder\AppData\Roaming).

Friedrich

NewsArchive
10-08-2014, 10:04 AM
Makes sense. Thanks!

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

NewsArchive
10-09-2014, 02:36 AM
> The issue is that the end user is getting an error that they cannot open
> one of mey product's files if it is in the CSIDL_APPDATA
> folder. If I changes the folder options for my folder to not hidden, it
> works. Does this make sense?

Not to hijack a thread here Dee, but one option that WILL work 100%
reliably is to use the "FirstDeploy" option of our ProPath templates.

Then do not offer to run the program automatically at the end of the
install (or if you do - select the SetupBuilder option to run it
non-elevated).

You can set the CSIDL location for your files in ProPath and when the
application is ran for the first time (or on demand), ProPath will deploy
the file(s) you want into the correct location.

We use this with our EZRound product to put the editable templates into a
proper CSIDL location and it works like a charm.

Since the files are deployed from your app when it is running in the proper
user context, the location is always right.

Good luck on your projects!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)
www.clarionproseries.com - ProScan, ProImage, ProPath and other Clarion
developer tools!
www.ezchangelog.com - "Free ChangeLog software to manage your projects!"
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------