Results 1 to 17 of 17

Thread: Installation Directory

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Location
    manchester, england
    Posts
    84

    Installation Directory

    Is there any way that I can get my program to install in the default directory.
    I use the Application setup wizard that comes with VB, and for update reasons I want the program to install to the default location.

    Any info would be appreciated. Thanks

  2. #2
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    Did you get anywhere with your problem?


    I am working on a problem where I need to know where the progam was installed using the MS installer.
    Steve Stunning

  3. #3
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    While I would use Inno (http://www.innosetup.com/, I do believe there's an option to disallow user intervention of installation directory), you can edit the P&D Wizard to do what you want (it's a VB project, on my comp. it's around here: C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard).

    Edit: For Steve: you might try searching the registry for the install path of what you're trying to remove. Hope it works
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  4. #4
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    I have found the uninstall area and use it for another purpose. I also see a key for 'InstallLocation' but it is always blank when I do installs.

    Using MSI... is there a way to have it fill in this block? The only other way I know is to have my program update the location it is ran from. This is a probem if they never run the program after installing it.

    Basically... I created a nice live update program and need to know where my product was installed so I can update the exe or add new files.
    Steve Stunning

  5. #5
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    Find Your Proggy

    This Post might help, i created it to find Access but it could be used to find any progam, The functions find the program associated with an App..... etc...........

    (if your proggy has files associated with it then KOOL...

    Go Here This Might Help


    with respect

    bindu

  6. #6
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    Thanks for the tip...


    If a user was to remove the association then my program would not be able to locate the file quickly. Rats!!


    If only I can just have MSI identify the install location in the registry then I would be on easy street. MSI will write registry items but I do not know how identify the install location the user is selecting.

    The only option I have is to not permit the user to change the install location and let MSI install to the default location instead. Then I just identify where the program 'should be' and go from there.
    Steve Stunning

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Installation Directory

    Originally posted by viperfire
    Is there any way that I can get my program to install in the default directory.
    I use the Application setup wizard that comes with VB, and for update reasons I want the program to install to the default location.

    Any info would be appreciated. Thanks
    I may not understand your problem, but why not use App.Path and then not worry where the user has installed the app?

  8. #8
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    I believe he's talking about writing the registry from the Microsoft Installer, which should, by all rights, write it to the registry already. You might try searching around the web to see if anyone else has run into that problem. On another sidenote: I really would suggest you try Inno, just to see if it'll do what you want it to. If not, there's a workaround to every problem
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  9. #9
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    Thanks...

    Eventually I will just create my own installer.. I just do not have the time. I am currently working an a program to update all my products on a users computer and it works great!!

    For anyone else who needs a way to find the Install Path...

    Basically... I have worked around the Install location requirement by doing this:

    When the program is installed it creates two GUIDS. One identifies the program and another to group the program and it's requirements. Each required file also has a GUID.

    These are stored in HKLM\Software\Microsoft\CurrentVersion\Installer\UserData\xxxx\Components\{EXEGUID}\{GroupGUID}\AppP ath

    xxxx = A user Token ID number I guess. There can be several and the registry entry will be in one of them. I guess who ever installed the program will contain the entry.

    These Unique ID numbers are the same when installed on other computers. So I search for the {EXE GUID} and then get the Key for the {Group GUID}. This ultimatly returns the App Path.

    Hope this is of some use for others. It took me 10 hours to research this.
    Steve Stunning

  10. #10
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    Steve here is the answer

    Hi there i needed it too so i spent a bit of time on it..

    See the zip



    bindu
    Attached Files Attached Files

  11. #11
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    I never found the App Path entry till you pointed it out. This is because I did seaches for my program.


    Here is the funny thing... I see tons of other apps but none of mine that I installed with the Miscrosoft Installer!!
    Steve Stunning

  12. #12
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    Try looking in this key

    Visual basic apps arelimited by the visual basic run time to creating and storing keys here>>>>

    HKEY_CURRENT_USER\Software\VB and VBA Program Settings


    but that is if you use this >>

    SaveSetting StrAppName, strSection, strRegKey, strRegset


    you can use the API instead to control where it is put, to do this you will have to edit the setup which is created for your App when
    you make the package, and find "SaveSetting" and change it to an API call instead...

    Search the forum for registry or registry or Regsetkey API calls or similar..

    or use the bas in the zip file
    maybe you can put the zip on the code bank ???



    other than that you will have to create a completely new non-VB
    custom install program...



    with respect

    bindu
    Attached Files Attached Files

  13. #13
    New Member
    Join Date
    Sep 2003
    Posts
    1
    I believe the variable in the MSI program is targetdir, you can set a key in the registry with that value with the installer.

  14. #14
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    binduau


    I have a module that reads and writes to any location of the registry I desire. Been using it for years. My problem stems from the MSI installer and not being able to have the install process write a registry entry with the 'user selected' install location.

    The MSI installer is a new thing for me so I am still learning how to use it.


    Mr. Den

    Thanks for your tip! I will give it a try right now and see what results I get. I will be sure to post if it worked or not.
    Steve Stunning

  15. #15
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Edit the SETUP.LST file generated by the P&D Wizard using Notepad, and add

    ForceUseDefDir=1

    to the end of the [Setup] section

    eg;

    [Setup]
    Title=My App
    DefaultDir=$(ProgramFiles)\MyApp
    AppExe=MyApp.exe
    AppToUninstall=MyApp.exe
    ForceUseDefDir=1

    The user will not be prompted for the install location - and it will be installed into wherever is designated in the DefaultDir= line.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  16. #16
    Lively Member binduau's Avatar
    Join Date
    Sep 2003
    Location
    Perth Australia
    Posts
    121

    Kool!

    Originally posted by Buzby
    Edit the SETUP.LST file generated by the P&D Wizard using Notepad, and add

    ForceUseDefDir=1

    to the end of the [Setup] section

    eg;

    [Setup]
    Title=My App
    DefaultDir=$(ProgramFiles)\MyApp
    AppExe=MyApp.exe
    AppToUninstall=MyApp.exe
    ForceUseDefDir=1

    The user will not be prompted for the install location - and it will be installed into wherever is designated in the DefaultDir= line.

  17. #17
    Hyperactive Member Steve Stunning's Avatar
    Join Date
    Jul 1999
    Location
    Fairfax, Virginia
    Posts
    314
    This is some good information... but what about using MSI instead of the P&D Wizard.
    Steve Stunning

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