View Issue Details

IDProjectCategoryView StatusLast Update
0034573PatchesIDEpublic2018-11-24 04:34
ReporterAlexey Tor.Assigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0034573: IDE Win32 manifest option "Long path awareness"
DescriptionDiscussed at mail list by D.Kozlov:
Windows API is capable of working with extended-length path for a maximum total path length of 32,767 characters, thus, overcoming the infamous 260 characters path limitation (a.k.a. MAX_PATH). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\C:\Very\Long\Path".

According to Windows Docs, one can enable the new long path behavior per app via the manifest:
-----------------------------
<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>
-----------------------------

here is my patch which adds option to IDE Project Options.
Additional InformationI'm not sure about correct place for new XML option. Someone pls check it.
TagsNo tags attached.
Fixed in Revisionr59633
LazTarget-
Widgetset
Attached Files
  • long.diff (16,375 bytes)
    Index: ide/frames/project_application_options.lfm
    ===================================================================
    --- ide/frames/project_application_options.lfm	(revision 59610)
    +++ ide/frames/project_application_options.lfm	(working copy)
    @@ -10,7 +10,7 @@
       DesignTop = 182
       object AppSettingsGroupBox: TGroupBox
         Left = 0
    -    Height = 506
    +    Height = 576
         Top = 0
         Width = 487
         Align = alTop
    @@ -17,7 +17,7 @@
         Anchors = []
         AutoSize = True
         Caption = 'AppSettingsGroupBox'
    -    ClientHeight = 487
    +    ClientHeight = 557
         ClientWidth = 483
         TabOrder = 0
         object TitleLabel: TLabel
    @@ -24,9 +24,9 @@
           AnchorSideTop.Control = TitleEdit
           AnchorSideTop.Side = asrCenter
           Left = 6
    -      Height = 14
    -      Top = 13
    -      Width = 59
    +      Height = 17
    +      Top = 11
    +      Width = 67
           BorderSpacing.Left = 6
           Caption = 'TitleLabel'
           ParentColor = False
    @@ -35,9 +35,9 @@
           AnchorSideLeft.Control = TitleLabel
           AnchorSideTop.Control = IconPanel
           Left = 6
    -      Height = 14
    -      Top = 40
    -      Width = 58
    +      Height = 17
    +      Top = 39
    +      Width = 65
           Caption = 'IconLabel'
           ParentColor = False
         end
    @@ -47,9 +47,9 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = IconTrack
           Left = 240
    -      Height = 14
    -      Top = 163
    -      Width = 89
    +      Height = 17
    +      Top = 179
    +      Width = 101
           BorderSpacing.Top = 6
           Caption = 'IconTrackLabel'
           ParentColor = False
    @@ -57,7 +57,7 @@
         object TitleEdit: TEdit
           AnchorSideRight.Side = asrBottom
           Left = 106
    -      Height = 28
    +      Height = 27
           Top = 6
           Width = 371
           Align = alTop
    @@ -71,12 +71,12 @@
           AnchorSideTop.Control = DarwinDividerBevel
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 20
    -      Top = 430
    -      Width = 176
    +      Height = 24
    +      Top = 492
    +      Width = 191
           BorderSpacing.Top = 3
           Caption = 'UseAppBundleCheckBox'
    -      TabOrder = 14
    +      TabOrder = 15
         end
         object UseXPManifestCheckBox: TCheckBox
           AnchorSideLeft.Control = TitleLabel
    @@ -83,9 +83,9 @@
           AnchorSideTop.Control = WindowsDividerBevel
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 20
    -      Top = 240
    -      Width = 177
    +      Height = 24
    +      Top = 263
    +      Width = 195
           BorderSpacing.Top = 3
           Caption = 'UseXPManifestCheckBox'
           OnChange = UseXPManifestCheckBoxChange
    @@ -97,7 +97,7 @@
           AnchorSideTop.Side = asrBottom
           Left = 106
           Height = 128
    -      Top = 40
    +      Top = 39
           Width = 128
           BorderSpacing.Left = 106
           BorderSpacing.Top = 6
    @@ -105,14 +105,14 @@
           BevelOuter = bvNone
           BorderWidth = 1
           BorderStyle = bsSingle
    -      ClientHeight = 124
    -      ClientWidth = 124
    +      ClientHeight = 126
    +      ClientWidth = 126
           TabOrder = 1
           object IconImage: TImage
             Left = 1
    -        Height = 122
    +        Height = 124
             Top = 1
    -        Width = 122
    +        Width = 124
             Align = alClient
             Center = True
             OnPictureChanged = IconImagePictureChanged
    @@ -125,9 +125,9 @@
           AnchorSideBottom.Control = IconPanel
           AnchorSideBottom.Side = asrBottom
           Left = 240
    -      Height = 25
    -      Top = 40
    -      Width = 109
    +      Height = 29
    +      Top = 39
    +      Width = 120
           AutoSize = True
           BorderSpacing.Left = 6
           Caption = 'LoadIconButton'
    @@ -139,9 +139,9 @@
           AnchorSideTop.Control = DefaultIconButton
           AnchorSideTop.Side = asrBottom
           Left = 240
    -      Height = 25
    -      Top = 101
    -      Width = 109
    +      Height = 29
    +      Top = 109
    +      Width = 117
           AutoSize = True
           BorderSpacing.Top = 6
           Caption = 'SaveIconButton'
    @@ -153,9 +153,9 @@
           AnchorSideTop.Control = SaveIconButton
           AnchorSideTop.Side = asrBottom
           Left = 240
    -      Height = 25
    -      Top = 132
    -      Width = 111
    +      Height = 29
    +      Top = 144
    +      Width = 121
           AutoSize = True
           BorderSpacing.Top = 6
           Caption = 'ClearIconButton'
    @@ -169,8 +169,8 @@
           AnchorSideRight.Control = IconPanel
           AnchorSideRight.Side = asrBottom
           Left = 106
    -      Height = 29
    -      Top = 168
    +      Height = 46
    +      Top = 167
           Width = 128
           Max = 0
           OnChange = IconTrackChange
    @@ -184,9 +184,9 @@
           AnchorSideTop.Control = ExecutionLevelComboBox
           AnchorSideTop.Side = asrBottom
           Left = 27
    -      Height = 20
    -      Top = 325
    -      Width = 142
    +      Height = 24
    +      Top = 358
    +      Width = 152
           BorderSpacing.Top = 3
           Caption = 'UIAccessCheckBox'
           TabOrder = 11
    @@ -197,13 +197,13 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 181
    -      Height = 28
    -      Top = 294
    -      Width = 296
    +      Left = 195
    +      Height = 31
    +      Top = 324
    +      Width = 282
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
    -      ItemHeight = 14
    +      ItemHeight = 0
           Style = csDropDownList
           TabOrder = 10
         end
    @@ -212,9 +212,9 @@
           AnchorSideTop.Control = ExecutionLevelComboBox
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 14
    -      Top = 301
    -      Width = 124
    +      Height = 17
    +      Top = 331
    +      Width = 138
           Caption = 'ExecutionLevelLabel'
           ParentColor = False
         end
    @@ -223,9 +223,9 @@
           AnchorSideTop.Control = LoadIconButton
           AnchorSideTop.Side = asrBottom
           Left = 240
    -      Height = 24
    -      Top = 71
    -      Width = 123
    +      Height = 29
    +      Top = 74
    +      Width = 136
           AutoSize = True
           BorderSpacing.Top = 6
           Caption = 'DefaultIconButton'
    @@ -237,8 +237,8 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Side = asrBottom
           Left = 3
    -      Height = 14
    -      Top = 223
    +      Height = 17
    +      Top = 243
           Width = 477
           Caption = 'For Windows'
           Anchors = [akTop, akLeft, akRight]
    @@ -253,9 +253,9 @@
           AnchorSideTop.Control = UseAppBundleCheckBox
           AnchorSideTop.Side = asrBottom
           Left = 27
    -      Height = 25
    -      Top = 456
    -      Width = 160
    +      Height = 29
    +      Top = 522
    +      Width = 177
           AutoSize = True
           BorderSpacing.Left = 21
           BorderSpacing.Top = 6
    @@ -262,7 +262,7 @@
           BorderSpacing.Bottom = 6
           Caption = 'CreateAppBundleButton'
           OnClick = CreateAppBundleButtonClick
    -      TabOrder = 15
    +      TabOrder = 16
         end
         object DpiAwareLabel: TLabel
           AnchorSideLeft.Control = UseXPManifestCheckBox
    @@ -269,9 +269,9 @@
           AnchorSideTop.Control = DpiAwareComboBox
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 14
    -      Top = 270
    -      Width = 91
    +      Height = 17
    +      Top = 297
    +      Width = 103
           BorderSpacing.Left = 21
           BorderSpacing.Top = 3
           Caption = 'DpiAwareLabel'
    @@ -284,14 +284,14 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = TitleEdit
           AnchorSideRight.Side = asrBottom
    -      Left = 181
    -      Height = 28
    -      Top = 263
    -      Width = 296
    +      Left = 195
    +      Height = 31
    +      Top = 290
    +      Width = 282
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Left = 30
           BorderSpacing.Top = 3
    -      ItemHeight = 14
    +      ItemHeight = 0
           Style = csDropDownList
           TabOrder = 9
         end
    @@ -300,9 +300,9 @@
           AnchorSideTop.Control = IconTrack
           AnchorSideTop.Side = asrBottom
           Left = 6
    -      Height = 20
    -      Top = 197
    -      Width = 176
    +      Height = 24
    +      Top = 213
    +      Width = 188
           Caption = 'UseLCLScalingCheckBox'
           TabOrder = 7
         end
    @@ -311,8 +311,8 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Side = asrBottom
           Left = 3
    -      Height = 14
    -      Top = 413
    +      Height = 17
    +      Top = 472
           Width = 474
           Caption = 'For macOS (Darwin)'
           Anchors = [akTop, akLeft, akRight]
    @@ -327,9 +327,9 @@
           AnchorSideTop.Control = NameEdit
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 14
    -      Top = 355
    -      Width = 68
    +      Height = 17
    +      Top = 414
    +      Width = 77
           Caption = 'NameLabel'
           ParentColor = False
         end
    @@ -338,25 +338,25 @@
           AnchorSideTop.Control = DescriptionEdit
           AnchorSideTop.Side = asrCenter
           Left = 27
    -      Height = 14
    -      Top = 386
    -      Width = 101
    +      Height = 17
    +      Top = 444
    +      Width = 115
           Caption = 'DescriptionLabel'
           ParentColor = False
         end
         object NameEdit: TEdit
           AnchorSideLeft.Control = DpiAwareComboBox
    -      AnchorSideTop.Control = UIAccessCheckBox
    +      AnchorSideTop.Control = LongPathCheckBox
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 181
    -      Height = 28
    -      Top = 348
    -      Width = 296
    +      Left = 195
    +      Height = 27
    +      Top = 409
    +      Width = 282
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
    -      TabOrder = 12
    +      TabOrder = 13
           Text = 'NameEdit'
         end
         object DescriptionEdit: TEdit
    @@ -365,15 +365,26 @@
           AnchorSideTop.Side = asrBottom
           AnchorSideRight.Control = DpiAwareComboBox
           AnchorSideRight.Side = asrBottom
    -      Left = 181
    -      Height = 28
    -      Top = 379
    -      Width = 296
    +      Left = 195
    +      Height = 27
    +      Top = 439
    +      Width = 282
           Anchors = [akTop, akLeft, akRight]
           BorderSpacing.Top = 3
    -      TabOrder = 13
    +      TabOrder = 14
           Text = 'DescriptionEdit'
         end
    +    object LongPathCheckBox: TCheckBox
    +      AnchorSideLeft.Control = UIAccessCheckBox
    +      AnchorSideTop.Control = UIAccessCheckBox
    +      AnchorSideTop.Side = asrBottom
    +      Left = 27
    +      Height = 24
    +      Top = 382
    +      Width = 156
    +      Caption = 'LongPathCheckBox'
    +      TabOrder = 12
    +    end
       end
       object OpenPictureDialog1: TOpenPictureDialog
         left = 385
    Index: ide/frames/project_application_options.pas
    ===================================================================
    --- ide/frames/project_application_options.pas	(revision 59610)
    +++ ide/frames/project_application_options.pas	(working copy)
    @@ -25,6 +25,7 @@
     
       TProjectApplicationOptionsFrame = class(TAbstractIDEOptionsEditor)
         AppSettingsGroupBox: TGroupBox;
    +    LongPathCheckBox: TCheckBox;
         DarwinDividerBevel: TDividerBevel;
         NameEdit: TEdit;
         DescriptionEdit: TEdit;
    @@ -195,6 +196,7 @@
       ExecutionLevelLabel.Enabled := aEnable;
       ExecutionLevelComboBox.Enabled := aEnable;
       UIAccessCheckBox.Enabled := aEnable;
    +  LongPathCheckBox.Enabled := aEnable;
       NameEdit.Enabled := aEnable;
       DescriptionEdit.Enabled := aEnable;
     end;
    @@ -263,6 +265,7 @@
       for DpiLevel in TXPManifestDpiAware do
         DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')');
       UIAccessCheckBox.Caption := dlgPOUIAccess;
    +  LongPathCheckBox.Caption := dlgPOLongPathAware;
       NameLabel.Caption := lisName;
       DescriptionLabel.Caption := lisCodeHelpDescrTag;
     
    @@ -308,6 +311,7 @@
           DpiAwareComboBox.ItemIndex := Ord(DpiAware);
           ExecutionLevelComboBox.ItemIndex := Ord(ExecutionLevel);
           UIAccessCheckBox.Checked := UIAccess;
    +      LongPathCheckBox.Checked := LongPath;
           NameEdit.Text := TextName;
           DescriptionEdit.Text := TextDesc;
         end;
    @@ -347,6 +351,7 @@
           DpiAware := TXPManifestDpiAware(DpiAwareComboBox.ItemIndex);
           ExecutionLevel := TXPManifestExecutionLevel(ExecutionLevelComboBox.ItemIndex);
           UIAccess := UIAccessCheckBox.Checked;
    +      LongPath := LongPathCheckBox.Checked;
           TextName := NameEdit.Text;
           TextDesc := DescriptionEdit.Text;
         end;
    Index: ide/lazarusidestrconsts.pas
    ===================================================================
    --- ide/lazarusidestrconsts.pas	(revision 59610)
    +++ ide/lazarusidestrconsts.pas	(working copy)
    @@ -2626,6 +2626,7 @@
       dlgPODpiAwarenessOldOnNewPerMonitor = 'Vista-8: on, 8.1+: per monitor';
       dlgPODpiAwarenessOldOnNewPerMonitorV2 = 'Vista-8: on, 8.1/10+: per monitor/V2';
       dlgPOUIAccess = 'UI Access (uiAccess)';
    +  dlgPOLongPathAware = 'Long path awareness';
       dlgPOAsInvoker = 'as invoker (asInvoker)';
       dlgPOHighestAvailable = 'highest available (highestAvailable)';
       dlgPORequireAdministrator = 'require administrator (requireAdministrator)';
    Index: ide/w32manifest.pas
    ===================================================================
    --- ide/w32manifest.pas	(revision 59610)
    +++ ide/w32manifest.pas	(working copy)
    @@ -68,6 +68,7 @@
         FDpiAware: TXPManifestDpiAware;
         FUIAccess: Boolean;
         FUseManifest: boolean;
    +    FLongPath: Boolean;
         FTextName: string;
         FTextDesc: string;
         procedure SetDpiAware(AValue: TXPManifestDpiAware);
    @@ -74,6 +75,7 @@
         procedure SetExecutionLevel(AValue: TXPManifestExecutionLevel);
         procedure SetUIAccess(AValue: Boolean);
         procedure SetUseManifest(const AValue: boolean);
    +    procedure SetLongPath(AValue: Boolean);
         procedure SetTextName(const AValue: string);
         procedure SetTextDesc(const AValue: string);
       public
    @@ -86,6 +88,7 @@
         property DpiAware: TXPManifestDpiAware read FDpiAware write SetDpiAware;
         property ExecutionLevel: TXPManifestExecutionLevel read FExecutionLevel write SetExecutionLevel;
         property UIAccess: Boolean read FUIAccess write SetUIAccess;
    +    property LongPath: Boolean read FLongPath write SetLongPath;
         property TextName: string read FTextName write SetTextName;
         property TextDesc: string read FTextDesc write SetTextDesc;
       end;
    @@ -153,6 +156,7 @@
         '  </asmv3:windowsSettings>'#$D#$A+
         '  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">'#$D#$A+
         '   %s'#$D#$A+
    +    '   <longPathAware>%s</longPathAware>'#$D#$A+
         '  </asmv3:windowsSettings>'#$D#$A+
         ' </asmv3:application>'#$D#$A+
         '</assembly>';
    @@ -178,6 +182,13 @@
       Modified := True;
     end;
     
    +procedure TProjectXPManifest.SetLongPath(AValue: Boolean);
    +begin
    +  if FLongPath = AValue then exit;
    +  FLongPath := AValue;
    +  Modified := True;
    +end;
    +
     procedure TProjectXPManifest.SetDpiAware(AValue: TXPManifestDpiAware);
     begin
       if FDpiAware = AValue then Exit;
    @@ -221,6 +232,7 @@
       DpiAware := xmdaFalse;
       ExecutionLevel := xmelAsInvoker;
       UIAccess := False;
    +  LongPath := False;
       TextName := DefaultXPManifestTextName;
       TextDesc := DefaultXPManifestTextDesc;
     end;
    @@ -246,7 +258,9 @@
           ExecutionLevelToStr[ExecutionLevel],
           BoolToStr(UIAccess, 'true', 'false'),
           ManifestDpiAwareValues[DpiAware],
    -      ManifestDpiAwarenessValues[DpiAware]]);
    +      ManifestDpiAwarenessValues[DpiAware],
    +      BoolToStr(LongPath, 'true', 'false')
    +      ]);
         Res.RawData.Write(ManifestFileData[1], Length(ManifestFileData));
         AResources.AddSystemResource(Res);
       end;
    @@ -259,6 +273,7 @@
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/DpiAware/Value', ManifestDpiAwareValues[DpiAware], ManifestDpiAwareValues[xmdaFalse]);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/ExecutionLevel/Value', ExecutionLevelToStr[ExecutionLevel], ExecutionLevelToStr[xmelAsInvoker]);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UIAccess/Value', UIAccess, False);
    +  TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/LongPath/Value', LongPath, False);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextName/Value', TextName, DefaultXPManifestTextName);
       TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextDesc/Value', TextDesc, DefaultXPManifestTextDesc);
     end;
    @@ -287,6 +302,7 @@
         ExecutionLevel := StrToXPManifestExecutionLevel(Cfg.GetValue(Path+'General/XPManifest/ExecutionLevel/Value', ''));
     
       UIAccess := Cfg.GetValue(Path+'General/XPManifest/UIAccess/Value', False);
    +  LongPath := Cfg.GetValue(Path+'General/XPManifest/LongPath/Value', False);
       TextName := Cfg.GetValue(Path+'General/XPManifest/TextName/Value', TextName);
       TextDesc := Cfg.GetValue(Path+'General/XPManifest/TextDesc/Value', TextDesc);
     end;
    
    long.diff (16,375 bytes)

Relationships

related to 0034578 closedJuha Manninen Lazarus Project options: assigned icon for button "Load default icon" 

Activities

Alexey Tor.

2018-11-20 01:15

reporter  

long.diff (16,375 bytes)
Index: ide/frames/project_application_options.lfm
===================================================================
--- ide/frames/project_application_options.lfm	(revision 59610)
+++ ide/frames/project_application_options.lfm	(working copy)
@@ -10,7 +10,7 @@
   DesignTop = 182
   object AppSettingsGroupBox: TGroupBox
     Left = 0
-    Height = 506
+    Height = 576
     Top = 0
     Width = 487
     Align = alTop
@@ -17,7 +17,7 @@
     Anchors = []
     AutoSize = True
     Caption = 'AppSettingsGroupBox'
-    ClientHeight = 487
+    ClientHeight = 557
     ClientWidth = 483
     TabOrder = 0
     object TitleLabel: TLabel
@@ -24,9 +24,9 @@
       AnchorSideTop.Control = TitleEdit
       AnchorSideTop.Side = asrCenter
       Left = 6
-      Height = 14
-      Top = 13
-      Width = 59
+      Height = 17
+      Top = 11
+      Width = 67
       BorderSpacing.Left = 6
       Caption = 'TitleLabel'
       ParentColor = False
@@ -35,9 +35,9 @@
       AnchorSideLeft.Control = TitleLabel
       AnchorSideTop.Control = IconPanel
       Left = 6
-      Height = 14
-      Top = 40
-      Width = 58
+      Height = 17
+      Top = 39
+      Width = 65
       Caption = 'IconLabel'
       ParentColor = False
     end
@@ -47,9 +47,9 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = IconTrack
       Left = 240
-      Height = 14
-      Top = 163
-      Width = 89
+      Height = 17
+      Top = 179
+      Width = 101
       BorderSpacing.Top = 6
       Caption = 'IconTrackLabel'
       ParentColor = False
@@ -57,7 +57,7 @@
     object TitleEdit: TEdit
       AnchorSideRight.Side = asrBottom
       Left = 106
-      Height = 28
+      Height = 27
       Top = 6
       Width = 371
       Align = alTop
@@ -71,12 +71,12 @@
       AnchorSideTop.Control = DarwinDividerBevel
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 20
-      Top = 430
-      Width = 176
+      Height = 24
+      Top = 492
+      Width = 191
       BorderSpacing.Top = 3
       Caption = 'UseAppBundleCheckBox'
-      TabOrder = 14
+      TabOrder = 15
     end
     object UseXPManifestCheckBox: TCheckBox
       AnchorSideLeft.Control = TitleLabel
@@ -83,9 +83,9 @@
       AnchorSideTop.Control = WindowsDividerBevel
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 20
-      Top = 240
-      Width = 177
+      Height = 24
+      Top = 263
+      Width = 195
       BorderSpacing.Top = 3
       Caption = 'UseXPManifestCheckBox'
       OnChange = UseXPManifestCheckBoxChange
@@ -97,7 +97,7 @@
       AnchorSideTop.Side = asrBottom
       Left = 106
       Height = 128
-      Top = 40
+      Top = 39
       Width = 128
       BorderSpacing.Left = 106
       BorderSpacing.Top = 6
@@ -105,14 +105,14 @@
       BevelOuter = bvNone
       BorderWidth = 1
       BorderStyle = bsSingle
-      ClientHeight = 124
-      ClientWidth = 124
+      ClientHeight = 126
+      ClientWidth = 126
       TabOrder = 1
       object IconImage: TImage
         Left = 1
-        Height = 122
+        Height = 124
         Top = 1
-        Width = 122
+        Width = 124
         Align = alClient
         Center = True
         OnPictureChanged = IconImagePictureChanged
@@ -125,9 +125,9 @@
       AnchorSideBottom.Control = IconPanel
       AnchorSideBottom.Side = asrBottom
       Left = 240
-      Height = 25
-      Top = 40
-      Width = 109
+      Height = 29
+      Top = 39
+      Width = 120
       AutoSize = True
       BorderSpacing.Left = 6
       Caption = 'LoadIconButton'
@@ -139,9 +139,9 @@
       AnchorSideTop.Control = DefaultIconButton
       AnchorSideTop.Side = asrBottom
       Left = 240
-      Height = 25
-      Top = 101
-      Width = 109
+      Height = 29
+      Top = 109
+      Width = 117
       AutoSize = True
       BorderSpacing.Top = 6
       Caption = 'SaveIconButton'
@@ -153,9 +153,9 @@
       AnchorSideTop.Control = SaveIconButton
       AnchorSideTop.Side = asrBottom
       Left = 240
-      Height = 25
-      Top = 132
-      Width = 111
+      Height = 29
+      Top = 144
+      Width = 121
       AutoSize = True
       BorderSpacing.Top = 6
       Caption = 'ClearIconButton'
@@ -169,8 +169,8 @@
       AnchorSideRight.Control = IconPanel
       AnchorSideRight.Side = asrBottom
       Left = 106
-      Height = 29
-      Top = 168
+      Height = 46
+      Top = 167
       Width = 128
       Max = 0
       OnChange = IconTrackChange
@@ -184,9 +184,9 @@
       AnchorSideTop.Control = ExecutionLevelComboBox
       AnchorSideTop.Side = asrBottom
       Left = 27
-      Height = 20
-      Top = 325
-      Width = 142
+      Height = 24
+      Top = 358
+      Width = 152
       BorderSpacing.Top = 3
       Caption = 'UIAccessCheckBox'
       TabOrder = 11
@@ -197,13 +197,13 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 181
-      Height = 28
-      Top = 294
-      Width = 296
+      Left = 195
+      Height = 31
+      Top = 324
+      Width = 282
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
-      ItemHeight = 14
+      ItemHeight = 0
       Style = csDropDownList
       TabOrder = 10
     end
@@ -212,9 +212,9 @@
       AnchorSideTop.Control = ExecutionLevelComboBox
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 14
-      Top = 301
-      Width = 124
+      Height = 17
+      Top = 331
+      Width = 138
       Caption = 'ExecutionLevelLabel'
       ParentColor = False
     end
@@ -223,9 +223,9 @@
       AnchorSideTop.Control = LoadIconButton
       AnchorSideTop.Side = asrBottom
       Left = 240
-      Height = 24
-      Top = 71
-      Width = 123
+      Height = 29
+      Top = 74
+      Width = 136
       AutoSize = True
       BorderSpacing.Top = 6
       Caption = 'DefaultIconButton'
@@ -237,8 +237,8 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Side = asrBottom
       Left = 3
-      Height = 14
-      Top = 223
+      Height = 17
+      Top = 243
       Width = 477
       Caption = 'For Windows'
       Anchors = [akTop, akLeft, akRight]
@@ -253,9 +253,9 @@
       AnchorSideTop.Control = UseAppBundleCheckBox
       AnchorSideTop.Side = asrBottom
       Left = 27
-      Height = 25
-      Top = 456
-      Width = 160
+      Height = 29
+      Top = 522
+      Width = 177
       AutoSize = True
       BorderSpacing.Left = 21
       BorderSpacing.Top = 6
@@ -262,7 +262,7 @@
       BorderSpacing.Bottom = 6
       Caption = 'CreateAppBundleButton'
       OnClick = CreateAppBundleButtonClick
-      TabOrder = 15
+      TabOrder = 16
     end
     object DpiAwareLabel: TLabel
       AnchorSideLeft.Control = UseXPManifestCheckBox
@@ -269,9 +269,9 @@
       AnchorSideTop.Control = DpiAwareComboBox
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 14
-      Top = 270
-      Width = 91
+      Height = 17
+      Top = 297
+      Width = 103
       BorderSpacing.Left = 21
       BorderSpacing.Top = 3
       Caption = 'DpiAwareLabel'
@@ -284,14 +284,14 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = TitleEdit
       AnchorSideRight.Side = asrBottom
-      Left = 181
-      Height = 28
-      Top = 263
-      Width = 296
+      Left = 195
+      Height = 31
+      Top = 290
+      Width = 282
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Left = 30
       BorderSpacing.Top = 3
-      ItemHeight = 14
+      ItemHeight = 0
       Style = csDropDownList
       TabOrder = 9
     end
@@ -300,9 +300,9 @@
       AnchorSideTop.Control = IconTrack
       AnchorSideTop.Side = asrBottom
       Left = 6
-      Height = 20
-      Top = 197
-      Width = 176
+      Height = 24
+      Top = 213
+      Width = 188
       Caption = 'UseLCLScalingCheckBox'
       TabOrder = 7
     end
@@ -311,8 +311,8 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Side = asrBottom
       Left = 3
-      Height = 14
-      Top = 413
+      Height = 17
+      Top = 472
       Width = 474
       Caption = 'For macOS (Darwin)'
       Anchors = [akTop, akLeft, akRight]
@@ -327,9 +327,9 @@
       AnchorSideTop.Control = NameEdit
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 14
-      Top = 355
-      Width = 68
+      Height = 17
+      Top = 414
+      Width = 77
       Caption = 'NameLabel'
       ParentColor = False
     end
@@ -338,25 +338,25 @@
       AnchorSideTop.Control = DescriptionEdit
       AnchorSideTop.Side = asrCenter
       Left = 27
-      Height = 14
-      Top = 386
-      Width = 101
+      Height = 17
+      Top = 444
+      Width = 115
       Caption = 'DescriptionLabel'
       ParentColor = False
     end
     object NameEdit: TEdit
       AnchorSideLeft.Control = DpiAwareComboBox
-      AnchorSideTop.Control = UIAccessCheckBox
+      AnchorSideTop.Control = LongPathCheckBox
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 181
-      Height = 28
-      Top = 348
-      Width = 296
+      Left = 195
+      Height = 27
+      Top = 409
+      Width = 282
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
-      TabOrder = 12
+      TabOrder = 13
       Text = 'NameEdit'
     end
     object DescriptionEdit: TEdit
@@ -365,15 +365,26 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = DpiAwareComboBox
       AnchorSideRight.Side = asrBottom
-      Left = 181
-      Height = 28
-      Top = 379
-      Width = 296
+      Left = 195
+      Height = 27
+      Top = 439
+      Width = 282
       Anchors = [akTop, akLeft, akRight]
       BorderSpacing.Top = 3
-      TabOrder = 13
+      TabOrder = 14
       Text = 'DescriptionEdit'
     end
+    object LongPathCheckBox: TCheckBox
+      AnchorSideLeft.Control = UIAccessCheckBox
+      AnchorSideTop.Control = UIAccessCheckBox
+      AnchorSideTop.Side = asrBottom
+      Left = 27
+      Height = 24
+      Top = 382
+      Width = 156
+      Caption = 'LongPathCheckBox'
+      TabOrder = 12
+    end
   end
   object OpenPictureDialog1: TOpenPictureDialog
     left = 385
Index: ide/frames/project_application_options.pas
===================================================================
--- ide/frames/project_application_options.pas	(revision 59610)
+++ ide/frames/project_application_options.pas	(working copy)
@@ -25,6 +25,7 @@
 
   TProjectApplicationOptionsFrame = class(TAbstractIDEOptionsEditor)
     AppSettingsGroupBox: TGroupBox;
+    LongPathCheckBox: TCheckBox;
     DarwinDividerBevel: TDividerBevel;
     NameEdit: TEdit;
     DescriptionEdit: TEdit;
@@ -195,6 +196,7 @@
   ExecutionLevelLabel.Enabled := aEnable;
   ExecutionLevelComboBox.Enabled := aEnable;
   UIAccessCheckBox.Enabled := aEnable;
+  LongPathCheckBox.Enabled := aEnable;
   NameEdit.Enabled := aEnable;
   DescriptionEdit.Enabled := aEnable;
 end;
@@ -263,6 +265,7 @@
   for DpiLevel in TXPManifestDpiAware do
     DpiAwareComboBox.Items.Add(DpiLevelNames[DpiLevel] + ' (' + ManifestDpiAwareValues[DpiLevel] + ')');
   UIAccessCheckBox.Caption := dlgPOUIAccess;
+  LongPathCheckBox.Caption := dlgPOLongPathAware;
   NameLabel.Caption := lisName;
   DescriptionLabel.Caption := lisCodeHelpDescrTag;
 
@@ -308,6 +311,7 @@
       DpiAwareComboBox.ItemIndex := Ord(DpiAware);
       ExecutionLevelComboBox.ItemIndex := Ord(ExecutionLevel);
       UIAccessCheckBox.Checked := UIAccess;
+      LongPathCheckBox.Checked := LongPath;
       NameEdit.Text := TextName;
       DescriptionEdit.Text := TextDesc;
     end;
@@ -347,6 +351,7 @@
       DpiAware := TXPManifestDpiAware(DpiAwareComboBox.ItemIndex);
       ExecutionLevel := TXPManifestExecutionLevel(ExecutionLevelComboBox.ItemIndex);
       UIAccess := UIAccessCheckBox.Checked;
+      LongPath := LongPathCheckBox.Checked;
       TextName := NameEdit.Text;
       TextDesc := DescriptionEdit.Text;
     end;
Index: ide/lazarusidestrconsts.pas
===================================================================
--- ide/lazarusidestrconsts.pas	(revision 59610)
+++ ide/lazarusidestrconsts.pas	(working copy)
@@ -2626,6 +2626,7 @@
   dlgPODpiAwarenessOldOnNewPerMonitor = 'Vista-8: on, 8.1+: per monitor';
   dlgPODpiAwarenessOldOnNewPerMonitorV2 = 'Vista-8: on, 8.1/10+: per monitor/V2';
   dlgPOUIAccess = 'UI Access (uiAccess)';
+  dlgPOLongPathAware = 'Long path awareness';
   dlgPOAsInvoker = 'as invoker (asInvoker)';
   dlgPOHighestAvailable = 'highest available (highestAvailable)';
   dlgPORequireAdministrator = 'require administrator (requireAdministrator)';
Index: ide/w32manifest.pas
===================================================================
--- ide/w32manifest.pas	(revision 59610)
+++ ide/w32manifest.pas	(working copy)
@@ -68,6 +68,7 @@
     FDpiAware: TXPManifestDpiAware;
     FUIAccess: Boolean;
     FUseManifest: boolean;
+    FLongPath: Boolean;
     FTextName: string;
     FTextDesc: string;
     procedure SetDpiAware(AValue: TXPManifestDpiAware);
@@ -74,6 +75,7 @@
     procedure SetExecutionLevel(AValue: TXPManifestExecutionLevel);
     procedure SetUIAccess(AValue: Boolean);
     procedure SetUseManifest(const AValue: boolean);
+    procedure SetLongPath(AValue: Boolean);
     procedure SetTextName(const AValue: string);
     procedure SetTextDesc(const AValue: string);
   public
@@ -86,6 +88,7 @@
     property DpiAware: TXPManifestDpiAware read FDpiAware write SetDpiAware;
     property ExecutionLevel: TXPManifestExecutionLevel read FExecutionLevel write SetExecutionLevel;
     property UIAccess: Boolean read FUIAccess write SetUIAccess;
+    property LongPath: Boolean read FLongPath write SetLongPath;
     property TextName: string read FTextName write SetTextName;
     property TextDesc: string read FTextDesc write SetTextDesc;
   end;
@@ -153,6 +156,7 @@
     '  </asmv3:windowsSettings>'#$D#$A+
     '  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">'#$D#$A+
     '   %s'#$D#$A+
+    '   <longPathAware>%s</longPathAware>'#$D#$A+
     '  </asmv3:windowsSettings>'#$D#$A+
     ' </asmv3:application>'#$D#$A+
     '</assembly>';
@@ -178,6 +182,13 @@
   Modified := True;
 end;
 
+procedure TProjectXPManifest.SetLongPath(AValue: Boolean);
+begin
+  if FLongPath = AValue then exit;
+  FLongPath := AValue;
+  Modified := True;
+end;
+
 procedure TProjectXPManifest.SetDpiAware(AValue: TXPManifestDpiAware);
 begin
   if FDpiAware = AValue then Exit;
@@ -221,6 +232,7 @@
   DpiAware := xmdaFalse;
   ExecutionLevel := xmelAsInvoker;
   UIAccess := False;
+  LongPath := False;
   TextName := DefaultXPManifestTextName;
   TextDesc := DefaultXPManifestTextDesc;
 end;
@@ -246,7 +258,9 @@
       ExecutionLevelToStr[ExecutionLevel],
       BoolToStr(UIAccess, 'true', 'false'),
       ManifestDpiAwareValues[DpiAware],
-      ManifestDpiAwarenessValues[DpiAware]]);
+      ManifestDpiAwarenessValues[DpiAware],
+      BoolToStr(LongPath, 'true', 'false')
+      ]);
     Res.RawData.Write(ManifestFileData[1], Length(ManifestFileData));
     AResources.AddSystemResource(Res);
   end;
@@ -259,6 +273,7 @@
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/DpiAware/Value', ManifestDpiAwareValues[DpiAware], ManifestDpiAwareValues[xmdaFalse]);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/ExecutionLevel/Value', ExecutionLevelToStr[ExecutionLevel], ExecutionLevelToStr[xmelAsInvoker]);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/UIAccess/Value', UIAccess, False);
+  TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/LongPath/Value', LongPath, False);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextName/Value', TextName, DefaultXPManifestTextName);
   TXMLConfig(AConfig).SetDeleteValue(Path+'General/XPManifest/TextDesc/Value', TextDesc, DefaultXPManifestTextDesc);
 end;
@@ -287,6 +302,7 @@
     ExecutionLevel := StrToXPManifestExecutionLevel(Cfg.GetValue(Path+'General/XPManifest/ExecutionLevel/Value', ''));
 
   UIAccess := Cfg.GetValue(Path+'General/XPManifest/UIAccess/Value', False);
+  LongPath := Cfg.GetValue(Path+'General/XPManifest/LongPath/Value', False);
   TextName := Cfg.GetValue(Path+'General/XPManifest/TextName/Value', TextName);
   TextDesc := Cfg.GetValue(Path+'General/XPManifest/TextDesc/Value', TextDesc);
 end;
long.diff (16,375 bytes)

Serge Anvarov

2018-11-20 18:33

reporter   ~0112085

Just in case clarification.
Windows can perform operations with very long (more than MAX_PATH) file names with the prefix '\\?\' without manifest since Win2000, including ANSI functions.
The new manifest tells the new OS that any name, regardless of a special prefix, can be longer than MAX_PATH.
I'm not sure all functions of RTL, FCL, LCL take into account such long names.

Denis Kozlov

2018-11-20 21:23

reporter   ~0112087

It is probably best to name the option "LongPathAware", for consistency.

Denis Kozlov

2018-11-20 21:25

reporter   ~0112088

I have been playing around with long paths in the form of "\\?\C:\Very\Long\Path" and they have been working fine with RTL so far.

FYI, this manifest will also play a role when Windows API is passing files to the application, e.g. drag & drop, command line, etc. If the application is not LongPathAware, then you will get a DOS 8.3 style short path at best.

Alexey Tor.

2018-11-22 13:52

reporter   ~0112110

Last edited: 2018-11-23 06:39

View 3 revisions

Why LongPathAware? we have "DPI awareness", so "Long path awareness".

Denis Kozlov,
you asked for this feature. Pls test how patch works. is it correct XML manifest fix? Test on some app with some filename len >260.

Juha Manninen

2018-11-23 13:41

developer   ~0112134

Applied. Thanks.
I changed the variable/property name to LongPathAware. Indeed LongPath sounded like a string.

Denis Kozlov

2018-11-24 04:34

reporter   ~0112152

The new "Long path awareness" option is working!

Apparently, you need to do both, embed the manifest and enable long paths in the registry or group policy. Only then you will be able to use long paths without the "\\?\" prefix.

To enable via the Local Group Policy Editor, navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem> Enable Win32 long paths = Enabled.

Tested on Windows 10, Lazarus 2.1.0 r59644, using RenameFile RTL routine.

Issue History

Date Modified Username Field Change
2018-11-20 01:15 Alexey Tor. New Issue
2018-11-20 01:15 Alexey Tor. File Added: long.diff
2018-11-20 18:33 Serge Anvarov Note Added: 0112085
2018-11-20 21:23 Denis Kozlov Note Added: 0112087
2018-11-20 21:25 Denis Kozlov Note Added: 0112088
2018-11-22 13:52 Alexey Tor. Note Added: 0112110
2018-11-22 13:53 Alexey Tor. Note Edited: 0112110 View Revisions
2018-11-23 06:39 Alexey Tor. Note Edited: 0112110 View Revisions
2018-11-23 12:44 Juha Manninen Assigned To => Juha Manninen
2018-11-23 12:44 Juha Manninen Status new => assigned
2018-11-23 13:41 Juha Manninen Fixed in Revision => r59633
2018-11-23 13:41 Juha Manninen LazTarget => -
2018-11-23 13:41 Juha Manninen Note Added: 0112134
2018-11-23 13:41 Juha Manninen Status assigned => resolved
2018-11-23 13:41 Juha Manninen Resolution open => fixed
2018-11-23 14:17 Juha Manninen Relationship added related to 0034578
2018-11-24 04:34 Denis Kozlov Note Added: 0112152