Results 1 to 4 of 4

Thread: Set default application folder for plug in msi based on existing application path

  1. #1

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,612

    Set default application folder for plug in msi based on existing application path

    Hi All

    I've got an application that uses plug-ins to represent different flavours of sql (e.g. MySQL, PostGres, SQLServer etc.). The intention is that further flavours of SQL will be supported by developing further plug-ins. It uses MEF to discover any dlls in a given directory (called SQLFlavours) which expose a given interface. The SQLFlavours directory is a subdirectory of the main apps application directory and is therefore a relative path.

    I've created a deployment project for the main application and there's a default location but the user can change it if they wish. I'm now trying to create a deployment project for one of the plug-ins but I'm stuck on how to set the default location for it. Ideally I'd like the installer to somehow "search" to target PC to find the appllication folder of the main app and then append /SQLFlavours to create the apropriate default location for the plug in. Is there any way to do that?

    Suggestions?

    Cheers
    FD
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,222

    Re: Set default application folder for plug in msi based on existing application path

    If you've built an installer for the initial application, is there any reason you couldn't just store the location in the registry?

    Then any additional plugins could simply read the key to find out where the user installed to.

  3. #3

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,612

    Re: Set default application folder for plug in msi based on existing application path

    OK I've done a bit of googling and that does soud like a promising aproach. I've got a slight concern that one of the places this gets installed to is a virtual enviroment and I think they discard the registry each time it's fired up. That's just one scenario, though, and it's a very controlled one so user freindliness of the installers is less of an issue there.

    Anyway, I'm giving it a punt but I've hit my first problem. In the install project I've opened up the registry editor and drilled down to HKEY_Local_Machine/Software/[Manufacturer]. I've created a new key (actually a folder) for the product and I've created a new string value (actually a key value pair) in there called AppPath. First I set this to [InstallDir] but that didn't work. It creates the key in the registry and I can see the AppPath value but there's no actual value associated with it - just a blank string. I tried ammending the value in set up project to "Testing" just to see what it would do but it's still blank after I've run the install.

    Any idea what I'm doing wrong?



    edit>should have mentioned, the key actually gets created under WOW6432Node as it's a 32 bit installer. Not sure if that's pertinent or not.

    edit> Found it. I used an Enviroment String Value rather than a String Value and I set it to [TARGETDIR]. Bob's yer uncle, the key is now appearing and correctly populated. Now to see if I can figure out reading back in the plug in installer.
    Last edited by FunkyDexter; Dec 18th, 2014 at 04:55 AM.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  4. #4

    Thread Starter
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,612

    Re: Set default application folder for plug in msi based on existing application path

    OK, I'm slowly getting there but I've gotten a little stuck.

    Based on the instructions here I've created a Launch Condition. It's root is vsdrrHKLM (which should be HotKey Local Machine I believe), it's property is APP_PATH (I just made this up because it seemed an apropriate name - it's essentially just a variable name, right?) and it's RegKey is either SOFTWARE\Wow6432Node\[Manufacturer]\[Product] or SOFTWARE\[Manufacturer]\[Product], I've tried both. (The manufacturer and product values are actually in place, I'm just not allowed to post them here for non-disclosure reasons). It's value is AppPath. So as I understand it that should find the registry value I created in my previous post and assign it to a property called APP_PATH, correct?

    I've then opened up the File system for the plug in set up project and set the Application Folder's Default Location to [App_Path]\SQLFlavours. So if I've understood correctly my default location should be [My Main Application's path]\SqlFlavours.

    However, when I build and run the plug in installer I get a message: "Could not access network location \SqlFlavours". That looks to me like the Launch Condition is failing to resove and so is returning a blank, leaving the default path as just /SqlFlavours which, of course, doesn't exist. The thing is I don't know why the Launch Condition is failing to resolve and don't know how to investigate it. Is there a way I can dig into this?
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width