Home All Groups Group Topic Archive Search About

Read/Write permission (earn your quarter, Karl!)

Author
1 Mar 2007 7:13 PM
Kevin Provance
Okay...seeing no one seemed to have any idea about the common folder issue,
lets try it from a different perspective.

Assuming the OS is Vista and my apps folder in Program Files is read only.

I have had in my code for some time now a component (I just love ActX DLLs,
can ya tell?) that checks for a new version of my program via my website and
if it finds one downloads the new version, of course after asking the user
if they want to do so.

Currently, the component downloads the file with a different extension,
shuts down the program, renames the new file and restarts the updated
version (well, with the help of another exe, but that's not the question).
The question is...if my program folder is read only under Vista, just where
exactly am I supposed to download the updated file to?  The Temp folder?  If
so, am I going to be able to move it back to my program folder, even using
the Shell API for file moving?  Is the Common Files folder a read only
folder as well?

MSDN does not seem to spell these things out very clearly, especially where
VB6 is involved.  So if anyone has any idea, any guidance would really be
appreciated.

Thanks!

- Kevin

ps - Bite Karl!

Author
1 Mar 2007 7:46 PM
Karl E. Peterson
Kevin Provance <ca***@tpasoft.com> wrote:
> The question is...if my program folder is read only under Vista, just where
> exactly am I supposed to download the updated file to?  The Temp folder?  If
> so, am I going to be able to move it back to my program folder, even using
> the Shell API for file moving?

I'm guessing(!) the app will need to <music of doom>"run with elevated
privs"</music> to do this.

> Is the Common Files folder a read only folder as well?

Dunno.  More than likely?

> ps - Bite Karl!

Ooooh, unauth!
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
2 Mar 2007 1:47 AM
Stefan Berglund
On Thu, 1 Mar 2007 14:13:34 -0500, "Kevin Provance" <ca***@tpasoft.com>
wrote:
in <egI#0WDXHHA.4***@TK2MSFTNGP06.phx.gbl>

Show quoteHide quote
>Okay...seeing no one seemed to have any idea about the common folder issue,
>lets try it from a different perspective.
>
>Assuming the OS is Vista and my apps folder in Program Files is read only.
>
>I have had in my code for some time now a component (I just love ActX DLLs,
>can ya tell?) that checks for a new version of my program via my website and
>if it finds one downloads the new version, of course after asking the user
>if they want to do so.
>
>Currently, the component downloads the file with a different extension,
>shuts down the program, renames the new file and restarts the updated
>version (well, with the help of another exe, but that's not the question).
>The question is...if my program folder is read only under Vista, just where
>exactly am I supposed to download the updated file to?  The Temp folder?  If
>so, am I going to be able to move it back to my program folder, even using
>the Shell API for file moving?  Is the Common Files folder a read only
>folder as well?
>
>MSDN does not seem to spell these things out very clearly, especially where
>VB6 is involved.  So if anyone has any idea, any guidance would really be
>appreciated.
>
>Thanks!
>
>- Kevin
>
>ps - Bite Karl!
>

I didn't use a component but I had code in my app that along with a
helper app updated both the exe and the helper app exe.  To deal with
Vista I just modified it slightly by changing the update package to an
Inno install package that just does an install over the existing
installation which is also an Inno setup.  I threw out all the self
updating code and it's actually much cleaner.  The app just downloads
the update package, starts it and then exits and the user clicks Next
and Install and voila.  As an added touch the installer restarts the app
when its done.