Installing data files with application?

  • Thread starter Thread starter Tracks
  • Start date Start date
T

Tracks

I include some sample binary data files (produced by my software) with my
application installation for the user to do what they want with. I put the
files in the Users Personal Data Folder/(myappsname) with VS 2005 installer -
File Types screen. All is well until the user changes the name of the file (I
want the user to be able to do this, move, or delete the files). When the
user changes the name, and then starts my application, the system tries to
re-install the file (and looks for the myaps.msi) instead of just starting my
application up. Not what I want. I dont care what the user does with the file.

I cant figure where this behavior is defined. Is there a "dont try to
re-install this file if deleted" setting in the installer part of VS 2005?

I have set the files and the folder as Vital = false and Tranistive = True
(or false). What am I missing or doing wrong?

Thanks,

Tom
 
Tom,

Not that I know this behaviour, however if you send a message about folders,
than please tell as well on what OS.

By instance Vista has a (let me say) very new folder behaviour

Cor
 
From the documentation for setup projects:
"Developers must avoid authoring components that place files into one of the
User Profile folders. These files would not be available to all users in
multi-user situations and could cause the installer to permanently view the
component as requiring repair."

You can accomplish this, but I'm not sure if the VS2005 Setup project UI
gives you access to this (I use InstallShield). The property to look for for
the component is "Do Not Register." However, the best solution is to install
the data files to your App folder and copy them to the user's profile when
necessary (such as when the app runs for the first time).
 
CMoya's approach is kind of what we do. We install zip files to a "support"
folder under the main app dir. On first run by a user, we unzip the files
using CSharpZip lib to the user's folder.

Occasionally where we have huge data files (1GB+) we write a custom action
to install the data to a common for all users.

VS Deployment projects care about the zip files, but not the contents after
they are extracted, even when within a custom action.

I hope this helps.
 
Thanks,

It does it in Vista Home Premium and XP something and others. So I assume
all that the .net 2 framework runs on.

Yeah I am up on the Vista issues some and how the folders have changed. It
is not that cause I am having the same thing on XP? More in next response.
 
Yeah, hmmm. Welp thats what is happening all right. When the user starts my
app somehow the system knows the file(s)/folder is not there (they are set
for donotregister, and not vital- my app adds nothing to the registry that I
see) and tries to install the missing file (then it cant find the .msi file
cause it was installed from a self extracting download but thats another
issue)

But I thought we were supposed to put user data in local user folders?
Especially in VISTA (I target all OS from 98 to Vista everything .net2
supports)?

I purposly changed it from the app folder cause disscussions here and
elsewhere made me decide that is where it should go.

My program is a CAD program and the files are just CAD drawings. So its like
Sample letters in Word. The user can copy from the sample library drawing
files, add to them, even move and delete them.

Where do they go?

What do I do to allow the user to delete them or move them or modify them?

I guess I will have to put them in the app folder and tell my users they
cant be changed?

Yeah Install sheild. I hate to fork out, whats an upgrade these days $700
when .net is now just XCOPY, right? Yeah right. But thats another thing...
and it has its own issues to solve.

Thanks,

Tom
 
I see. Thanks.

I was debating something like that also.

It still seems to me there is something not right here.

Does the unzip method work properly in Vista? What if there are two or more
users on one PC or Network? Does your program keep track of which users had
the files extracted into their local user folder? And if the user changes
their name does your program figure that out too? Just thinking out loud here.
 
If the user is allowed to "Rename" the data files, then they should be put
in his/her "My Documents" folder. If they are put in the "My Documents"
folder then they probably should NOT be uninstalled when your app
uninstalls... I mean after all, MS Word doesn't delete all your doc files
when you uninstall it, right? So there is no need to keep track of them.
 
I agree. I dont want to keep track. I was just thinking, if I understand what
was meant, that the app runs the zip file once, marks something as ran the
zip file, and saves it. Then what if another user, logged in with another
account, starts the app, that user wont have the files. That is the catch 22
that your ref doc states. So we should avoid it. Got it.

So yeah, I dont want to keep track of this. I wish the .msi installer
whatever did with the operating system somehow. I admit this is the limit of
my knowledge. I tried what I thought was right, used the installer thing in
VS2005 to specify what files to put in a users private data folder. I allow
to be installed for all users, I mark them as not needed everywhere I can
think, still gotcha. They cant be changed.

I dont see where the zip thing totally solves the problem. Maybe there is
something I am missing.

Seems I should be able to do this with VS2005? But, regardless, I am still
not sure what the "correct" way is. I dont know if I have exhausted what
VS2005 can do for me? ie INSTALL MY APPLICATION AND TELL ME HOW TO USE IT.

Thanks,

Tom
 
Once again,
1) Have Setup install the files (forget zip for now) into your APP FOLDER.
2) Create a Setting in your app (My Project -> Settings) called FirstRun and
scoped to USER.
3) When your app (your APP.EXE) runs check the setting and copy the files to
the users profile (where it will remain regardless of anything). (If
My.Settings.FirstRun Then CopyFiles...).
4) Set the setting so you don't do it again for that user. When a new user
comes along his setting wont be set.

This really isn't all that difficult. Maybe I'm missing something? :)
 
I see. A local user variable setting was what I was forgetting. Got those
and know how to use em! Sorta. I will try it.

Thanks for explaining,

Tom
 
That's actually a better way for most cases, than I was doing. I have an app
that has user modifyable data. I check for the existance of the data, and if
missing, extract to their personal folder.

As to the question regarding unzipping to Vista, so long as you are using
the CSharpZip and the .Net methods to find the special folders rather than
hard-wiring.
 
Back
Top