|
-
Aug 20th, 2009, 10:48 AM
#1
Thread Starter
Addicted Member
How to deploy support files to special folders?
Hi,
As the title says, I need to deploy some support files (used by my application) and was wondering what is the correct way to do this for a .NET deployment.
In VB6 I used to use Inno and would do something like :
Source: "c:\DllLatestVersions\MyFile.xml"; DestDir: "c:\Documents and Settings\All Users\Application Data\MyCompany\SupportFiles"; MinVersion: 4.0,4.0; Flags: ignoreversion
I already have a CustomInstallActions class in my project that is used during deployment to ensure that all necessary folders are present and sets access permissions. Would that be the place to install the support files? If so, how would I do that.
I suppose an alternative would be to deploy the files to the ProgramFiles area along with the application and move them at run time if they are not found to be in the correct location. That seems a bit messy to me.
Just looking for some "best practice" guidance.
Any help appeciated, as always.
Using Visual Studio 2008.
I am not young enough to know everything - Oscar Wilde
-
Aug 20th, 2009, 03:04 PM
#2
Re: How to deploy support files to special folders?
You should get the installer to deploy to the correct locations (using shortcuts/API's/etc for special folders like "%CommonAppData%", rather than hard-coded paths like "c:\Documents and Settings\All Users\Application Data" which will fail in many cases).
Unfortunately I can't help with the details, as I haven't deployed any .Net projects.
-
Aug 21st, 2009, 02:49 AM
#3
Thread Starter
Addicted Member
Re: How to deploy support files to special folders?
Thanks for the reply,
The line of inno script example I gave was what I used to do with my old VB6 projects.
With my .NET projects I do use the installer (Custom Install Actions) to create the paths and user permissions using the special folders names.
The question is, once I have created the folder, what/when is the best way to put my support files into the folder.
Having been around these forums for some time now I have the greatest respect for your knowledge Si. I guess in this case I need the advice of someone with knowledge of .NET deployment.
Using Visual Studio 2008.
I am not young enough to know everything - Oscar Wilde
-
Aug 28th, 2009, 02:02 PM
#4
Re: How to deploy support files to special folders?
i would use SHGetFolderPath to get the path. I have support files i install with my vb6 project located in a resource file, they are not installed by my installer. The files are only extracted if they do not exist. Maybe the same could be done with vb.net.
Typical paths: (Not hardcoded) :
Using XP
C:\Documents and Settings\AllUsers.WINDOWS\Documents\YourApp\SupportFiles
Using Vista
C:\Users\Public\Public Documents\ YourApp\SupportFiles
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Aug 28th, 2009, 02:36 PM
#5
Re: How to deploy support files to special folders?
One of the reasons you want a better version of the .Net products is to get some of the professional features. One of these is the ability to use setup projects in Visual Studio.
I believe that even VS .Net Standard includes these features. Express isn't really meant for serious use though. I'm afraid it is producing a whole new generation of programmers who don't comprehend deployment matters. At a (list price?) of $300 though... well somebody has to keep Anders Hejlsberg in furs I guess.
-
Aug 28th, 2009, 02:58 PM
#6
Re: How to deploy support files to special folders?
Visual Studio has a ClickOnce setup which can easily be used to deploy your .NET applications.
-
Aug 28th, 2009, 09:20 PM
#7
Re: How to deploy support files to special folders?
I don't take ClickOnce very seriously. It seems to be a leftover from very early this decade when .Net was being pushed as a tool for making "smart clients."
ClickOnce deployment or not?
-
Sep 1st, 2009, 03:02 AM
#8
Thread Starter
Addicted Member
Re: How to deploy support files to special folders?
Thanks for the replies and my apologies for not responding sooner - it has been a holiday weekend in my part of the world.
I am using the Standard edition of VS and what I was really looking for was some advice on best practise for deploying support files.
The Custom Install Actions are executed after the packaged files are copied so, the way I have ended up doing it is to include the files in the package and then create my custom folder, move the files and delete the originals in my Custom Install Actions class.
Still not sure if this is the best method but it does work.
Using Visual Studio 2008.
I am not young enough to know everything - Oscar Wilde
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|