PDA

View Full Version : OT: Copying files under Clarion *program* control.. under Vista



NewsArchive
04-23-2008, 02:51 AM
Not a SB question.. but this forum appears to be the most Vista-aware <g>


How do I copy under Vista?

Admin. privileges required (if UAC is on).
But we don't give our apps. admin privileges do we?

So if I want to just copy and over-write a file across a network 'inside' my
app. (as I am currently doing with W9x thru to XP),... what steps do I take?

Steve

NewsArchive
04-24-2008, 02:01 AM
Hi Steve,

> Not a SB question.. but this forum appears to be the most Vista-aware <g>
>
> How do I copy under Vista?
>
> Admin. privileges required (if UAC is on).
> But we don't give our apps. admin privileges do we?
>
> So if I want to just copy and over-write a file across a network 'inside'
> my app. (as I am currently doing with W9x thru to XP),... what steps do
> I take?

Correct. By default, your application should *not* run elevated. If your
(asInvoker) application is located under Program Files it is not running
elevated then you can't copy files to your application folder.

What you can do in this case is to detect (from within your application) if
it is running elevated under Vista. If this is not the case, display a
message and ask the user to close/restart the application with "Run as
administrator...". Then you can copy files to the Program Files folder.
Not ideal and not recommended.

Or call an external application (e.g. a simple SetupBuilder helper
application) that executes elevated and copies the files for you. Use the
ShellExecute Windows API to run the elevated SetupBuilder application (from
your unelevated application).

Does this help?

Friedrich

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

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-24-2008, 02:01 AM
Hi ,

It's not copying to the program's Program Files.. but is copying across the
network to another computer.

There should be no humanoid interation, so asking them to do anything is not
on.

It's *not* part of the installation process - it's part of normal
operation.. (so a SetupBuilder helper application is not applicaable?.. What
is a SB helper app?)

Steve

NewsArchive
04-24-2008, 02:02 AM
Steve,

> It's *not* part of the installation process - it's part of normal
> operation.. (so a SetupBuilder helper application is not applicaable?..
> What is a SB helper app?)

SetupBuilder compiles native Windows applications. In other words, you can
use SetupBuilder to even develop "non-installation" Windows applications.
Quite a few thousand developers are already using SetupBuilder for
non-installation tasks <g>.

For example, you would like to develop a tool that can be used to copy
files? No problem. SetupBuilder can do it. Or you need a helper tool to
check if an application has a valid code-sign signature? Use SetupBuilder
to develop that tool. The resulting .exe size will only be 130 KB. You
have to move registry keys in the Windows Registry? SetupBuilder has more
than 600 built-in functions and provides a function to move registry keys.
You have to download files from your Internet server and send a message to
you when done? SetupBuilder! Of course, you can distribute such
applications royalty free.

Friedrich

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

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-24-2008, 02:03 AM
By the way, request administrator execution level privileges will cause a
Vista elevation prompt. So this cannot be done "silently".

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

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-24-2008, 02:04 AM
But if I RUN another app from my app, and this second app has admin prov.,
then no warning?

Steve Bywaters

NewsArchive
04-24-2008, 02:04 AM
Hi Steve,

> But if I RUN another app from my app, and this second app has admin prov.,
> then no warning?

1) If your app "A" does NOT run elevated and you start another app "B"
elevated then the other app "B" will cause a Vista elevation prompt.

2) If your app "A" runs elevated and you start another app "B" elevated then
the other app "B" will NOT cause a Vista elevation prompt. But your main
app "A" will cause a Vista elevation prompt at startup.

So whatever you do, you'll see at least one elevation prompt.

Friedrich

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

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-24-2008, 02:05 AM
Damn Microsoft and their stupid attempts at fixing their security problems.

--

Ben E. Brady
Want MASSIVELY OUTRAGEOUS web disk space and bandwidth?
500 GB disk space and 5000 GB transfer per month,
http://www.servage.net/?coupon=CUST13495

www.clariondeveloper.com
www.singularvisionsoftware.com

The information contained in the message above, as expressed by the author,
is copyright 2008 by Ben E. Brady, All rights strictly reserved worldwide.
The information contained in the message above may not be posted on any
other information forum or web site without the express written permission
of the author. All opinions expressed in the message are those of the author
and are not necessarily shared by other members of the newsgroup and may or
may not be in agreement with SoftVelocity, the host of this newsgroup.

NewsArchive
04-24-2008, 06:48 AM
This is just garbage, isn't it?

Not the truth of your response, I hasten to add <G>.. but what a crap system
MS have imposed here.....

thanks
Steve

NewsArchive
04-24-2008, 07:23 AM
Hi Steve,

If this is part of an installation or upgrade process then you should run an
installer to do this for you, which will run elevated.

The recommended approach is to move functionality that requires
administrative access to a separate application that is called from your
application, and includes a Vista manifest indicating that it requires
administrative privileges to run. You can either call this each time
elevation is required, or start it and then each time you need to perform a
task that requires elevated privileges just send a request to the
application (for example using NetTalk).

Much like the security approach that MS chose for Outlook (and then
completely backpedalled on in Office 2007), they didn't think through UAC
very well. Apparently allowing signed executables to be "trusted" either
didn't occur to them or is outside of their capabilities, in which case they
need new staff <g>.

--
Regards,

Sean Cameron
Capesoft
www.capesoft.com

Work Smarter, Not Harder!

NewsArchive
04-24-2008, 07:24 AM
It's not part of the installation process - it's part of normal operation of
the program.. copying files across a network.

So my app - instead of doing the copy itself - RUNs another app, with
elevated privileges *just* to do this?
Sheesh! Progress?

Steve

PS Thankfully , I ordered XP on my *own* new laptitop <g>

NewsArchive
04-24-2008, 07:24 AM
> It's not part of the installation process - it's part of normal operation
> of the program.. copying files across a network.
>
> So my app - instead of doing the copy itself - RUNs another app, with
> elevated privileges *just* to do this?
> Sheesh! Progress?
>
> Steve
>
> PS Thankfully , I ordered XP on my *own* new laptitop <g>

SetupBuilder compiles native Windows applications. In other words, you can
use SetupBuilder to even develop "non-installation" Windows applications.
Quite a few thousand developers are already using SetupBuilder for
non-installation tasks <g>.

For example, you would like to develop a tool that can be used to copy
files? No problem. SetupBuilder can do it. Or you need a helper tool to
check if an application has a valid code-sign signature? Use SetupBuilder
to develop that tool. The resulting .exe size will only be 130 KB. You
have to move registry keys in the Windows Registry? SetupBuilder has more
than 600 built-in functions and provides a function to move registry keys.
You have to download files from your Internet server and send a message to
you when done? SetupBuilder! Of course, you can distribute such
applications royalty free.

Friedrich

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

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-24-2008, 07:25 AM
>> It's not part of the installation process - it's part of normal operation
>> of the program.. copying files across a network.
>>
>> So my app - instead of doing the copy itself - RUNs another app, with
>> elevated privileges *just* to do this?
>> Sheesh! Progress?
>>
>> Steve
>>
>> PS Thankfully , I ordered XP on my *own* new laptitop <g>
>
> SetupBuilder compiles native Windows applications. In other words, you can
> use SetupBuilder to even develop "non-installation" Windows applications.
> Quite a few thousand developers are already using SetupBuilder for
> non-installation tasks <g>.

Friedrich,

As you already know, Charles Edmonds of LANSRAD is using SetupBuilder for a
configuration wizard for his PageSnip line of products - AND it just plain
works well! So if anyone is interested in seeing a "non-installation"
Windows application in real use - download the demo!

Product Description - PageSnip Professional, MFG - LANSRAD
Internet Link - http://www.pagesnip.com/

David

--
From David Troxell - Product Scope 7 - Encourager Software
Clarion Third Party Profile Exchange Online
http://encouragersoftware.com/profile/clarlinks.html
http://www.encouragersoftware.com/
http://www.profileexchanges.com/blog/

NewsArchive
04-24-2008, 07:26 AM
Steve,

Just so I'm clear on this. You are copying from a network drive down to
your local C: drive's "Program folders" area. Right? Because I can copy
from one network drive to another network drive under Vista all day long.

-Mike

----------------------
I have long been of the opinion that if work were such a splendid thing the
rich would have kept more of it for themselves.
-Bruce Grocott

NewsArchive
04-24-2008, 07:27 AM
No
* actually the other way around: FROM Program Files, across the network
* and you hae UAC turned off!!
* if not, then you are using Administrator priv.

Steve Bywaters

NewsArchive
04-24-2008, 07:28 AM
Just because an application is signed it does not mean it is "trusted",
it just means you know where it came from.

Dave Nichols

NewsArchive
04-24-2008, 07:28 AM
What is the point of signing an application? It ensures that you know the
source, and hence can make decision as to whether or not you trust that
application. If the application remains signed, and has not been modified (a
simple hash ensures this) then if you trust an application to perform a task
once, you should be able to trust that same application to always perform a
task. This is the whole point of "trust" as a concept. This provides far
more robust security than UAC does with a minimal burden on the user. UAC is
worse than useless - it is onerous and ineffective. If your end user has to
click the Allow button every time your program performs a task that requires
elevated privileges, then they will always press the Allow button. They will
get remarkably good at pressing the button rapidly, and after a remarkably
short time they chance of not pressing the button (without even consciously
thinking about it) becomes very, very small. You are leveraging the human
ability to learn and muscle memory. Assuming that in the one instance in
10000 that the user should press Deny, that they actually do so is patently
ridiculous.

--
Regards,

Sean Cameron
Capesoft
www.capesoft.com

Work Smarter, Not Harder!

NewsArchive
04-25-2008, 01:35 AM
Just like the "Do You Accept" license agreement screens. Nobody reads the
crap they put in there, they just click "yes" and install.

db