Announcement

Collapse
No announcement yet.

How to select installation Directory based on OS?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to select installation Directory based on OS?

    By default installation directory I gave this

    InstallDir "$PROGRAMFILES\myapplication"


    When am i install win 7 64 bit exe installed in C:\Program Files (x86)\myapp instead of C:\program File\myapp.

    Same way running win 7 32 bit exe installed in C:\program Files\myapp instead of C:\program Files(x86)\myapp.

    I dont know why this variations happening?

    Expected result:

    win 7 64 bit C:\program Files\myapp

    win 7 32 bit C:\program Files (X86)\myapp

    I know if we checking some conditions we can change the directory.but why this variations happened?
    I hope NSIS default behaviour is based on os it will select the installation directory.

  • #2
    On 64bit OS the $PROGRAMFILES and $PROGRAMFILES32 constant is mapped to C:\Program Files (x86)\ while $PROGRAMFILES64 points to C:\Program Files

    On 32 bit OS the $PROGRAMFILES constant is mapped to C:\Program Files\.

    So using $PROGRAMFILES on 32/64bit will give you various paths.
    Last edited by T.Slappy; 26 June 2013, 06:06. Reason: Change
    Cool looking installers with custom design: www.graphical-installer.com
    Create Setup Pages easily: www.install-designer.com
    Build installers in Visual Studio 2005-2022: www.visual-installer.com
    or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

    Comment


    • #3
      Originally Posted by ilaiyaraja View Post
      When am i install win 7 64 bit exe installed in C:\Program Files (x86)\myapp instead of C:\program File\myapp.
      NSIS is a 32 bits application, so its $PROGRAMFILES variable will always point to the 32 bits program files folder. On x64 windows, that directory is called "Program Files (x84)". If you want to install a 64 bits application, install it to $PROGRAMFILES64.

      Originally Posted by ilaiyaraja View Post
      Same way running win 7 32 bit exe installed in C:\program Files\myapp instead of C:\program Files(x86)\myapp.
      On 32 bits windows, there is no "Program Files(x86)" directory. There is only Program Files.

      Comment


      • #4
        Thanks MSG.got it Understood the behaviour of NSIS.

        Comment


        • #5
          Edit: nvm

          Comment


          • #6
            Originally Posted by MSG View Post
            NSIS is a 32 bits application, so its $PROGRAMFILES variable will always point to the 32 bits program files folder. On x64 windows, that directory is called "Program Files (x84)". If you want to install a 64 bits application, install it to $PROGRAMFILES64.
            Here I suppose you mean x64, there is no such directory as "Program Files (x84)"
            Cool looking installers with custom design: www.graphical-installer.com
            Create Setup Pages easily: www.install-designer.com
            Build installers in Visual Studio 2005-2022: www.visual-installer.com
            or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

            Comment


            • #7
              Originally Posted by T.Slappy View Post
              Here I suppose you mean x64, there is no such directory as "Program Files (x84)"
              Actually I meant x86.

              Comment

              Working...
              X
              😀
              🥰
              🤢
              😎
              😡
              👍
              👎