extra backslash in the installation path - visual-studio-2010

I am using VS installer to create an installer for my application. I have a custom action which will pass the installation path to the code behind like the following : /path="[TARGETDIR]\" .
Inside my installer Class I am displaying the installation path in the Install() method as path = Context.Parameters["path"]; MessageBox.Show(pathh);
however, what is displayed is something like this:c:\Program Files(x86)\Manufacturer\Applicationname\\
So I don’t know how this extra backslash is added and do not know how to remove it . Any idea?
it is worth mentioning that i was able to creat a file in the installtion path using "pathh"

If you are just want to display the path to the user u can use the following simple trick which works fine in your case: string path = pathh.Remove(pathh.Length-1); MessageBox.Show(path); Hope it helps.

Have you tried making your custom action without the trailing backslash?
Replace
/path="[TARGETDIR]\"
with
/path="[TARGETDIR]"

Related

How to set Crtrl+r to execute commands in Rstudio

How can I set RStudio to use Ctrl+R (in addition to Ctrl+Enter) to execute commands?
https://community.rstudio.com/t/bring-ctrl-r-back/1846 suggests editing the "rstudio_bindings.json" file, but I can't find the file.
https://support.rstudio.com/hc/en-us/articles/206382178-Customizing-Keyboard-Shortcuts gives instructions to add using from the menu options. I tried to add "Ctrl+Enter|Ctrl+R" as suggested in the first link but this is not accepted. At the bottom of the page it describes how the bindings are saved at ~/.R/rstudio/keybindings/rstudio_commands.json or ~/.R/rstudio/keybindings/editor_commands.json. I cannot find either of these files.
How can I do this?
R version 3.4.2
RStudio Version 1.1.383
Windows 7
Following advice from https://community.rstudio.com/t/bring-ctrl-r-back/1846,
you have to edit the file ~/.R/rstudio/keybindings/rstudio_bindings.json with
{
"executeCode" : "Ctrl+Enter|Ctrl+R"
}
These directories and file already existed on Ubuntu, however, neither the file nor any of the directories existed on my Windows partition. So needed to create the nested directories .R/rstudio/keybindings, and then create the json file shown above, and save it as rstudio_bindings.json.
(aside: Windows didn't like trying to name a new folder of .R (the leading dot gave problems), but you can get round this by naming .R. , as the trailing dot is removed from here )

Python os.rename "\" and "/" cross-platform issue

I'm trying to make a cross-platform program that move a file to a folder inside the user home folder, like this:
os.rename(file_var, destination_folder)
but I can't make it work because I need to put the file name inside the destination var, and the problem is the Windows "\"
what are my options?
do this:
for example you want this path:
'+pathfile+'/output/log.txt'
instead of typing a string, join them like this:
os.path.join(pathfile,"output","log.txt")
NOTE:
according to this post / works both in windows and linux, i always use os.path.join()

open a form from current directory

How can I open a form stored in the current directory
do form ADDBS( JUSTPATH(SYS(16,0))) +"\form5.scx" WITH thisform.grid1.Column1.Text1.Value TO aa
I tried this but says that the file doesn't exist
do form form5 with ...
VFP uses relative pathing and also search paths. If it is in current directory then would be the first one to be picked by VFP.
ADDBS( JUSTPATH(SYS(16,0)))
this adds already a slash ("\") to the path and you add another slash with "\form5.scx"
can do
do form ADDBS( JUSTPATH(SYS(16,0)))+"form5.scx"
or use relative path or locfile() function
to test what i said copy this code and execute it: you can see there is 2 "\"
addbs() works only on what its applied not in the second independent term of the path.
local m.myvar
text to m.myvar noshow
messagebox(ADDBS( JUSTPATH(SYS(16,0))) +"\form5.scx")
_cliptext=ADDBS( JUSTPATH(SYS(16,0))) +"\form5.scx"
endtext
strtofile(m.myvar,"test.prg")
do test

xcode 4.5.1. Header Search path not working, <directory/file.h> file not found

I have added a include directory in my home directory. I can run "ls -l ~/include" from the build directory.
I have added that directory in both "Header Seach Path" and in "User Header Search Path". In both places I have tried with both non-recursive and recursive.
But xcode 4.5.1 can not in any situation find the first stated header file.
It is stated in source code calls.m as:
#include <directory/file.h>
I get a "Lexical or Preprocessor issue 'directory/file.h' file not found."
But when running xcodebuild from cli it has no problems what so ever to build the source.
I have tried many of the suggestions found on internet
Putting a include in /usr/ om my drive
Adding a index to the project, adding files with no copy and no "Add to target" marked.
Restart xcode.
Specifying all specific paths.
But still no go.
What is the problem. Bug´s in xcode?
I just had a similar issue, and it was because there were spaces in the path which I defined for the Header Search Path. For example, I was defining the following as a search path:
$(SRCROOT)/Frameworks/Headers
which was being expanded out to the following:
/Users/skoota/Documents/Xcode Projects/My App/Frameworks/Headers
as you can see, there are spaces within the path (which are not immediately evident, as you are using the $(SRCROOT) variable) and the compiler doesn't particularly appreciate the spaces. I solved this problem by changing the search path to this:
"$(SRCROOT)"/Frameworks/Headers
(note the quote marks around $(SRCROOT) which escapes the spaces). This now expanded out to:
"/Users/skoota/Documents/Xcode Projects/My App"/Frameworks/Headers
which works perfectly, although looks a bit odd with the embedded " marks. This took me a while to figure out, so hopefully it helps!
This usually happens if there are spaces in your directory's path. To overcome this problem, use double quotes around the path.
Suppose you want to use your project directory, then you should use: $PROJECT_DIR. Enable recursive if you want to search within the folders as well. Alternatively, you can use $(SRCROOT)

Placing the semicolon in the Windows PATH environment variable

Where should the trailing semicolon in the Windows PATH environment variable be placed when adding a new folder?
Is it
[oldPATH];C:\My Folder
[oldPATH]C:\My Folder;
[oldPATH];C:\My Folder;
?
I saw different practices.
This is not really a syntax thing, actually. The correct answer here is: Place the semicolon so the result is a valid PATH.
This usually means one of the following:
set PATH=%PATH%;C:\Foo\Bar
set PATH=C:\Foo\Bar;%PATH%
because usually PATH doesn't end in a semicolon, so you have to add one appropriately to not mangle an existing path in it.
Just look at how PATH looks like and consider what you need to do if you add another path. This means you have to add a separator (the semicolon) and the path itself.
The first one. At least thats what Windows does on mine, so if Windows does it that way then that will probably be best :)
The first one:
[oldPATH]; C:\My Folder.
If you want to be sure, you can use the formula:
"%PATH%;C:\My Folder".
If it is only to execute something in, for example, a BAT script, use:
SET PATH "%PATH%;C:\My Folder".
(this one will be working just as a temporal variable)
To add a permanent User Enviroment Variable through command line:
SETX PATH "%PATH%;C:\My Folder".
Your oldPATH may end with semicolon, so when using fourth style [newPath];[OldPath] you don't add double semicolons.
path=%cd%;%path%
Note that windows doesn't care whether you write commands upper- or lowercase.

Resources