Re: Deployment under Vista
- From: "Sally" <me@xxxxxxxx>
- Date: Sat, 28 Jul 2007 06:55:52 +1000
**SEE END CONCLUSION BEFORE TEARING OUT HAIR DURING READING RESPONSES
"Rick Raisley" <heavymetal-A-T-bellsouth-D-O-T-net> wrote in message >> 1)
The Install suggests that the app is placed in C:\Programs. I accept
that default.....
The Install suggests putting the app where you set it to. A subdirecectory
of C:\Program Files would be the norm. I would hesitate making a new
directory under root (C:\Programs), but would prefer the more standard
location (suggested install directory would be c:\Program Files\Fred).
**Sorry. Inexact verbiage by me. I meant Program Files
Make sure your install has the word "SETUP" or "INSTALL" in it.
FredSetup.exe would be fine. This tells Vista that you are installing a
program (which it usually can guess anyhow, but this is safer), and
automatically requries Administrative rights to do. You will need that to
both write to the Program Files directory, as well as install any runtime
files.
**Not sure what you mean here. The PDW automatically puts Steup.exe on the
CD
2) As for the data files, I have hardcoded within my app to create a
directory C:\FredsData, and then lines like this
NEVER hardcode the data file or directory, if you can get away with it.
First, that's adding another directory. Second, the user might prefer to
install on a different drive. There are lots of reasons. Under previous
OS's, you might make the data directory a subdirectory of the program
directory, like:
c:\Program Files\Fred\Data
That works great with XP, and has the advantage that you application can
look it its App.Path (C:\Program Files\Fred) in the \Data directory below
that to determine data location. You might have a line like:
LedgerFile$ = App.Path & "Data\Ledger.dat"
(I forget whether App.Path will end up with a final "\", so you will need
to
have a function or check for that. I use an AddSlash function that checks
for a slash in the rightmost character, and if there isn't one, adds it.
Now, that's all well and good for XP.
***Ideally I want the PDW to produce a disc that will work in *both* XP and
Vista
Open "C:\FredsData\Ledger.Dat" For Random As #1 Len=255
Don't hardcode in filenumber #1. Find it first using Freefile.
ff = FreeFile()
Open LedgerFile$ #ff Len=255
As I said, it all works under XP Home.
Right. Now, I've steered you above to a couple things:
1) Don't hard code install or data paths.
2) Install your app in a subdirectory of the Program Files directory.
Problem is, you're breaking the Vista rules by putting data in a Program
Files directory. More on that later.
***Here's where I'm lost.
Now, a colleague is running Vista and I want to post him a CD so that hecan
install my app and use it. BUT, I don't want to risk messing up hissystem,
which runs many critical applications. It is not so serious if he hasto
trouble running mine. But it would certainly be serious if in attempting
install mine some files or settings on his Vista were messed up. That wasmy
anxiety.
A proper install should not mess up Vista or his apps.
***But that's my problem! Esuring it's a *proper* install
So far, I think I have gleaned thatwail
A) Any files apart from my app that PDW bundles on the deployment disc
not overwrite any of his that might be later (that cures one worry... IF
I've got that right.
Done properly, that is the case. You can make the PDW screw things up by
intentionally overwriting runtime files, but that's not normal (or good
practice).
B) The app should not go in root (meaning C: direct). In that respect
perhaps Vista makes a similarly appropriate default suggestion to the
Programs directory in XP Home?
Correct. Nothing should be written there. But your app should go in a
subdirectory of the Program Files directory.
***Oh a *subdirectory* eh? I don't think the PDW does that if the user just
accepts the default suggestion, when he installs from the CD
Sorry, I just occurred to me that perhaps the default program directory
for
Vista IS C:\Programs, rather than C:\Program Files as in XP. Please ignore
those comments if that is the case. Sorry, don't have Vist in front of me.
*** Neither do I or it would come faster to me as I tried it, I'm sure
C) The data files should not go in root. In that respect, perhaps my
hardcoded C:\FredsData\... will do the trick?
Discussed above. That would work, but isn't good, isn't related to your
app,
is hardcoded, etc.
A, B and C really encapsulate my concerns.
Well, no, it shouldn't. You need to have additional concerns, I'm afraid.
While installing as an Admin (the norm) will insure that your app should
install properly, and your program files data will be put into the
appropriate locations, there are functional problems:
Vista does not want the USER to change any files in the Program Files
directory. Fact is, Vista doesn't want you to change any files /anywhere/
except within the User's personal directories. Like in Documents. The
RIGHT
way here would be to put your Fred directory in the User's folders
somewhere. Don't have Vista in front of me, what is it, the user's Update
or
something like that? You can use environment variables to determine it
(sorry about being nebulous here - I don't have the info at hand, and not
much time to reply, but wanted to get something to you before the
weekend).
**OK. Here I'm lost because I don't have Vista. I am coming to the
conclusion that I should not proceed further with this endeavour until I
have a Vista machine myself and can test and get used to the ides of user
folders/directories, permissions etc. Perhaps a lot on this is like trying
to learn to drive without having a car. I have XP Home all right but not
Vista.
Similary, I am reading a book at present called "Learning to Fly
Helicopters". Not making much sense, although I have flown fixed wing.
Anyhow, the idea is that Vista lets you save, change and delete any files
within the USER's folders. And that data should be in a subfolder named
for
your app, normally, although Documents is used a lot, obviously. If you
run
the app with your data files in the location you (or I) specified above
(in
a subdirectory under root, or under the app's Program Files directory),
one
of two things will happen: Vista will prevent the file from being saved
(program may crash). Or it will "Virtualize" the location, by storing it
in
a secret location you will have trouble finding, but it will LOOK to the
user like it's where you wanted it to be. As long as only one person uses
it, that might work okay. But if another person would log into that
computer, he would find the original, untouched files, and would not be
able
to see those the other user changed.
The answer is either:
1) - The RIGHT thing - Determine the correct common users folder (again,
no
reference right now to help you), save the data there, which Vista will
allow, and the same data can be shared between users. Requires program
changes.
2) The Other RIGHT thing - Determine the user's folder that he has
write-permission to, and save the data there, which will work fine but
can't
be shared between users. Requires program changes.
3) The WRONG thing - Run the program as an Administrator, which WILL allow
the data files to be saved in the locations you specified above. While not
right, this is a stop-gap that allows many people to run pre-Vista
programs
on Vista. I use it now for my older applications, until I can rewrite them
to do things one of the right ways. This will require the least rewriting
of
your program (possibly none), but is really "cheating".
Hope that makes sense and helps you out some.
--
Regards,
Rick Raisley
Thank you Rick. I conclude that I really need Vista to fully understand what
you've said and ensure that this will run under it.
.
- Follow-Ups:
- Re: Deployment under Vista
- From: Karl E. Peterson
- Re: Deployment under Vista
- References:
- Deployment under Vista
- From: Sally
- Re: Deployment under Vista
- From: Rick Raisley
- Deployment under Vista
- Prev by Date: Re: vb.net 2 programatically remove authenticated users group add IIS_
- Next by Date: Re: Is there a easy way to make a form stay with another form and in front of it
- Previous by thread: Re: Deployment under Vista
- Next by thread: Re: Deployment under Vista
- Index(es):
Relevant Pages
|