Particular question about a Setup and Deployment project.

Hello everybody!

I'm quite new to Visual Studio and I'm having a hard time finding out this.
I have a working project right now, which installs perfectly. It installs some application files and some help files.
What I need now is the help files, instead of being inside the .msi package, to be outside, just in a folder. For example, in the installation folder I have the setup.exe, the .msi package, and the Help folder. So, when I run the setup, I need it to perform as usual, with the only difference that the help files are copied from that folder and not from inside the .msi file. The destination folder of the help files is not changed, so the shortcuts must remain as they are now.
In other words, I need the installer to take the files of this folder directly from where I added them to the project, so I can update the help files without having to rebuild the setup.

Is there a way to do this in a simply manner Or do I need to code all the copying and shortcut creation in the Install custom action

Thank you in advance!!

Andrew



Answer this question

Particular question about a Setup and Deployment project.

  • bennymacca

    I don't think there is unfortunately but could be wrong. the MSI/setup packages files in its own special way.

  • FZelle

    Actually, it is possible to package some files with the MSI and leave other external. If you view the properties on the file you want to package loose, there is a PackageAs property. Change this value from vsdpaDefault to vsdpaLoose. Unfortunately, the files do not appear in a sub-directory, but instead live next to your MSI.

  • Richard Russell

    When MSI is calling an installer class you are running on top of msiexec.exe - it's a Dll being called by the install, not an app running in your installed application folder. If you want that, then make your custom action an executable then it will run in your app folder. The other alternative is to pass /targ=[TARGETDIR] in your CustomActionData and then get the resolved location in the Context.Parameters dictionary with the key "targ".

  • magicalclick

    There is a walk-through that talks about how to use CustomActionData: http://msdn2.microsoft.com/en-us/library/9cdb5eda.aspx. For example, in your installer class's Install method you would have something like:

    MsgBox(Me.Context.Parameters.Item("source"))

    And the CustomActionData property in the Custom Action Editor should be:

    /source="[SourceDir]\"

    Note the trailing slash there is very important.



  • Serge Lobko-Lobanovsky

    Thank you very much!
    The option you say must be this one:
    http://msdn2.microsoft.com/en-us/library/1befw7hy.aspx

    I'm using VS.NET 2003, and I can't find that option there... Anyway, it doesn't matter as it's not what I really need, although it was the better approach! :)
    Too bad there is no simple way to do this... I'll check with my boss if he prefers to do this by coding (it's possible, right ) or wait until we change the installer.


  • AmrishDeep

    There's an option in the project properties (Package Files as loose uncompressed files) to have ALL the files outside the MSI (which is fine for CD images) so the help file is available. There isn't a "some in and some out" option.

  • grievesy

    Im working on pretty much the same problem.  Ive created a class library project, added an installer class, overriden the install method, and added the dll to the custom actions of the setup project.  Something along similar lines to this http://www.codeproject.com/netcf/PackagingAndDeployingPPC.asp df=100&forumid=38007&exp=0&select=1315200.  This all works great, I can write my own custom code in the installer to copy the folder over.  However finding the path where the installer is being executed has become a problem.  Since the users could be installing from different cd drives or somewhere on their local machine i need some way of getting the path to the folder i want to copy over at install time (which would be in the same place as the setup.exe and .msi package).  Ive tried a few things but they dont seem to work.  Code like this:

    string sourcePath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), @"\drivers");

    would get the path of where a regular .exe was executing from but doesnt seem to work for deployment projects.  Not being able to debug the install doesnt help much either(or is there a way im not seeing here ).  So if there is a way to get the path where the installer is being executed from it should be very easy to copy the directory over.  Im working on it still, hopefully there is a solution...


  • Particular question about a Setup and Deployment project.