Index: trunk/installer/ChooseFolderFormUnit.pas
===================================================================
--- trunk/installer/ChooseFolderFormUnit.pas	(revision 207)
+++ trunk/installer/ChooseFolderFormUnit.pas	(revision 208)
@@ -8,5 +8,10 @@
 
 Uses
-  Classes, Forms, Graphics, Buttons, CustomFileControls, StdCtrls;
+  Classes,
+  Forms,
+  Graphics,
+  Buttons,
+  CustomFileControls,
+  StdCtrls;
 
 Type
Index: trunk/installer/MainFormUnit.pas
===================================================================
--- trunk/installer/MainFormUnit.pas	(revision 207)
+++ trunk/installer/MainFormUnit.pas	(revision 208)
@@ -8,6 +8,14 @@
 
 Uses
-  OS2Def, PmWin,
-  Classes, Forms, Graphics, ExtCtrls, Buttons, StdCtrls, TabCtrls, ComCtrls;
+  OS2Def,
+  PmWin,
+  Classes,
+  Forms,
+  Graphics,
+  ExtCtrls,
+  Buttons,
+  StdCtrls,
+  TabCtrls,
+  ComCtrls;
 
 Const
@@ -159,9 +167,19 @@
 
 uses
-  BseDos, BseErr, PmWp, PmShl, PmErr,
-  SysUtils, Dos, Dialogs,
-  ACLUtility, ACLFileUtility, ACLStringUtility, ACLDialogs,
+  BseDos,
+  BseErr,
+  PmWp,
+  PmShl,
+  PmErr,
+  SysUtils,
+  Dos,
+  Dialogs,
+  ACLUtility,
+  ACLDialogs,
   ControlsUtility,
-  ChooseFolderFormUnit;
+  ChooseFolderFormUnit,
+  FileUtilsUnit,
+  CharUtilsUnit,
+  StringUtilsUnit;
 
 {$R NewViewInstall}
@@ -386,5 +404,5 @@
   // make sure it ends in a backslash
   if Result <> '' then
-    Result := AddSlash( Result );
+    Result := AddDirectorySeparator( Result );
 end;
 
@@ -393,8 +411,6 @@
   FSourceDir := GetApplicationDir;
 
-  FSystemDir := GetBootDrive
-                + ':\os2\';
-  FSystemDLLDir := FSystemDir
-                   + 'dll\';
+  FSystemDir := GetBootDriveLetter + ':\os2\';
+  FSystemDLLDir := FSystemDir + 'dll\';
 
   // ecs things
@@ -411,8 +427,7 @@
 
   if FEnv_Programs <> '' then
-    InstallFolderEdit.Text := AddSlash( FEnv_Programs )
-                               + 'NewView'
+    InstallFolderEdit.Text := AddDirectorySeparator(FEnv_Programs) + 'NewView'
   else
-    InstallFolderEdit.Text := GetBootDrive + ':\NewView';
+    InstallFolderEdit.Text := GetBootDriveLetter + ':\NewView';
 
   CreateIconCheckBox.Checked := true;
@@ -499,6 +514,6 @@
     begin
       DoErrorDlg( 'Installation Error',
-                  'The file ' + EndLine
-                  + ' ' + DestinationPath + EndLine
+                  'The file ' + StrCRLF
+                  + ' ' + DestinationPath + StrCRLF
                   + 'is read-only and cannot be replaced.' );
       exit;
@@ -530,6 +545,6 @@
         // But that's overkill for NewView
         DoErrorDlg( 'Installation Error',
-                    'This file is in use: ' + EndLine
-                    + ' ' + DestinationPath + EndLine
+                    'This file is in use: ' + StrCRLF
+                    + ' ' + DestinationPath + StrCRLF
                     + 'and cannot be replaced.' );
         exit;
@@ -545,6 +560,6 @@
         // error
         DoErrorDlg( 'Install Error',
-                    'Could not unlock ' + EndLine
-                    + ' ' + DestinationPath + EndLine
+                    'Could not unlock ' + StrCRLF
+                    + ' ' + DestinationPath + StrCRLF
                     + SysErrorMessage( rc ) );
 
@@ -555,6 +570,6 @@
     begin
       DoErrorDlg( 'Install Error',
-                  'Unable to acces ' + Endline
-                  + ' ' + DestinationPath + EndLine
+                  'Unable to acces ' + StrCRLF
+                  + ' ' + DestinationPath + StrCRLF
                   + SysErrorMessage( rc ) );
       exit;
@@ -575,9 +590,9 @@
           // error
           DoErrorDlg( 'Install Error',
-                      'Could not backup ' + EndLine
-                      + ' ' + DestinationPath + EndLine
-                      + ' to' + EndLine
-                      + ' ' + Backup + EndLine
-                      + EndLine
+                      'Could not backup ' + StrCRLF
+                      + ' ' + DestinationPath + StrCRLF
+                      + ' to' + StrCRLF
+                      + ' ' + Backup + StrCRLF
+                      + StrCRLF
                       + SysErrorMessage( rc ) );
           exit;
@@ -595,9 +610,9 @@
     // error
     DoErrorDlg( 'Install Error',
-                'Could not copy new file ' + EndLine
-                + ' ' + SourcePath + EndLine
-                + ' to' + EndLine
-                + ' ' + DestinationPath + EndLine
-                + EndLine
+                'Could not copy new file ' + StrCRLF
+                + ' ' + SourcePath + StrCRLF
+                + ' to' + StrCRLF
+                + ' ' + DestinationPath + StrCRLF
+                + StrCRLF
                 + SysErrorMessage( rc ) );
     exit;
@@ -618,8 +633,8 @@
 
   Files := TStringList.Create;
-  ListDirectory( FSourceDir,
+  ListFilesInDirectory( FSourceDir,
                  Filter,
-                 Files,
-                 nil ); // don't need subdirs
+                 false, // don't need subdirs
+                 Files); // don't need subdirs
 
   for i := 0 to Files.Count - 1 do
@@ -678,7 +693,7 @@
       // work out remaining length of buffer
       // so we don't overrun it if the data is invalid, ie. non terminated
-      RemainingLength := PCharDiff( pHandleListData + HandleListSize,
+      RemainingLength := PCharPointerDiff( pHandleListData + HandleListSize,
                                     pHandleString );
-      HandleString := StrNPas( pHandleString, RemainingLength );
+      HandleString := StrPasWithLength( pHandleString, RemainingLength );
 
       // convert to integer object handle
@@ -740,5 +755,5 @@
   inc( pHandleString );
 
-  ActualLength := PCharDiff( pHandleString, pHandleListData );
+  ActualLength := PCharPointerDiff( pHandleString, pHandleListData );
   result := PrfWriteProfileData( HINI_USER,
                                  FilterAssociationsKey,
@@ -786,18 +801,28 @@
 // association one of more file filters,
 // separated by commas, with the given object
-function MakeDefaultAssociations( const Mask: string;
+function MakeDefaultAssociations( const aMask: string;
                                   hDesktopObject: HOBJECT ): boolean;
 var
-  Filter: string;
-  RemainingMask: string;
+  tmpMask : String;
+  tmpMasks : TStringList;
+  i : longint;
 begin
   Result := false;
-  RemainingMask := Mask;
-  while RemainingMask <> '' do
-  begin
-    Filter := ExtractNextValue( RemainingMask, ',' );
-    if not MakeDefaultAssociation( Filter, hDesktopObject ) then
-      exit;
-  end;
+
+  tmpMasks := TStringList.Create;
+  StrExtractStrings(tmpMasks, aMask, [','], #0);
+
+  for i := 0 to tmpMasks.Count - 1 do
+  begin
+    tmpMask := tmpMasks[i];
+    if not makeDefaultAssociation(tmpMask, hDesktopObject ) then
+    begin
+      tmpMasks.Destroy;
+      exit;
+    end;
+  end;
+
+  tmpMasks.Destroy;
+
   Result := true;
 end;
@@ -838,5 +863,5 @@
     WPERR_INVALID_FOLDER:
       DoErrorDlg( 'Warning',
-                  'Unable to create desktop icon:' + EndLine
+                  'Unable to create desktop icon:' + StrCRLF
                   + IntToHex( PMError, 8 )
                   + ': The desktop is not correctly installed '
@@ -845,5 +870,5 @@
     WPERR_NOT_WORKPLACE_CLASS:
       DoErrorDlg( 'Warning',
-                  'Unable to create desktop icon:' + EndLine
+                  'Unable to create desktop icon:' + StrCRLF
                   + IntToHex( PMError, 8 )
                   + ': WPProgram class is missing.' );
@@ -851,5 +876,5 @@
     else
       DoErrorDlg( 'Installation Error',
-                  'Unable to create desktop icon' + EndLine
+                  'Unable to create desktop icon' + StrCRLF
                   + IntToHex( PMError, 8 )
                   + ': There may be some problem with the desktop.' );
@@ -870,7 +895,6 @@
   Files: TStringList;
   i: longint;
-  RemainingNames: string;
   FileName: string;
-  VarName: string;
+  tmpVarNames : TStringList;
   FileDir: string;
   CorrectDir: string;
@@ -882,12 +906,12 @@
 
   FileName := ExtractFileName( CorrectPath );
-  RemainingNames := VarNames;
-  while RemainingNames <> '' do
-  begin
-    VarName := ExtractNextValue( RemainingNames, ';' );
-    GetFilesForPath( VarName,
-                     FileName,
-                     Files );
-  end;
+
+  tmpVarNames := TStringList.Create;
+  StrExtractStrings(tmpVarNames, VarNames, [';'], #0);
+  for i := 0 to tmpVarNames.Count - 1 do
+  begin
+    GetFilesInPath( tmpVarNames[i], FileName, Files );
+  end;
+  tmpVarNames.Destroy;
 
   CorrectDir := ExtractFilePath( CorrectPath );
@@ -903,6 +927,6 @@
 
     // if it's where we're aiming for then that's fine
-    if    StringsSame( FileDir, CorrectDir )
-       or StringsSame( FileDir, GetApplicationDir )
+    if    StrEqualIgnoringCase( FileDir, CorrectDir )
+       or StrEqualIgnoringCase( FileDir, GetApplicationDir )
       then
       Files.Delete( i )
@@ -915,11 +939,11 @@
       DoConfirmListDlg( 'Duplicates Warning',
                         'The file'
-                        + EndLine
+                        + StrCRLF
                         + '  ' + FileName
-                        + EndLine
+                        + StrCRLF
                         + 'will be installed to '
-                        + EndLine
+                        + StrCRLF
                         + '  ' + ExtractFilePath( CorrectPath )
-                        + EndLine
+                        + StrCRLF
                         + 'but there are other copies on your computer. '
                         + 'The wrong file might be used. '
@@ -1039,5 +1063,5 @@
         DoErrorDlg( 'Folder Error',
                     'Could not create the NewView doc folder '
-                    + DocDir+ EndLine
+                    + DocDir+ StrCRLF
                     + SysErrorMessage( E.ErrorCode ) );
         exit;
@@ -1290,5 +1314,5 @@
 
   // validate/create install dir
-  InstallDir := AddSlash( InstallFolderEdit.Text );
+  InstallDir := AddDirectorySeparator(InstallFolderEdit.Text);
   if InstallToSourceCheckbox.Checked then
   begin
@@ -1304,5 +1328,5 @@
         DoErrorDlg( 'Folder Error',
                     'Could not create the installation folder '
-                    + InstallDir + EndLine
+                    + InstallDir + StrCRLF
                     + SysErrorMessage( E.ErrorCode ) );
         exit;
Index: trunk/installer/NewViewInstall.pas
===================================================================
--- trunk/installer/NewViewInstall.pas	(revision 207)
+++ trunk/installer/NewViewInstall.pas	(revision 208)
@@ -2,5 +2,7 @@
 
 Uses
-  Forms, MainFormUnit, ChooseFolderFormUnit;
+  Forms,
+  MainFormUnit,
+  ChooseFolderFormUnit;
 
 {$r NewViewInstall.scu}
