Tapatalk

How to setup a project for working completely with paths relative to project file?

How to setup a project for working completely with paths relative to project file?

4

    Mar 02, 2019#1

    How does one force UES to use relative paths for files, and store only the relative paths into the .pui file? This would allow me to have a complete project tree on one computer in a different location that I have on another computer.

    For example, I have an SSD in my main development system that has projects on my F: drive, but when I need to use a different computer, my SSD will be assigned a different drive letter when I plug it in.

    I can edit my .pui files to remove hard coded paths, convert them all to relative paths, and UES will dutifully load all of my files. However, UES will turn around and put hard coded paths back into my .pui files when I close the program. As such, I have to keep separate project files for moving between computers even though the relative trees remain the same.

    These are in my .prj files:

    Use Relative Directory=1
    Relative to Project File=1
    Include Sub Directories=1

    6,685587
    Grand MasterGrand Master
    6,685587

      Mar 03, 2019#2

      chipprogrammer wrote:How does one force UES to use relative paths for files, and store only the relative paths into the .pui file?
      First, open Advanced - Settings or Configuration - File handling - Advanced and
      • check setting Save project information for use on multiple systems
      • uncheck setting Store project user interface (pui) files in profile directory
      Now the the project user interface file is named Project.pui and stored in same directory as project file Project.prj.

      Next it is necessary that in Project Settings window the Project directory is not set as by default. So after opening the project press Alt+Shift+S to open Project Settings window, select the path of the Project directory at top, press key DEL to remove project directory path and save this modification with clicking on button Close.

      This results in Project DirectoryU= being stored in project file Project.prj. So there is no project directory stored anymore in project file.

      Please note that UltraEdit / UEStudio shows the Project directory at top with a directory path on next opening Project Settings window. However, the Project DirectoryU= entry in project file Project.prj keeps empty as long as the Project directory path string in edit field in Project Settings window is not edited or the button Browse is used to browse to a directory and set selected directory as project directory.

      All files and directories added now after deletion of the project directory path with a relative path to project file Project.prj in the project file and in project user interface file Project.pui and the storage location of the project directory tree and its files does not longer matter.

      It is necessary to replace once all project paths by corresponding relative paths in case of a project file Project.prj contains already directories and files with full qualified names. This can be done after opening the project by opening File View (UltraEdit) respectively Workspace Manager (UEStudio), select tab Project, click with secondary (right) mouse button on project name at top of the list and click with primary (left) mouse button on context menu Edit project file to open the project file for editing in UltraEdit/UEStudio. A file/folder in directory of project file Project.prj must be stored in this file without any path. On file/folder being in parent directory of the directory containing the project file, the file/folder must be stored in project file with ..\ (ASCII/ANSI or UTF-16 encoded) respectively ..+AFw- (UTF-7 encoded) at beginning. And files/folders being in a subdirectory of the directory containing the project file must be stored in project file with subdirectory name (or subdirectory tree) at beginning. Don't forget to save the project file after all manual modifications.

      Last, after project file Project.prj does not contain anymore the project path anywhere, it is advisable to close all currently opened project files and re-open them so that finally on closing of project the opened files are also stored with relative path in project user interface file Project.pui.
      Best regards from an UC/UE/UES for Windows user from Austria

      4

        Mar 30, 2019#3

        I closed out UES 19 after removing the project path per your instructions. I already had the two check marks as needed. With Notepad, I manually edited my .pui file and removed all of the hard coded paths. Many of my edited file "Open File" entries begin with ..+AFw- to another directory relative to the current project directory.

        When I reopened UES to look at my sources, UES 19 put the hard coded paths back into my .pui file when I closed the program. UES 19 does not appear to respect the relative path (I have never been able to get UES to respect relative path, for any version).

        These are new in my .prj file:

        Project DirectoryU=
        Project TagfileU=
        Project WordfileU=
        Project TpFileU=
        FilterU=

        I do not find "Workspace Manager" in UES 19. In the Project drop down menu, there is Project Manager, which can be opened with Alt+Shift+M. In this window, there is no right mouse click context menu to let me edit.

        There seems to be a setting in the AppData folder, or in the Windows registry, that is be effecting this.

        6,685587
        Grand MasterGrand Master
        6,685587

          Mar 31, 2019#4

          I cannot reproduce any problem with using a project/workspace which uses only relative paths setup once as described by me above.

          I have attached in ZIP file example_project_with_relative_paths.zip a small non-compilable project. Extract this ZIP file to any directory with keeping the directory structure. Then click in UEStudio on ribbon tab Project on first item Open and browse to extraction folder containing Test\Settings with project file Test.prj and project user interface file Test.pui. Select file Test.prj and open it. On having made the configuration settings as posted above by me, UEStudio opens the project and displays the four files opened as I closed the test project being stored on my hard disk in directory F:\Temp.

          Play around with this example project using relative paths and you can see it works as expected on adding files and folders or groups in directory Test as UEStudio add the files and folders with relative path to project file. Also the user interface file contains the opened files with path relative to project file as long as an opened file belongs to the project at all. UEStudio just saves in Test.pui opened files not being a project file with full path.

          Regarding to Workspace Manager window take a look on attached screenshot below:

          edit_project_file.png (28.55KiB)
          Image showing how to open a project file of an opened project for a manual edit.

          The Workspace Manager window having name File View in UltraEdit which does not have the two tabs Tags and Files at bottom in comparison to UEStudio can be opened by
          • pressing Ctrl+U;
          • clicking on ribbon tab Layout on check box item File view on using ribbon mode (wrong name in UEStudio which I have just reported by email);
          • clicking in menu Layout on File view on using toolbar/menu mode with contemporary menus;
          • clicking in menu View in submenu Views/lists on Workspace manager (my preferred user interface mode with correct menu item in UEStudio for this view).
          The Workspace Manager (UEStudio) respectively File View (UltraEdit) contains the tab Project. At top of this tab is displayed the project name which is for the example project Test. Clicking with secondary (right) mouse button on the project name on this tab opens the context menu with the menu item Edit project file to manually edit the project file which is Test.prj for the example project. The file Test.pui cannot be opened via context menu. But it is not necessary to edit this file ever in UEStudio or UltraEdit. It is enough after converting all full paths to relative paths in project file to close all opened files, close the project, open the project and re-open the project files. The opened project files are stored with relative paths in Test.pui on next close of the project.
          example_project_with_relative_paths.zip (2.6 KiB)   27
          Very small example of a project using just paths relative to project file.
          Best regards from an UC/UE/UES for Windows user from Austria

          4

            Apr 02, 2019#5

            Your files are all in the local directory. My files are in the local directory, some in a subdirectory, some in a subdirectory of my parent folder. In total, I have over 230 files in my project. Maybe this only works if all of the files are in the local directory, and not stored elsewhere.

            My project layout is something like this:

            Code: Select all

            Drive:\path1\path2\path3\localProjectFolder
            Drive:\path1\path2\path3\localProjectFolder\subdirectory
            Drive:\path1\path2\path3\otherDirectory
            What I have in my .pui file is similar to this, after I removed "Drive:\path1\path2\path3" from each Open File entry:

            Code: Select all

            Open File84=myProgram.c
            Open File85=..+AFw-INCLUDE+AFw-about.c
            Open File86=..+AFw-INCLUDE+AFw-about.h
            Open File87=ASMs+AFw-SomeAsmFile.asm
            When UES opens my project, it changes all of my Open File statements to show the full path to all of my files. This is not what I want from UES.

            Furthermore, I do not need UTF-7 format in my .pui files. My .pui files should be left in ASCII format, or converted to UTF-8 or Unicode if, and ONLY if, necessary; UTF-8 should be used if folder names and / or filenames contain characters that are not in the range from 0x20 to 0x7E. How do I control the encoding for .pui files?

            I am not using the theme you showed, I have changed my layout to be more of the classic view, for Software Developer. As such, I had to find the Workspace Manager by looking at your screen capture. The help section mentioned Workspace Manager, but did not list how to get to it.

            6,685587
            Grand MasterGrand Master
            6,685587

              Apr 02, 2019#6

              The character encoding of the *.prj and *.pui files are not customizable because UltraEdit ≥ v24.00 and UEStudio ≥ v17.00 use nowadays always UTF-7 for these two files. The *.pui file should not be edited ever manually by a user and the *.prj file is editable in UE/UES whereby this is usually also not needed at all. You have to ask IDM support by email why UTF-7 encoding was chosen for the two files. I don't know the reason and the encoding of these two files managed by UE/UES does not matter for me on working with projects.

              The character encoding was ANSI for these two files in UltraEdit < v24.00 and UEStudio < v17.00 with using short 8.3 file names if a file contained one or more characters not available in system default code page for ANSI encoded files. The short 8.3 file names were also displayed on Project tab which looked not good. But I suppose there were not many people using file names with characters not included in system default code page for ANSI encoded files. An ANSI encoding is of course problematic if a project file is used by many developers, especially if the developers are in different countries resulting in different system default code pages for ANSI encoded files.

              My example project does not contain only files in projects root folder Test. It contains also an HTML file in subdirectory HTML which is also automatically stored in Test.pui with a path relative to project file Test.prj which is not in project root directory Test, but in subdirectory Settings. The folder specification is also stored with a path relative to directory of project file. I like this structure with having a Settings subdirectory containing not only the *.prj and *.pui files of the project, but also other project related settings files like a project specific wordfile or a project specific CTags file on using CTags, etc. which are not taken into account on compiling the project (C/C++ projects) or sharing the project files (HTML projects).

              On my tests with the example project I can add files and folders which are not even in directory structure of Test. UE/UES use always a path relative to project file as long as the file is on same drive, independent on where the file/folder is on same drive. The files/folders can be in one of the parent directories of the directory containing file Test.prj or even in a parallel structure on which only root directory of the drive is the only common directory of the project file/folder and the project file itself.

              Please let me know in which directory of the posted directories do you have the project file and the project user interface file. Then I could recreate this structure on my computer and upload an archive file with the files.

              The best support from my side for your project would require that you compress just the *.prj and *.pui files into a 7-Zip, RAR or ZIP archive which you could additionally protect against automated extraction with a password, and upload this archive file containing just these two files as attachment to your next post. The password protection prevents search engines to extract the archive file and index the contents of the two files, i.e. your file paths and names. You need to post the archive password which of course other people can download and use to extract the two files and look on your file paths and names. I can offer only contacting IDM support by email and attach the archive file for a more confidential help on your project.
              Best regards from an UC/UE/UES for Windows user from Austria

              4

                Apr 03, 2019#7

                My .prj and .pui files are always in their respective Drive:\path1\path2\path3\localProjectFolder, where the primary source files are also stored. Here is a live tree for one of my projects:

                Code: Select all

                C:\cygwin64\home\Chip\Random_Address_Test
                C:\cygwin64\home\Chip\include
                In the Random_Address_Test are my .prj and .pui files. This same folder contains my build script, makefile, primary sources, and some output files from tests. The include folder contains supporting files for this and other projects dating back more than 11 years.

                Here is a short snippet from my .pui file before opening UES 19:

                Code: Select all

                Open File0=build.sh
                Open File1=random_address.cpp
                Open File2=rndaddr.csv
                Here is the same snippet after opening / closing UES 19:

                Code: Select all

                Open File0=C:+AFw-cygwin64+AFw-home+AFw-Chip+AFw-Random+AF8-Address+AF8-Test+AFw-build.sh
                Open File1=C:+AFw-cygwin64+AFw-home+AFw-Chip+AFw-Random+AF8-Address+AF8-Test+AFw-random+AF8-address.cpp
                Open File2=C:+AFw-cygwin64+AFw-home+AFw-Chip+AFw-Random+AF8-Address+AF8-Test+AFw-rndaddr.csv
                The issue about relative paths is about storing relative paths in the .pui file, which I carry with me to other computers. This becomes a bigger issue when sharing these same two project files (.prj/.pui) between Windows installations and Linux-based installations (Linux and Mac), because the drive letters stored in .pui files are not compatible with Linux and derivatives.

                Further, if I share my two project files with colleagues, and if they use different drive and folder mappings, then my project files do not work for them in our collaborative environment. Their root path may differ from mine, but the tree structure from the parent folder down will always be the same because our make files are dependent on that.

                6,685587
                Grand MasterGrand Master
                6,685587

                  Apr 04, 2019#8

                  I cannot reproduce the behavior described by you. I created yesterday on Windows XP with UltraEdit v22.20.0.49 on my FAT32 drive F: the example project using your directory structure. UltraEdit v22.20.0.49 on Windows XP, and on Windows 7 x64 as found out on next day, failed to save the two *.h file names in Random Address Test.pui file with relative path. They were stored with full absolute path. The three other files in same directory as project file were stored with relative path .\ in Random Address Test.pui.

                  Today I moved the entire project to my Windows 7 x64 machine to root of drive F: being also a FAT32 partition on local hard disk and opened the project with UEStudio v19.00.0.24. UES opened the project and the project files as expected. UEStudio converted also the files Random Address Test.pui and Random Address Test.prj to Unicode (UTF-7). I removed manually from the project file the ANSI sections no longer needed which UEStudio left in project file for downwards compatibility. I closed all opened project files and re-opened them by double clicking on the files on tab Project of Workspace Manager in a different order as before and closed the project. UEStudio saved the file names in Random Address Test.pui with relative paths.

                  Next I moved the entire directory structure to C:\Temp which is an NTFS partition on my local hard disk. I opened the project with UES from this location and all files opened as expected and as closed on previous location F:\. I closed again the five opened project files and re-opened them via tab Project once again in a different order as before. Next I closed the project and again all file names are stored in Random Address Test.pui with relative paths.

                  Last I moved the directory structure from C:\Temp to Z:\ which is a network drive connected to a network share on a NAS. I opened the project from this location and everything was again as expected. I closed once more the opened project files, re-opened them and closed the project. And once again UEStudio saved all project files with a relative path which are:

                  Code: Select all

                  Open File0=.+AFw-random+AF8-address.cpp
                  Open File1=.+AFw-build.sh
                  Open File2=.+AFw-rndaddr.csv
                  Open File3=..+AFw-include+AFw-header.h
                  Open File4=..+AFw-include+AFw-one+AF8-more+AF8-header.h
                  Please note that the files in same directory as project file Random Address Test.prj and project user interface file Random Address Test.pui begin with .+AFw- which is UTF-7 encoded .\. So files in same directory as *.prj and *.pui must start with .\ respectively .+AFw-.

                  I have never opened Random Address Test.pui in UltraEdit or UEStudio. This is not necessary as I wrote in my second post. The entries in Random Address Test.pui can be updated by closing the files and opening them again. I verified content of Random Address Test.pui during my tests with lister of Total Commander, my favorite file manager which can display also content of all types of files.

                  Please see attached second example file containing entire project with your structure used by me during my tests with 32-bit UEStudio v19.00.0.24 on Windows 7 x64 on three different drives with three different file systems.
                  example_project_with_relative_paths_2.zip (2.52 KiB)   17
                  Second example project with relative paths
                  Best regards from an UC/UE/UES for Windows user from Austria