User Tag List

Results 1 to 8 of 8

Thread: Write install directory in the registry

  1. #1
    No Products Registered

    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Write install directory in the registry

    Hi there,

    I need to install a program made of 2 files and write in the registry their complete paths. For example, if my files are image.gif and foo.exe and if the user chooses the path C:\my stuff, I want to write in the registry C:\my stuff\image.gif
    and C:\my stuff\foo.exe.

    I know how to write a value in the registry but how can I retrieve the install directory chosen by the user during the installation ?

    Thanks in advance

  2. #2
    No Products Registered

    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Write install directory in the registry

    I forgot to specify I was working with Install Creator Pro ...

  3. #3
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,422
    Mentioned
    171 Post(s)
    Tagged
    2 Thread(s)

    Re: Write install directory in the registry

    Just use the #InstallDir# macro in the string you write. For example if you want to write C:\my stuff\image.gif in the imageFile value of the HKCU\Software\YourCompany\YourProgram, use the following settings:

    Root key : HKEY_CURRENT_USER
    Key : Software\YourCompany\YourProgram
    Sub-key : imageFile
    String value : #InstallDir#\image.gif


  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,422
    Mentioned
    171 Post(s)
    Tagged
    2 Thread(s)

    Re: Write install directory in the registry

    PS: you see access the list of macros if you click the ">" button on the right of the edit box.

  5. #5
    No Products Registered

    Join Date
    Mar 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    And how can i write the #intallDir# macro in Subkey?
    I need add xps2 compatibility to shortcut. It is possible manually with regedit:
    -add HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    -then "String Value" with full path of the program's exe file (#InstallDir#\subfolder\app.exe)
    -combination of Data values (WINXPSP2 RUNASADMIN)

    This not work, create a String with #InstallDir#...

  6. #6
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,422
    Mentioned
    171 Post(s)
    Tagged
    2 Thread(s)
    In the Install Info tab of Install Creator Pro, click the Add button in the Registry group and then for example enter the following parameters :

    Root key : HKEY_CURRENT_USER
    Key : Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    Sub-key : #InstallDir#\subfolder\app.exe
    Value : RUNASADMIN

    EDIT: forget it, you are right, the #InstallDir# macro is not replaced in the key and sub-key names, sorry...

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Mar 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible to do use #InstallDir# in a "Run after/before Install" command? for example:
    Code:
    Reg.exe add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "#InstallDir#\subfolder\app.exe" /t REG_SZ /d "WINXPSP2 RUNASADMIN" /f
    If installed to "C:\Temp", that command (if it works- I don't have ICP, as i'm waiting for the next version to be released) will add a REG_SZ (string) key called "C:\Temp\subfolder\app.exe" in "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" and give it the value of "WINXPSP2 RUNASADMIN". the "/f" on the end makes it overwrite the key if it already exists.

    If it works, let me know, please.

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,422
    Mentioned
    171 Post(s)
    Tagged
    2 Thread(s)
    You cannot run a program that you don't install. However you can run a .bat file and pass #Installdir# as parameter. In your example above, put this in a .bat file :

    Reg.exe add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v %1 /t REG_SZ /d "WINXPSP2 RUNASADMIN" /f

    and then install & run the .bat file from ICP (or IC), with this in the "Command line options" box :

    "#InstallDir#\subfolder\app.exe"

    (including the double-quote characters)

    That should work.

Similar Threads

  1. Safest and most universal way to write/read registry key value ?
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 22nd November 2013, 12:06 AM
  2. Choosing the Install directory from the Registry
    By tpeck in forum Install Creator and Patch Maker
    Replies: 4
    Last Post: 13th January 2010, 07:07 PM
  3. Install Creator - how to write reg 'key' ?
    By BuddhaMaster84 in forum Install Creator and Patch Maker
    Replies: 5
    Last Post: 10th July 2009, 09:05 AM
  4. how to write to registry?
    By mavzer_baba in forum Install Creator and Patch Maker
    Replies: 1
    Last Post: 20th May 2008, 12:34 PM
  5. Using Registry in Install Creater
    By Binkster in forum Install Creator and Patch Maker
    Replies: 9
    Last Post: 22nd March 2008, 01:02 AM

Posting Permissions

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