PDA

View Full Version : Current User registry keys with Elevated Install



NewsArchive
08-22-2021, 03:25 AM
When you run an install package that requires Admin access (invoke as
admin), are the Current User registry keys for the admin? or the current
normal user?

Paul MacFarlane

NewsArchive
08-24-2021, 01:51 PM
Hi Paul,

> When you run an install package that requires Admin access (invoke as
> admin), are the Current User registry keys for the admin? or the current
> normal user?

If the install runs non-elevated (asInvoker) then it reads/writes the
current-user profile. If it runs elevated (e.g. requireAdministrator) then
it accesses the admins profile.

Friedrich

NewsArchive
09-06-2021, 01:31 PM
Thank you !

Paul MacFarlane

NewsArchive
09-14-2021, 02:06 AM
> Hi Paul,
>
>> When you run an install package that requires Admin access (invoke as
>> admin), are the Current User registry keys for the admin? or the current
>> normal user?
>
> If the install runs non-elevated (asInvoker) then it reads/writes the the
> current-user profile. If it runs elevated (e.g. requireAdministrator) then
> it accesses the admins profile.
>
> Friedrich

As a follow up.....

Why can't an 'asInvoker' install create any menu items or a desktop icon
(shortcuts)?

I need to load registry entries to the CU and create a shortcut.

Paul MacFarlane

NewsArchive
09-14-2021, 02:06 AM
> Why can't an 'asInvoker' install create any menu items or a desktop icon
> (shortcuts)?
>
> I need to load registry entries to the CU and create a shortcut.

Paul,

You should be able to do this by creating a small non-elevated "Helper.exe"
in SetupBuilder (to do the work) and then use the SetupBuilder option at
the end of your regular (elevated) install to RUN the helper program
"non-elevated".

That allows your SB install to run elevated and do all the things that a
normal installer needs to do to meet Windows standards. But at the end of
that install process your elevated installer launches your helper EXE to do
the rest of the work under the current user profile.

It's also worth mentioning that if your program saves any data or
manipulates anything when it is first ran, that you should use the "RUN
non-elevated" option on that as well.

Otherwise you get into the scenario where "Paul the Administrator" installs
the program and then RUNs it at the end of the install (which results in
any data saved or Registry entries modified being saved in locations
relative to "Paul the Administrator".

Then the next time you run the program Windows runs it as "Paul the User"
(unless the EXE is manifested to run "AsAdministrator" - resulting in a
prompt to run the program elevated). Since the program (on all subsequent
runs) is looking in data and Registry locations for "Paul the User", the
initial settings stored or data saved where you ran the program at the end
of an elevated install, the data stored by "Paul the Administrator" would
appear to not exist.

Windows is (as I am sure you know) VERY picky about permissions, elevation
and data locations. So the only way to win the game is simply to play by
the rules.

Going forward Windows is only going to continue to get more and more
secure. So issues like having a proper installer, having the programs
manifested properly and code signed are going to continue to be the hoops
we have to jump through in order to have them run successfully on the
Windows platform.

Anyway I hope this helps!

Good luck on your projects!

Charles

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

cjeByteMeSpammers@lansrad.com (remove the "ByteMeSpammers" to email me)

www.learnh5fast.com - Master building web and mobile apps with Clarion H5!
www.clarionproseries.com - ProDocument, ImageEx, ProScan, ProImage, ProPath
and other Clarion developer tools!
www.seal-soft.com - The xProduct Clarion templates - xWordCOM, xToolTip,
xDataBackup Manager and more!
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.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms - Now with PNG support!
www.fotokiss.com - "World's Best Auction Photo Editor"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
-------------------------------------------------------------------------------------------------------

NewsArchive
09-14-2021, 02:06 AM
Hi Paul,

> As a follow up.....
>
> Why can't an 'asInvoker' install create any menu items or a desktop icon
> (shortcuts)?
>
> I need to load registry entries to the CU and create a shortcut.

asInvoker apps create "per-user" items. So you have to switch your
installer into "per-user" setup mode.

http://www.lindersoft.com/forums/showthread.php?48121-Failure-to-add-Start-Menu-asInvoker&p=91269&highlight=sb_alluserflag#post91269

Does this help?

Friedrich

NewsArchive
09-18-2021, 04:52 AM
Perfect! Thanks.

Paul MacFarlane

NewsArchive
09-18-2021, 04:53 AM
Thanks Charles.

Per your advice I did use a small help setup (silent mode) to load
registry settings and it's working great.

I'm going to do a Friedrich suggested to get the Icons on the user
desktop now.

Paul MacFarlane