Recent

Author Topic: Win 10 install gone bad  (Read 4502 times)

svtdoug

  • Newbie
  • Posts: 3
Win 10 install gone bad
« 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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1961
  • Former Delphi 1-7, 10.2 user
Re: Win 10 install gone bad
« Reply #1 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.
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 x86_64 Xcode 13.3.1
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 aarch64 Xcode 13.3.1

af0815

  • Hero Member
  • *****
  • Posts: 936
Re: Win 10 install gone bad
« Reply #2 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.
regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7865
  • Debugger - SynEdit - and more
    • wiki
Re: Win 10 install gone bad
« Reply #3 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.


Jorg3000

  • New Member
  • *
  • Posts: 20
Re: Win 10 install gone bad
« Reply #4 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.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7865
  • Debugger - SynEdit - and more
    • wiki
Re: Win 10 install gone bad
« Reply #5 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.

winni

  • Hero Member
  • *****
  • Posts: 3045
Re: Win 10 install gone bad
« Reply #6 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

Jorg3000

  • New Member
  • *
  • Posts: 20
Re: Win 10 install gone bad
« Reply #7 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".

Zardoz2293

  • Newbie
  • Posts: 1
Re: Win 10 install gone bad
« Reply #8 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.

Thaddy

  • Hero Member
  • *****
  • Posts: 11516
Re: Win 10 install gone bad
« Reply #9 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.
« Last Edit: January 26, 2022, 08:09:05 pm by Thaddy »
Путин преступник. Россияне дезинформированы.

rvk

  • Hero Member
  • *****
  • Posts: 4620
Re: Win 10 install gone bad
« Reply #10 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>]

PascalDragon

  • Hero Member
  • *****
  • Posts: 3994
  • Compiler Developer
Re: Win 10 install gone bad
« Reply #11 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.

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Win 10 install gone bad
« Reply #12 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
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018