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. Visual Basic
  4. How to Get the MSI installer Path

How to Get the MSI installer Path

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialworkspace
8 Posts 3 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.
  • C Offline
    C Offline
    coolpjmartin
    wrote on last edited by
    #1

    Hi I have created a .NET application with a custom installer, that all works fine. After the installation process I need to access a file that is located inside the folder where the MSI installer / setup is located. The problem I have is I cannot work out how to get the path for the MSI installer / setup. Can anybody please help and advice me the best way to get this path while I am still inside the "Commmited" of the installer vb.net or C# either will be fine. Thanks

    T D 2 Replies Last reply
    0
    • C coolpjmartin

      Hi I have created a .NET application with a custom installer, that all works fine. After the installation process I need to access a file that is located inside the folder where the MSI installer / setup is located. The problem I have is I cannot work out how to get the path for the MSI installer / setup. Can anybody please help and advice me the best way to get this path while I am still inside the "Commmited" of the installer vb.net or C# either will be fine. Thanks

      T Offline
      T Offline
      The Man from U N C L E
      wrote on last edited by
      #2

      you can use the SourceDir property of the Windows Installer. You can pass this info as a CustomAction in your deployment project : /SrcDir="[SourceDir]\" You can then use it in c# with : this.Context.Parameters["SrcDir"] or in vb with : Me.Context.Parameters("SrcDir")

      If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

      C 1 Reply Last reply
      0
      • C coolpjmartin

        Hi I have created a .NET application with a custom installer, that all works fine. After the installation process I need to access a file that is located inside the folder where the MSI installer / setup is located. The problem I have is I cannot work out how to get the path for the MSI installer / setup. Can anybody please help and advice me the best way to get this path while I am still inside the "Commmited" of the installer vb.net or C# either will be fine. Thanks

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Your installer should not be accessing files from the folder that the .MSI was launched from. Any files it needs should be inside the .MSI itself. Windows Installer, AFAIK, doesn't have a facility to tell the code inside an .MSI where it was launched from.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        T 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Your installer should not be accessing files from the folder that the .MSI was launched from. Any files it needs should be inside the .MSI itself. Windows Installer, AFAIK, doesn't have a facility to tell the code inside an .MSI where it was launched from.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          I beg to differ. We often use Active Directory to roll out updates and installs company-wide. It is a common requirement to pick up some client specific customisation data which they supply in an xml file accompanying the msi. When installing the same update across multiple clients it would be impractical to do a specific build for each client containing their special data to roll out to the end users.

          If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

          D 1 Reply Last reply
          0
          • T The Man from U N C L E

            I beg to differ. We often use Active Directory to roll out updates and installs company-wide. It is a common requirement to pick up some client specific customisation data which they supply in an xml file accompanying the msi. When installing the same update across multiple clients it would be impractical to do a specific build for each client containing their special data to roll out to the end users.

            If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Fair enough. We just never do that around here. In our apps, we have client specific information in the users metadata in our databases. No need to send an XML file with each install.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            T 1 Reply Last reply
            0
            • D Dave Kreskowiak

              Fair enough. We just never do that around here. In our apps, we have client specific information in the users metadata in our databases. No need to send an XML file with each install.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              T Offline
              T Offline
              The Man from U N C L E
              wrote on last edited by
              #6

              I have to say the only bit we let them customise at this point is the webservice URL of their server. We said to them, just tell your end users what to type in when it is prompted on first run. Not an accepted, but as they say, 'the client is always right', at least until they pay the invoice.

              If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

              D 1 Reply Last reply
              0
              • T The Man from U N C L E

                I have to say the only bit we let them customise at this point is the webservice URL of their server. We said to them, just tell your end users what to type in when it is prompted on first run. Not an accepted, but as they say, 'the client is always right', at least until they pay the invoice.

                If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Thankfully, just about all of my work in internal. I don't have very many clients on the outside and don't have to customize anything for a client before it goes out the door. :thumbsup:

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008
                But no longer in 2009...

                1 Reply Last reply
                0
                • T The Man from U N C L E

                  you can use the SourceDir property of the Windows Installer. You can pass this info as a CustomAction in your deployment project : /SrcDir="[SourceDir]\" You can then use it in c# with : this.Context.Parameters["SrcDir"] or in vb with : Me.Context.Parameters("SrcDir")

                  If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

                  C Offline
                  C Offline
                  coolpjmartin
                  wrote on last edited by
                  #8

                  Thank you very much, worked great

                  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