PDA

View Full Version : Installation on Windows 7



NewsArchive
05-13-2010, 08:12 AM
I guess I am missing something but I do not know exactly what it is.

I am using setup builder and it is working perfectly. I have been in contact
with Friedrich and he has tried to help.

I am installing to windows 7. I do NOT want require the user to have
elevated privileges.

The program is installing in C:\Program Files (x86)\Company Name\Application
Name

I am installing the data files in CSIDL_PERSONAL\Company Name\Application
Name

I have been told that this incorrect. That my installation is not UAC
compliant. I guess ignorance is bliss, I thought it was compliant. I did not
even know I was doing it incorrectly. The installation appears to match up
with Global Properties > Clarion ini file options.

I am embedding a manifest per Global Properties > App Settings > Application
Manifest. The manifest is set as invoker.

----------

What is wrong with what I am doing exactly?
How should I be doing it?
And lastly does anyone have an example setup builder script, which installs
some sort of small application with data files that works correctly for
windows 7?

The frustration level is through the roof.

Thank you for your time.
--

Tim Frost,

NewsArchive
05-13-2010, 08:12 AM
Tim:

Just curious, who/what is telling you your approach is wrong?

It looks proper to me, for whatever that is worth.

Regards

Parker

NewsArchive
05-13-2010, 08:12 AM
> Just curious, who/what is telling you your approach is wrong?
>
> It looks proper to me, for whatever that is worth.

I said that <g>

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-13-2010, 08:14 AM
My bad. Looks like I will have to re-read those articles I thought I
understood ;-)

Parker

NewsArchive
05-13-2010, 08:16 AM
> My bad. Looks like I will have to re-read those articles I thought I
> understood ;-)

Parker,

Well, Friedrich goes into great detail in another message -

essentially when using per-user information such as CSIDL_PERSONAL location
for app data - can't use the install to place data there because of over
the shoulder install problems - then Friedrich gives the solution.

"Per-user information has to be "initialized" when you launch the asInvoker
application for the first time. For example, you install the data to a
"global" location and when your application is launched for the first time,
copy the files from the global location to the per-user location.

Remember that you never know how many profiles exist on a machine. So this
approach works well even if a new Standard User is created."

Then, each User Account (Administrator OR Standard accounts) starts with
the proper information for the program in the CSIDL_PERSONAL location.

David

--
From David Troxell - Product Scope 7.9 - Encourager Software
Product Scope 7 Viewer - NO Registration Fee! Free to Use!
http://www.encouragersoftware.com/
http://www.encouragersoftware.com/profile/microsoft-office-2010.html

NewsArchive
05-13-2010, 08:16 AM
> My bad. Looks like I will have to re-read those articles I thought I
> understood ;-)

<G> Software development isn't fun anymore <g>.

It took more than two years to do all the UAC research and development for
SetupBuilder.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-13-2010, 08:17 AM
Sure it's fun!

It just ain't for sissies anymore <G>

Jane

NewsArchive
05-13-2010, 08:17 AM
> I guess I am missing something but I do not know exactly what it is.
>
> I am using setup builder and it is working perfectly. I have been in contact
> with Friedrich and he has tried to help.
>
> I am installing to windows 7. I do NOT want require the user to have
> elevated privileges.

Tim,

You described fairly well the overall technique you're using, but you
didn't tell us specifically - what is failing.

Also, couple things -

The installer must be elevated so it can write to the C:\Program Files area
and install your Clarion program to that area - or are you referring to the
Clarion program when it runs?

Also, don't use this reference - C:\Program Files (x86)\ in the actual
SetupBuilder dialog - use C:\Program Files\ instead - when a 32 bit program
is installed in a 64 bit OS - Windows will assign it to the x86 area.

Use this list to from Lindersoft to help you. Click on the 3rd message in
the message thread

http://www.lindersoft.com/forums/showthread.php?t=21593&highlight=include+manifest+Windows

Are you placing your ini file in the CSIDL_PERSONAL\Company
Name\Application Name folder?

Download the CHM version of this blog for further help - help topic -
Program Install Techniques

Product Description - App Data UAC Safe, MFG - Encourager Software
Internet Link - http://profileexchanges.com/blog/?p=120

Lastly, hang in there - ask more questions - you'll soon have success - and
we have all been there at one point -

some of the most successful Clarion developers have asked some very basic
questions when they were learning to do UAC compliant installs and
successful UAC techniques for Clarion programs.

David

--
From David Troxell - Product Scope 7.9 - Encourager Software
Product Scope 7 Viewer - NO Registration Fee! Free to Use!
http://www.encouragersoftware.com/
http://www.encouragersoftware.com/profile/microsoft-office-2010.html

NewsArchive
05-13-2010, 08:18 AM
If the installation machine has data protection turned on, and UAC, then
everything under "Program Files" becomes read-only once installed. This
is to protect programs from being modified by malicious software.
Therefore, only data that should not be modified should be installed in
that subtree. (Like images, PDFs, etc.)

Where to put volatile data depends on the nature of the data, whether
the app is installed for a particular user, or "all users", whether this
is a business environment or home, etc. User-specific volatile program
settings normally go into "%appdata%\Roaming\company\app" or
"%appdata%\Local\company\app", which are specific to each user.
Settings for all-users normally go into C:\ProgramData\whatever.

Databases could go basically anywhere except "Program Files". Size
would probably be a consideration. Access authorization could be a
consideration. I would not normally put a database of substantial size
in a "settings" folder, but a small one I might.

This should give you some idea.

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
05-13-2010, 08:18 AM
Assuming you want to use standard CSIDL locations, I probably should
have listed:

CSIDL_APPDATA
CSIDL_COMMON_APPDATA
CSIDL_COMMON_DOCUMENTS

--
Phil Carroll
http://www.enablingsimplicity.com

NewsArchive
05-13-2010, 08:18 AM
Well, thanks for the help so far.

Freidrich is the person telling me it is wrong. He suggested reading the
help for setup builder. I have done this several times. I cannot seem to
figure out what is wrong about my approach. I really hate to keep bothering
him. I decided it might be a question that other people might be interested
in viewing, therefore I posted it to the news group.

One interesting thing. When I install for me (I am also the administrator,
naturally) all goes well. However, yesterday I tried to install as a guest
user account. The program installed fine, with of course elevated
privileges.
However, the data files would not install no matter what I tried.

I do not even know where to go from here. The posts so far sound like I am
doing it correctly.

Thanks again for your assistances.

Tim Frost,

--

Tim Frost, S.E.T.
President

TFDSI.com

NewsArchive
05-13-2010, 08:19 AM
Hi Tim,

> Freidrich is the person telling me it is wrong. He suggested reading the
> help for setup builder. I have done this several times. I cannot seem to
> figure out what is wrong about my approach. I really hate to keep
> bothering him. I decided it might be a question that other people might
> be interested in viewing, therefore I posted it to the news group.

First of all, you did not bother me at all! ;-)

I did not really suggest to read the SetupBuilder "help" file (because this
is not a SetupBuilder question per-se). I suggested to read "Learning
SetupBuilder Part I" which covers UAC and other general Windows development
guidelines. We developed this free resource to help you write UAC-compliant
and Windows 7 compatible installations and applications.

> One interesting thing. When I install for me (I am also the administrator,
> naturally) all goes well. However, yesterday I tried to install as a guest
> user account. The program installed fine, with of course elevated
> privileges. However, the data files would not install no matter what I
> tried.
>
> I do not even know where to go from here. The posts so far sound like I am
> doing it correctly.

No, you are not doing it correctly ;-) But you are not alone with this,
because most developers still ship non-UAC-compliant and non Windows Vista,
Windows 7, 2008 compatible installations and applications.

But more and more users are switching to Windows 7 now and so it becomes a
real problem. Our Consulting is fully booked until 2011 now to solve those
exact issues. What you need today is a real mixed-mode application that
works fine non-elevated and elevated.

BTW, being an administrator does not mean anything in the modern Windows
world.

An application that is running elevated ("requireAdministrator" manifested)
should never write to per-user locations (e.g. HKEY_CURRENT_USER registry,
CSIDL_PERSONAL folder, etc.). Only "asInvoker" applications should write to
such locations. Because a typical installation program always has to run
with administrator execution level privileges, you can't write to the
correct HKEY_CURRENT_USER or CSIDL_PERSONAL profile. If you do it, then
it's done under the wrong user context.

Let us assume, you have a "Tim" Administrator and a "JoeUser" Standard User
account under Vista or Windows 7. The installation application runs
elevated -- an elevated process is usually one that has been launched by
someone with a Full Administrator Token and runs with High Integrity Level
Privileges (administrator execution level privileges). If "JoeUser" starts
the installation, UAC determines that the Current User does not have a token
of sufficiently high Integrity Level and the Credentials Prompt asks the
user to provide a username and password of someone who has sufficient
rights. Windows will then create the necessary token for that user and uses
it to elevate the process so you can now continue with the installation.
Please note that you are on a completely different profile after the
elevation process. You have switched from the "JoeUser" profile to the
administrator ("Tim") profile! In other words, you do not write to the
"JoeUser" HKEY_CURRENT_USER registry key or CSIDL_PERSONAL folder, but to
the Administrators key and folder!

For example, you install several .tps files to "CSIDL_PERSONAL\Company
Name\Application Name". So you have:

Administrator: C:\Users\Tim\Company Name\Application Name
Standard User: C:\Users\JoeUser\Company Name\Application Name

Now comes the interesting part. JoeUser starts the installation and
"over-the-shoulder" authentication kicks-in. In other words, the
Administrator grants elevated privileges to a program while a Standard User
is currently logged onto the system. As a result, your installer writes the
..TPS files to:

C:\Users\Tim\Company Name\Application Name

but the installed "asInvoker" (non-elevated) running application accesses:

C:\Users\JoeUser\Company Name\Application Name

Completely different profiles! In other words, your application does not
see the installer application created .tps files. And your support
nightmare begins. User call you because the .tps files ("the data") do not
exist or are empty.

Per-user information has to be "initialized" when you launch the asInvoker
application for the first time. For example, you install the data to a
"global" location and when your application is launched for the first time,
copy the files from the global location to the per-user location. Remember
that you never now how many profiles exist on a machine. So this approach
works well even if a new Standard User is created.

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
05-13-2010, 08:19 AM
As usual a brilliant demonstration of real knowledge !

If I can add a 'real-life' experience Tim :
take the habits in your

1. application :
write ONLY to HKCU
If need be READ (ONLY) from HKLM and WRITE (copy) to HKCU so as to be
sure all is "current"
a small example to read and copy (after checking if it needs to be
done):
RegValue = GETREG(REG_LOCAL_MACHINE,'Software\CGF\Data Management
Center','Company')
PUTREG(REG_CURRENT_USER,'Software\CGF\Data Management
Center','Company',CLIP(RegValue))


2. installer :
write to HKLM (like this your app knows where to READ and copies then
to each users HKCU)
(and NEVER to HKCU as Friedrich explained)

It is more work for us but very simple when all is "geared" like this :

- Installer writes to HKLM
- Application READS (at init time) from HKLM and IF needed (compare in
code) WRITES to users HKCU BEFORE any files are processed etc

At least here it is how I do and all seems fine to date from all
reports (maybe not the best "kosher" way but ....)

Then you are safe and can sleep after spending hours and days testing
all this UNDER ALL available OS - because they DO NOT all react the
same
(XP is a pain here and from my experience even some LANGUAGES in XP
would seem to give different reesults mainly eastern european ones)

A "mess" microsoft did but a _good_ one because it forces US to be
careful in our work instead of being lenient (just like the c7 parser
IS a good thing forcing us to pay more attention to our work)

--
Merci
Cordialement - Best regards
Jean-Pierre GUTSATZ
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com Certified by Microsoft : "Works with Vista" & "Works
with Windows Server 2008"

NewsArchive
05-13-2010, 08:20 AM
Thank you so much Friedrich!

I am sorry to be so brain dead but I think I finally understand. It finally
makes sense what has been happening and what I have to do to fix my problem

Thanks again for your patience.

Tim

NewsArchive
05-13-2010, 08:20 AM
Yeah, that's what I meant ;-)

Jane

NewsArchive
05-13-2010, 08:21 AM
Not knowing details of what Friedrich may have told you, I'll just offer a
couple of observations.

1. CSIDL_PERSONAL is part of an individual user's profile. On Vista\Win 7
that will be in c:\Users\Username. On XP, within c:\Documents and Settings
2. This is a good location for per-user data. For that matter, Friedrich
installs the SetupBuilder example files beneath that folder.
3. This is NOT a good location if your users need to share data (by
default, User X cannot access stuff in User Y's profile).
4. When you are doing an elevated installation (which is REQUIRED if you're
sticking your stuff inside of C:\Program Files), the whole profile thing
gets swirled about. In the help file that installs with the SetupBuilder
examples ("Learning Setupbuilder..."), ===>>>read the section on the
over-the-shoulder installation issues.<<<===
5. If you want to use that data folder, it should NOT be meddled with
during the installation process. Once the program is installed and a normal
user is running it, your program will be able to create the data folder
within his profile and he'll be able to read/write data within it.

HTH

Jane

NewsArchive
05-13-2010, 08:21 AM
> Not knowing details of what Friedrich may have told you, I'll just offer a
> couple of observations.
>
> 1. CSIDL_PERSONAL is part of an individual user's profile. On Vista\Win 7
> that will be in c:\Users\Username. On XP, within c:\Documents and Settings
> 2. This is a good location for per-user data. For that matter, Friedrich
> installs the SetupBuilder example files beneath that folder.
> 3. This is NOT a good location if your users need to share data (by
> default, User X cannot access stuff in User Y's profile).
> 4. When you are doing an elevated installation (which is REQUIRED if you're
> sticking your stuff inside of C:\Program Files), the whole profile thing
> gets swirled about. In the help file that installs with the SetupBuilder
> examples ("Learning Setupbuilder..."), ===>>>read the section on the
> over-the-shoulder installation issues.<<<===

Tim,

I am going to use Jane's post to respond to you, since she is quite expert
at SB and UAC operation, and she gave you some excellent pointer and advice
overall.

> One interesting thing. When I install for me (I am also the administrator,
> naturally) all goes well. However, yesterday I tried to install as a guest
> user account. The program installed fine, with of course elevated
> privileges.
> However, the data files would not install no matter what I tried.

If you are using SB to install some sample files to the User Account, then
of course, logging on with the Administrator account, they are installed to
the User Account location for the Administrator.

If you install under a NON-admistrator account, and are using SB to install
some sample files - they are STILL installed to the Administrator User
Account location during the install - THAT is what Jane meant by studying
over-the-shoulder installation issues.

If you haven't already - download - Project Examples Package from this page
and install it.

http://www.lindersoft.com/downloads_licensed.htm

By default, it will install to this location

C:\Users\<User Account>\Documents\SetupBuilder Projects\Examples

Open this file

Learning SetupBuilder Part I.chm

Read this help topic

Over-the-shoulder installation

David

--
From David Troxell - Product Scope 7.9 - Encourager Software
Product Scope 7 Viewer - NO Registration Fee! Free to Use!
http://www.encouragersoftware.com/
http://www.encouragersoftware.com/profile/microsoft-office-2010.html

NewsArchive
05-13-2010, 08:22 AM
Thanks for the amplification, David.

I was late for an appointment when I posted that cursory jotting.

Jane

NewsArchive
05-13-2010, 08:22 AM
> Thanks for the amplification, David.

Jane,

You're welcome - of course, Friedrich followed up with a detailed, expanded
explanation that is excellent advice for all developers - because
CSIDL_PERSONAL is a widely used choice for many developers.

Then I vigorously re-edited the CHM and reposted (latest date - May 10
2010) for this blog - new screen shots in certain areas -

Product Description - App Data UAC Safe, MFG - Encourager Software
Internet Link - http://profileexchanges.com/blog/?p=120

with an emphasis on over-the-shoulder installs and a summary quote of what
Friedrich said in this newsgroup concerning - "Per-user information has to
be "initialized" when you launch the asInvoker application for the first
time..."

And again, referring to:

"Learning SetupBuilder Part I - Jane Fleming's tutorial - included with
SetupBuilder 7 as a Project Examples Package download - includes a help
topic - Over-the-shoulder installation - with a detailed explanation."

So, hopefully, as Friedrich pointed out - we can all go back and fine tune
our UAC installs and program deployment and make it a better UAC world!

Katie Melua/ Eva Cassidy - What a Wonderful (UAC) World :-D

http://www.youtube.com/watch?v=rF2voQ4EK84

Well, the sentiment is there! Don't flame the poster for hopeful change!

David

--
From David Troxell - Product Scope 7.9 - Encourager Software
Product Scope 7 Viewer - NO Registration Fee! Free to Use!
http://www.encouragersoftware.com/
http://www.encouragersoftware.com/profile/microsoft-office-2010.html

NewsArchive
05-13-2010, 08:23 AM
Thanks to all for the help. I think I understand what I have to do now.

--

Tim