Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. setup project

setup project

Scheduled Pinned Locked Moved C#
questionworkspace
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dpriya
    wrote on last edited by
    #1

    Hi, How do I get the installation path that the user selects while installing ? If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime). Thankx in advance Priya

    T S H 3 Replies Last reply
    0
    • D Dpriya

      Hi, How do I get the installation path that the user selects while installing ? If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime). Thankx in advance Priya

      T Offline
      T Offline
      The_Soul_Of_Rock
      wrote on last edited by
      #2

      what kind of set up tool that you are using. Rock Throught The Night

      D 1 Reply Last reply
      0
      • T The_Soul_Of_Rock

        what kind of set up tool that you are using. Rock Throught The Night

        D Offline
        D Offline
        Dpriya
        wrote on last edited by
        #3

        I'm using VS.NET setup & deployment project

        1 Reply Last reply
        0
        • D Dpriya

          Hi, How do I get the installation path that the user selects while installing ? If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime). Thankx in advance Priya

          S Offline
          S Offline
          Serge Lobko Lobanovsky
          wrote on last edited by
          #4

          Hi, Priya You will need to add a custom action to your setup project. Pass the [TARGETDIR] variable to your custom action: CustomActionData = /instdir=[TARGETDIR]\\ (the last "\\" is neccessary for correct passing of paths) Get the "instdir" parameter in the custom installer class's Install method in the custom action project: [code] Dim instdir As String = Me.Context.Parameters("instdir") [/code] That's it Regards, Serge (Logic Software, Easy Projects .NET site)

          1 Reply Last reply
          0
          • D Dpriya

            Hi, How do I get the installation path that the user selects while installing ? If I had to copy a specific file from a folder in the local machine under the path where the application is installed , How do I do it ?(for eg : if I have a file named aaaa.dll which is tend to change frequently in the same folder as I have the setup.exe , if the installation path selected is C: and I have created 2 folders bin & data under it using File system editor in setup .How can I copy aaaa.dll to bin & data folder at runtime). Thankx in advance Priya

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            You can interop with the msi.dll COM server to get access to the database and package methods, or you can P/Invoke the exported C-style functions from the same DLL. You can query the component's installation directory at any time using MsiGetComponentPath, where you pass the ProductCode, the ComponentId, and a path buffer plus it's maximum declared size. See the Windows Installer SDK in MSDN[^] for more details. There's a catch, though: VS.NET's Windows Installer project sucks. It will generate new ComponentIds each time you recompile and doesn't let you specify a feature/component layout. I'd recommend getting a decent Windows Installer development environment like Wise for Windows Installer[^]. Finally, whether or not that file changes often Windows Installer is designed to allow for such changes and you should not copy the file manually. Windows Installer is an installation package manager - not just a simple install runtime. Just add the changed file to your setup project and make sure that the project's property "RemovePreviousVersions" is set to True and that the "UpgradeCode" never changes. Also change the "Version" according to how much changed (it's really up to you). If you'd like, you can generate a patch (.msp file) that is the difference between two installation packages. Again, though, because of the Windows Installer's short-comings this would be difficult and would require manual, post-build steps. This is the correct way to distribute updates to your product. If you're interested in Windows Installer, see Widnows Installer[^].

            Microsoft MVP, Visual C# My Articles

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups