Lazarus
Installation => Windows (32/64) => Topic started by: svtdoug on November 15, 2021, 02:14:02 am
-
Well, this is not going well from the start. Lazarus wants to install in the root of my C:\\ drive? WTFO? In fact, if I try to select the conventional Windows location for program files of c:\\Program Files\ or c:\\Program Files (X86)\- it can't accept spaces in the path? WTFO. Why is this?
Thanks,
Doug
-
It is saving you from making a mistake. You do NOT want to install anything to which you need write access in your c:\Program Files\ or c:\Program Files (X86)\ directories.
-
And spaces in path makes often problems in tools, scripts or makescripts (in the past). Don't forget Lazarus must build itself and this makes the use of "c:\program files\" difficult. You must not use the root direct, i use a special directory "c:\data\" as a base location for alle program tools.
-
You do NOT want to install anything to which you need write access in your c:\Program Files\ or c:\Program Files (X86)\ directories.
Afaik a write only install is fully supported. (it works on Linux, and should on Win too)
The problem is the mentioned "tools" => Lazarus and Fpc sometime use tools from the GNU collection. Like: make, windres, gdb ....
Especially windres can not always be avoided (afaik, it will/may/can be replaced by fpcres, as soon as that will be released)
Some of those tools fail, if they need to be given a filename that includes a space. While on Linux those spaces can be escaped, afaik on Windows they can not (or no one has figured out how).
That is why the installer, does not want spaces...
Yet, that may actually not be a requirement for the install dir. It may possible be more an issue with where you save your projects. But I have not recently tested this.
And I guess no one else has. So potentially this "no space" issue is (at least partly) an artefact, or maybe not.
-
While on Linux those spaces can be escaped, afaik on Windows they can not (or no one has figured out how).
On Windows, command line parameters can be enclosed in quotes if they contain a space.
-
While on Linux those spaces can be escaped, afaik on Windows they can not (or no one has figured out how).
On Windows, command line parameters can be enclosed in quotes if they contain a space.
Yes, and that did not work. At least not back when it was last tested.... Not for some of the listed tools.
-
Hi!
White spaces in file- and directory names should be forbidden!
Nothing but trouble everywhere.
In scripts.
At installation.
A great nonsense!
As substitute you can uses the hyphen or the underscore which are allowed.
And in linux you can use a smiley or a YinYang in filenames . If you like.
Winni
-
In some language versions of Windows, "Program Files" is translated into a name without spaces.
E.g. in a German Windows you can use C:\Programme\Lazarus\ as installation path. This works.
You are out of luck if the localized name also contains a space.
If you use an English Windows, the localization is unused. If you want, you can then set up your own "localized" name without a space, e.g. "Programs".
To do this, start Notepad as administrator, open C:\Program Files\Desktop.ini
There you enter: LocalizedResourceName=Programs
After restarting Windows the folder is addressable as "Program Files" as well as "Programs".
-
Well, this is not going well from the start. Lazarus wants to install in the root of my C:\\ drive? WTFO? In fact, if I try to select the conventional Windows location for program files of c:\\Program Files\ or c:\\Program Files (X86)\- it can't accept spaces in the path? WTFO. Why is this?
Thanks,
Doug
Just create a Share for "C:\Program Files\Lazarus" as "Lazarus" and then install using the UNC shared name; example: "\\ComputerName\Lazarus". You may be required to resolve the path for one of the tools on first execution.
-
Long path names with spaces should always be surrounded by double quotes.'"c:\program files\*"' etc, note the single quotes around it to make it a Pascal string. So ', subsequently " obviously
You can also use the shortpath API. Then it becomes 'C:\PROGRA~1\ '. This is supported by Freepascal.
https://www.freepascal.org/docs-html/rtl/sysutils/extractshortpathname.html
The UNC (canonical) API should also work indeed.
-
Then it becomes 'C:\PROGRA~1\ '. This is supported by Freepascal.
Or is it C:\PROGRA~2 :P
First check with dir /x
BTW. Not all Windows filesystems are configered to create shortnames. Does Windows still do this by default? Check with fsutil 8dot3name query [<volumepath>]
-
Long path names with spaces should always be surrounded by double quotes.'"c:\program files\*"' etc, note the single quotes around it to make it a Pascal string. So ', subsequently " obviously
The problem is that some Unix utilities (e.g. windres) did or do not handle such paths correctly no matter the quoting.
You can also use the shortpath API. Then it becomes 'C:\PROGRA~1\ '. This is supported by Freepascal.
https://www.freepascal.org/docs-html/rtl/sysutils/extractshortpathname.html
The UNC (canonical) API should also work indeed.
The question for both of these is whether the Unix utilities handle that correctly (the short names probably, as long as they're enabled for the file system as rvk mentioned), but UNC path is a different topic.
In any case: the problem aren't FPC or Lazarus themselves, but some of the third party tools used by them.
-
I suspect the space in "Program Files" was Microsoft's attempt to ensure incompatibility with Unix, they sure gave it a good old try !
Davo