Delphi Path Variables












6















In the Delphi IDE, the path to the Delphi installation is specified as $(DELPHI). I am wondering if there is a way to create my own path indicators, such as $(MY_LIBRARY) or something similar. I thought $(DELPHI) was specified as an environment variable, but apparently not. Any ideas? (I'm using Delphi 7)










share|improve this question

























  • Did you ever find a way to get round this issue in D5 ?

    – Hugh Jones
    Nov 13 '12 at 14:47











  • Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

    – DJ Quimby
    Nov 14 '12 at 17:49











  • Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

    – Hugh Jones
    Nov 14 '12 at 18:01
















6















In the Delphi IDE, the path to the Delphi installation is specified as $(DELPHI). I am wondering if there is a way to create my own path indicators, such as $(MY_LIBRARY) or something similar. I thought $(DELPHI) was specified as an environment variable, but apparently not. Any ideas? (I'm using Delphi 7)










share|improve this question

























  • Did you ever find a way to get round this issue in D5 ?

    – Hugh Jones
    Nov 13 '12 at 14:47











  • Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

    – DJ Quimby
    Nov 14 '12 at 17:49











  • Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

    – Hugh Jones
    Nov 14 '12 at 18:01














6












6








6








In the Delphi IDE, the path to the Delphi installation is specified as $(DELPHI). I am wondering if there is a way to create my own path indicators, such as $(MY_LIBRARY) or something similar. I thought $(DELPHI) was specified as an environment variable, but apparently not. Any ideas? (I'm using Delphi 7)










share|improve this question
















In the Delphi IDE, the path to the Delphi installation is specified as $(DELPHI). I am wondering if there is a way to create my own path indicators, such as $(MY_LIBRARY) or something similar. I thought $(DELPHI) was specified as an environment variable, but apparently not. Any ideas? (I'm using Delphi 7)







delphi path delphi-7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 12:37









Kromster

4,68064887




4,68064887










asked May 10 '10 at 14:40









DJ QuimbyDJ Quimby

3,1021934




3,1021934













  • Did you ever find a way to get round this issue in D5 ?

    – Hugh Jones
    Nov 13 '12 at 14:47











  • Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

    – DJ Quimby
    Nov 14 '12 at 17:49











  • Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

    – Hugh Jones
    Nov 14 '12 at 18:01



















  • Did you ever find a way to get round this issue in D5 ?

    – Hugh Jones
    Nov 13 '12 at 14:47











  • Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

    – DJ Quimby
    Nov 14 '12 at 17:49











  • Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

    – Hugh Jones
    Nov 14 '12 at 18:01

















Did you ever find a way to get round this issue in D5 ?

– Hugh Jones
Nov 13 '12 at 14:47





Did you ever find a way to get round this issue in D5 ?

– Hugh Jones
Nov 13 '12 at 14:47













Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

– DJ Quimby
Nov 14 '12 at 17:49





Yep, I switched jobs ;) In all seriousness though, I unfortunately never did.

– DJ Quimby
Nov 14 '12 at 17:49













Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

– Hugh Jones
Nov 14 '12 at 18:01





Think you did right. The functionality only appeared in D6, apparently. How did we ever manage ?

– Hugh Jones
Nov 14 '12 at 18:01












6 Answers
6






active

oldest

votes


















9














In Delphi 2010:




  • select Tools -> Options

  • select "Environment Variables"

  • specify either System, either User variable






share|improve this answer
























  • Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

    – DJ Quimby
    May 10 '10 at 16:07






  • 2





    Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

    – Remy Lebeau
    May 10 '10 at 19:02











  • Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

    – DJ Quimby
    May 11 '10 at 13:47



















1














For Delphi 5 you can add them from windows Environment variables



right click on My computer > properties > advanced > Environment variables






share|improve this answer
























  • I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

    – DJ Quimby
    May 10 '10 at 17:14











  • You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

    – Rob Kennedy
    May 10 '10 at 17:32











  • Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

    – DJ Quimby
    May 10 '10 at 18:11



















0














In Delphi 2010:
I know many of the XML tags in the Project.dproj can be used like this. (For exemple, $(DCC_DcuOutput), $(DCC_ExeOutput)...).



Maybe it is possible to add your own XML tags in the file and use them afterward. Though I'm not sure if they'll be preserved by the IDE.






share|improve this answer































    0














    Also of note is when your using the command line compiler, the file RSVARS.BAT located in the BIN directory of the current Delphi installation is what creates some of the environment variables for child processes. (for example BDS and BDSCOMMONDIR).






    share|improve this answer































      0














      In Windows 7 (and Vista is similar) click the 'start' button, right-click 'computer', 'properties' and then 'advanced system settings'. Click 'Environment variables' and you're now able to create new ones as global (system), or just for the current user (you). For example 'MyVar'.



      Now in a delphi path, refer to MyVar as $(MyVar).



      MyVar will now be visible in batch files too as %MyVar%.






      share|improve this answer































        0














        There is an alternative workaround -- use SUBST to assign a virtual drive letter to the root of the folder you would be using $(MyFiles) if you could and then just use that.



        For Example if you have files in deep directory, you'd go to the command prompt and type:



        SUBST M: "C:usersMeDelphi FilesMy Components"



        and then you could refer to it by M:






        share|improve this answer























          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2803486%2fdelphi-path-variables%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          6 Answers
          6






          active

          oldest

          votes








          6 Answers
          6






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          9














          In Delphi 2010:




          • select Tools -> Options

          • select "Environment Variables"

          • specify either System, either User variable






          share|improve this answer
























          • Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

            – DJ Quimby
            May 10 '10 at 16:07






          • 2





            Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

            – Remy Lebeau
            May 10 '10 at 19:02











          • Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

            – DJ Quimby
            May 11 '10 at 13:47
















          9














          In Delphi 2010:




          • select Tools -> Options

          • select "Environment Variables"

          • specify either System, either User variable






          share|improve this answer
























          • Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

            – DJ Quimby
            May 10 '10 at 16:07






          • 2





            Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

            – Remy Lebeau
            May 10 '10 at 19:02











          • Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

            – DJ Quimby
            May 11 '10 at 13:47














          9












          9








          9







          In Delphi 2010:




          • select Tools -> Options

          • select "Environment Variables"

          • specify either System, either User variable






          share|improve this answer













          In Delphi 2010:




          • select Tools -> Options

          • select "Environment Variables"

          • specify either System, either User variable







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 10 '10 at 14:59









          da-softda-soft

          7,1202033




          7,1202033













          • Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

            – DJ Quimby
            May 10 '10 at 16:07






          • 2





            Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

            – Remy Lebeau
            May 10 '10 at 19:02











          • Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

            – DJ Quimby
            May 11 '10 at 13:47



















          • Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

            – DJ Quimby
            May 10 '10 at 16:07






          • 2





            Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

            – Remy Lebeau
            May 10 '10 at 19:02











          • Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

            – DJ Quimby
            May 11 '10 at 13:47

















          Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

          – DJ Quimby
          May 10 '10 at 16:07





          Thanks for the response. I should have specified that I am using Delphi 5, 7, and 2010. It is Delphi 5 that I am trying to do this in. Sorry about that

          – DJ Quimby
          May 10 '10 at 16:07




          2




          2





          Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

          – Remy Lebeau
          May 10 '10 at 19:02





          Delphi 5 does not support user-defined environment variables. That was introduced in Delphi 6.

          – Remy Lebeau
          May 10 '10 at 19:02













          Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

          – DJ Quimby
          May 11 '10 at 13:47





          Thanks Remy. I'll reserve that as just another reason to update all this code to 7 or 2010!

          – DJ Quimby
          May 11 '10 at 13:47













          1














          For Delphi 5 you can add them from windows Environment variables



          right click on My computer > properties > advanced > Environment variables






          share|improve this answer
























          • I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

            – DJ Quimby
            May 10 '10 at 17:14











          • You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

            – Rob Kennedy
            May 10 '10 at 17:32











          • Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

            – DJ Quimby
            May 10 '10 at 18:11
















          1














          For Delphi 5 you can add them from windows Environment variables



          right click on My computer > properties > advanced > Environment variables






          share|improve this answer
























          • I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

            – DJ Quimby
            May 10 '10 at 17:14











          • You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

            – Rob Kennedy
            May 10 '10 at 17:32











          • Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

            – DJ Quimby
            May 10 '10 at 18:11














          1












          1








          1







          For Delphi 5 you can add them from windows Environment variables



          right click on My computer > properties > advanced > Environment variables






          share|improve this answer













          For Delphi 5 you can add them from windows Environment variables



          right click on My computer > properties > advanced > Environment variables







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 10 '10 at 16:59









          Mohammed NasmanMohammed Nasman

          9,56253865




          9,56253865













          • I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

            – DJ Quimby
            May 10 '10 at 17:14











          • You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

            – Rob Kennedy
            May 10 '10 at 17:32











          • Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

            – DJ Quimby
            May 10 '10 at 18:11



















          • I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

            – DJ Quimby
            May 10 '10 at 17:14











          • You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

            – Rob Kennedy
            May 10 '10 at 17:32











          • Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

            – DJ Quimby
            May 10 '10 at 18:11

















          I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

          – DJ Quimby
          May 10 '10 at 17:14





          I did the following: Added system variable with the following info: Variable Name: OUTPUT_DIR Variable Value: T:Builds And in Delphi, in the Output folder: $(OUTPUT_DIR)ProjectsBpl This generates the error: Could not create output file $(OUTPUT_DIR)ProjectsBplAmase32.exe

          – DJ Quimby
          May 10 '10 at 17:14













          You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

          – Rob Kennedy
          May 10 '10 at 17:32





          You can add as many environment variables as you want, but it won't make any difference. Delphi 5 doesn't recognize environment variables. $(DELPHI) is not an environment variable.

          – Rob Kennedy
          May 10 '10 at 17:32













          Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

          – DJ Quimby
          May 10 '10 at 18:11





          Rob, that is correct, as I had indicated I discovered in my original question. That said, is there any way to mimic the way ($DELPHI) is used in my own Delphi 5 projects?

          – DJ Quimby
          May 10 '10 at 18:11











          0














          In Delphi 2010:
          I know many of the XML tags in the Project.dproj can be used like this. (For exemple, $(DCC_DcuOutput), $(DCC_ExeOutput)...).



          Maybe it is possible to add your own XML tags in the file and use them afterward. Though I'm not sure if they'll be preserved by the IDE.






          share|improve this answer




























            0














            In Delphi 2010:
            I know many of the XML tags in the Project.dproj can be used like this. (For exemple, $(DCC_DcuOutput), $(DCC_ExeOutput)...).



            Maybe it is possible to add your own XML tags in the file and use them afterward. Though I'm not sure if they'll be preserved by the IDE.






            share|improve this answer


























              0












              0








              0







              In Delphi 2010:
              I know many of the XML tags in the Project.dproj can be used like this. (For exemple, $(DCC_DcuOutput), $(DCC_ExeOutput)...).



              Maybe it is possible to add your own XML tags in the file and use them afterward. Though I'm not sure if they'll be preserved by the IDE.






              share|improve this answer













              In Delphi 2010:
              I know many of the XML tags in the Project.dproj can be used like this. (For exemple, $(DCC_DcuOutput), $(DCC_ExeOutput)...).



              Maybe it is possible to add your own XML tags in the file and use them afterward. Though I'm not sure if they'll be preserved by the IDE.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered May 10 '10 at 15:00









              Ken BourassaKen Bourassa

              4,89511425




              4,89511425























                  0














                  Also of note is when your using the command line compiler, the file RSVARS.BAT located in the BIN directory of the current Delphi installation is what creates some of the environment variables for child processes. (for example BDS and BDSCOMMONDIR).






                  share|improve this answer




























                    0














                    Also of note is when your using the command line compiler, the file RSVARS.BAT located in the BIN directory of the current Delphi installation is what creates some of the environment variables for child processes. (for example BDS and BDSCOMMONDIR).






                    share|improve this answer


























                      0












                      0








                      0







                      Also of note is when your using the command line compiler, the file RSVARS.BAT located in the BIN directory of the current Delphi installation is what creates some of the environment variables for child processes. (for example BDS and BDSCOMMONDIR).






                      share|improve this answer













                      Also of note is when your using the command line compiler, the file RSVARS.BAT located in the BIN directory of the current Delphi installation is what creates some of the environment variables for child processes. (for example BDS and BDSCOMMONDIR).







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 10 '10 at 15:48









                      skamradtskamradt

                      14.4k12948




                      14.4k12948























                          0














                          In Windows 7 (and Vista is similar) click the 'start' button, right-click 'computer', 'properties' and then 'advanced system settings'. Click 'Environment variables' and you're now able to create new ones as global (system), or just for the current user (you). For example 'MyVar'.



                          Now in a delphi path, refer to MyVar as $(MyVar).



                          MyVar will now be visible in batch files too as %MyVar%.






                          share|improve this answer




























                            0














                            In Windows 7 (and Vista is similar) click the 'start' button, right-click 'computer', 'properties' and then 'advanced system settings'. Click 'Environment variables' and you're now able to create new ones as global (system), or just for the current user (you). For example 'MyVar'.



                            Now in a delphi path, refer to MyVar as $(MyVar).



                            MyVar will now be visible in batch files too as %MyVar%.






                            share|improve this answer


























                              0












                              0








                              0







                              In Windows 7 (and Vista is similar) click the 'start' button, right-click 'computer', 'properties' and then 'advanced system settings'. Click 'Environment variables' and you're now able to create new ones as global (system), or just for the current user (you). For example 'MyVar'.



                              Now in a delphi path, refer to MyVar as $(MyVar).



                              MyVar will now be visible in batch files too as %MyVar%.






                              share|improve this answer













                              In Windows 7 (and Vista is similar) click the 'start' button, right-click 'computer', 'properties' and then 'advanced system settings'. Click 'Environment variables' and you're now able to create new ones as global (system), or just for the current user (you). For example 'MyVar'.



                              Now in a delphi path, refer to MyVar as $(MyVar).



                              MyVar will now be visible in batch files too as %MyVar%.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered May 10 '10 at 15:48









                              Brian FrostBrian Frost

                              8,0711061140




                              8,0711061140























                                  0














                                  There is an alternative workaround -- use SUBST to assign a virtual drive letter to the root of the folder you would be using $(MyFiles) if you could and then just use that.



                                  For Example if you have files in deep directory, you'd go to the command prompt and type:



                                  SUBST M: "C:usersMeDelphi FilesMy Components"



                                  and then you could refer to it by M:






                                  share|improve this answer




























                                    0














                                    There is an alternative workaround -- use SUBST to assign a virtual drive letter to the root of the folder you would be using $(MyFiles) if you could and then just use that.



                                    For Example if you have files in deep directory, you'd go to the command prompt and type:



                                    SUBST M: "C:usersMeDelphi FilesMy Components"



                                    and then you could refer to it by M:






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      There is an alternative workaround -- use SUBST to assign a virtual drive letter to the root of the folder you would be using $(MyFiles) if you could and then just use that.



                                      For Example if you have files in deep directory, you'd go to the command prompt and type:



                                      SUBST M: "C:usersMeDelphi FilesMy Components"



                                      and then you could refer to it by M:






                                      share|improve this answer













                                      There is an alternative workaround -- use SUBST to assign a virtual drive letter to the root of the folder you would be using $(MyFiles) if you could and then just use that.



                                      For Example if you have files in deep directory, you'd go to the command prompt and type:



                                      SUBST M: "C:usersMeDelphi FilesMy Components"



                                      and then you could refer to it by M:







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 7 '16 at 21:29









                                      Byte PlayerByte Player

                                      14




                                      14






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2803486%2fdelphi-path-variables%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Bressuire

                                          Vorschmack

                                          Quarantine