PDA

View Full Version : SB small exe as invoker under w7 64



NewsArchive
07-21-2009, 02:32 AM
Hi all,

I use a small SB exe compiled asInvoker to read HKCU keys and copy them to HKLM
All works perfectly except under this OS were it does not do it

If I compile it as requireAdmin it works fine but of course pops up that nasty windows protection uac message

is there no wat to avoid this pls ?

Merci

JP
--

Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:33 AM
it seems under w764 this sb line of code returns USER when I am logged as user with admin rights ??

If %PRIVILEGES% Does Not Equal "Admin" Or %PRIVILEGES% Does Not Equal "ADMIN" Then



Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:34 AM
same pb under windows 7 32 bits ..... the exe does not write to HKLM .....


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:34 AM
> I use a small SB exe compiled asInvoker to read HKCU keys and copy them to HKLM
> All works perfectly except under this OS were it does not do it
>
> If I compile it as requireAdmin it works fine but of course pops up that nasty windows protection uac message
>
> is there no wat to avoid this pls ?

JP,

That is Standard Windows Behavior.

I take it that you are running the small exe non-elevated from your regular
SB installer to read the HKCU Registry.

That is fine, but like any other program when you ask it to do a function
that requires elevation ( write to HKLM ), you will get the UAC prompt.

The only solution that comes to mind would be to have the small exe write
the data out to an INI file in the Windows Temp folder, then when that exe
terminates you could continue with the elevated installer and read it in
and then have the elevated installer write to HKLM.

I have not tried this, but it might work.

:-)

Charles





--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.clarionproseries.com - "Get ProPath, make your Clarion programs ready
for Windows 7 and Vista!"
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.clarionproseries.com - "Serious tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
07-21-2009, 02:35 AM
Charles,

Actually my main pb is that this script line returns USER when w7 logged in as user with admin rigths
If %PRIVILEGES% Does Not Equal "Admin" Or %PRIVILEGES% Does Not Equal "ADMIN" Then

is there another way of doing maybe ?

I need from my unelevated app to call a SB exe to know if I an admin or not ....


For the other part I added the copy HKCU to HKLM in updater if the values are different and different from DEMO (lic registration in the app written to HKCU only as non
elevated)

Merci

JP


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:35 AM
Vista 32 it sends back in same user type ADMIN .....


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:36 AM
btw tried compiling in SB 7and same result ....


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:37 AM
no I am wrong .... something else is hapening ....
will try to find what to not end this day without learning something ... ;)


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:37 AM
Charles,

It "would" seem (to be verified) that if the exe is code signed under W7 32 and 64 then only will it read properly and return ADMIN ....

If you maybe could check this at your end ..... to confim or send me back to school ;)

Merci

JP

Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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
07-21-2009, 02:38 AM
> If you maybe could check this at your end ..... to confim or send me back to school ;)

I don't have a test machine setup to match your configuration right now to
be able to test that.

Sorry!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.clarionproseries.com - "Get ProPath, make your Clarion programs ready
for Windows 7 and Vista!"
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.clarionproseries.com - "Serious tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
07-21-2009, 02:38 AM
JP,

This sounds like expected behavior.

With the split token under Vista or later, an administrator account is NOT
"admin" UNLESS RUNNING ELEVATED or unless UAC is turned off.

If you could get around that "nasty protection message" without running
elevated, so could malware.

Also be aware that you will have trouble invoking an elevated exe from a
non-elevated one if you try RUN or CHAIN. You need to use ShellExecute.

Jane

NewsArchive
07-21-2009, 02:39 AM
Hello Jane,

Thanks for these infos which indeed seem to comfort what I found during tests

The message is not the pb as after all it is user who defines to use or not UAC ....

My main pb was the script line not returning 'admin' but indeed when the exe is signed then it does return properly

M$ really succeeded in complicating things to an extroardinary level and thank SB and all the people working there it becomes kindergarden play for us now with SB

Thanks again Friedrich ;)


Cordialement - Best regards
Jean-Pierre GUTSATZ

CGF

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"