Custom Actions Working Directory

Sysprogs forums Forums VisualGDB Custom Actions Working Directory

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31932
    bfx
    Participant

    Hello,

    For an Android native library project, I would like to copy the resulting .so from the folder in which it is built to another location on my Windows PC.   I use CustomActions–> “After NDK build”, then in Command, I can do a “cp” command. However, I don’t know how to get a relative directory path, from somewhere in my project. For example, the folder where the Visual Studio solution file is, or some other folder. I want to avoid requiring NEW environment variables if necessary.

    Is there a way I can do <some relative magic>/……./arm64-v8a/lib/mylib.so     <some relative magic>/……./<my custom folder location>  ??

    I don’t want to use absolute paths, because someone else may have the project set up in some other location on their PC.

    Thank you.

     

     

    #31936
    support
    Keymaster

    Hi,

    No worries, you can always use the variables like $(ProjectDir) throughout the VisualGDB Project Properties (including the custom steps) to avoid hardcoding absolute paths.

    You can also use the link at the bottom of the VisualGDB Project Properties window to view all the variables relevant for the current project/configuration.

    #31958
    bfx
    Participant

     

    Thank you! Worked like a charm! I like how you have all different kinds of path types (Windows, Unix style, all lower case, etc).

    One note:  copy did not work as a command, I would get “The system cannot find the file specified”, which is actually complaining about the copy command itself, not the arguments.   (e.g. copy /? would also give that error). Strange, since Windows command shell does have copy.

    The workaround I used was to use xcopy, that worked fine. (whew!)

     

    #31960
    support
    Keymaster

    No problem and good to know it works. BTW, the copy command didn’t work because it’s not a separate executable, but rather a virtual command provided by cmd.exe. Setting executable path to “cmd.exe” and the arguments to “/c copy <…>” should to the job.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.