Re: Deployment under Vista
- From: "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-T-net>
- Date: Fri, 27 Jul 2007 16:18:56 -0400
"Sally" <me@xxxxxxxx> wrote in message news:46aa4934$1@xxxxxxxxxxxxxxxxxxxx
at
Unfortunately the sheer volume of information and some of the (inevitably)
differing opinions made me even more confused. People who have pointed me
what to them are obvious things understandably get annoyed when I appearnot
to have noted them, but in some cases their assertions have been disagreedthere
with by others. Added to that is my habit of replying on the fly, when
are more posts to come. Also, I haven't figured out a way of going backback.
through a thread, so once I've replied to the last post I lose the thread
(literally). I am using CTRL-U to advance through unread messages and my
Outlook (NOT Outlook Express) apparently does not easily allow me step
Unfortunately, Outlook is not a newsreader, so does not work very well for
that purpose. I recommend you use Outlook Express, which will simplify
things a lot. Lacking that, another third party program. I use Outlook at
work, but OE to read news messages.
that
Anyway, this app works perfectly under XP Home. I have used the PDW Wizard
to deploy it, and the result is
1) The Install suggests that the app is placed in C:\Programs. I accept
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).
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.
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.
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.
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.
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.
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.
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).
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
.
- Follow-Ups:
- Re: Deployment under Vista
- From: Sally
- Re: Deployment under Vista
- From: Karl E. Peterson
- Re: Deployment under Vista
- References:
- Deployment under Vista
- From: Sally
- Deployment under Vista
- Prev by Date: Re: Strange problem with PDW
- Next by Date: Re: Strange problem with PDW
- Previous by thread: Re: Deployment under Vista
- Next by thread: Re: Deployment under Vista
- Index(es):
Relevant Pages
|