Lazarus

Installation => Windows (32/64) => Topic started by: svtdoug on November 15, 2021, 02:14:02 am

Title: Win 10 install gone bad
Post 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
Title: Re: Win 10 install gone bad
Post by: trev on November 15, 2021, 04:37:19 am
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.
Title: Re: Win 10 install gone bad
Post by: af0815 on November 15, 2021, 07:31:50 am
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.
Title: Re: Win 10 install gone bad
Post by: Martin_fr on November 15, 2021, 03:04:33 pm
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.

Title: Re: Win 10 install gone bad
Post by: Jorg3000 on November 15, 2021, 03:40:40 pm
Quote
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.
Title: Re: Win 10 install gone bad
Post by: Martin_fr on November 15, 2021, 03:53:27 pm
Quote
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.
Title: Re: Win 10 install gone bad
Post by: winni on November 15, 2021, 04:59:49 pm
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
Title: Re: Win 10 install gone bad
Post by: Jorg3000 on November 15, 2021, 07:46:55 pm
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".
Title: Re: Win 10 install gone bad
Post by: Zardoz2293 on January 26, 2022, 06:40:10 pm
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.
Title: Re: Win 10 install gone bad
Post by: Thaddy on January 26, 2022, 07:59:46 pm
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.
Title: Re: Win 10 install gone bad
Post by: rvk on January 26, 2022, 08:12:21 pm
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>]
Title: Re: Win 10 install gone bad
Post by: PascalDragon on January 27, 2022, 10:21:37 am
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.
Title: Re: Win 10 install gone bad
Post by: dbannon on January 27, 2022, 01:06:36 pm
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
TinyPortal © 2005-2018