Changeset 208 for trunk/installer
- Timestamp:
- Jun 11, 2007, 8:47:50 PM (18 years ago)
- Location:
- trunk/installer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/installer/ChooseFolderFormUnit.pas
r144 r208 8 8 9 9 Uses 10 Classes, Forms, Graphics, Buttons, CustomFileControls, StdCtrls; 10 Classes, 11 Forms, 12 Graphics, 13 Buttons, 14 CustomFileControls, 15 StdCtrls; 11 16 12 17 Type -
trunk/installer/MainFormUnit.pas
r144 r208 8 8 9 9 Uses 10 OS2Def, PmWin, 11 Classes, Forms, Graphics, ExtCtrls, Buttons, StdCtrls, TabCtrls, ComCtrls; 10 OS2Def, 11 PmWin, 12 Classes, 13 Forms, 14 Graphics, 15 ExtCtrls, 16 Buttons, 17 StdCtrls, 18 TabCtrls, 19 ComCtrls; 12 20 13 21 Const … … 159 167 160 168 uses 161 BseDos, BseErr, PmWp, PmShl, PmErr, 162 SysUtils, Dos, Dialogs, 163 ACLUtility, ACLFileUtility, ACLStringUtility, ACLDialogs, 169 BseDos, 170 BseErr, 171 PmWp, 172 PmShl, 173 PmErr, 174 SysUtils, 175 Dos, 176 Dialogs, 177 ACLUtility, 178 ACLDialogs, 164 179 ControlsUtility, 165 ChooseFolderFormUnit; 180 ChooseFolderFormUnit, 181 FileUtilsUnit, 182 CharUtilsUnit, 183 StringUtilsUnit; 166 184 167 185 {$R NewViewInstall} … … 386 404 // make sure it ends in a backslash 387 405 if Result <> '' then 388 Result := Add Slash( Result );406 Result := AddDirectorySeparator( Result ); 389 407 end; 390 408 … … 393 411 FSourceDir := GetApplicationDir; 394 412 395 FSystemDir := GetBootDrive 396 + ':\os2\'; 397 FSystemDLLDir := FSystemDir 398 + 'dll\'; 413 FSystemDir := GetBootDriveLetter + ':\os2\'; 414 FSystemDLLDir := FSystemDir + 'dll\'; 399 415 400 416 // ecs things … … 411 427 412 428 if FEnv_Programs <> '' then 413 InstallFolderEdit.Text := AddSlash( FEnv_Programs ) 414 + 'NewView' 429 InstallFolderEdit.Text := AddDirectorySeparator(FEnv_Programs) + 'NewView' 415 430 else 416 InstallFolderEdit.Text := GetBootDrive + ':\NewView';431 InstallFolderEdit.Text := GetBootDriveLetter + ':\NewView'; 417 432 418 433 CreateIconCheckBox.Checked := true; … … 499 514 begin 500 515 DoErrorDlg( 'Installation Error', 501 'The file ' + EndLine502 + ' ' + DestinationPath + EndLine516 'The file ' + StrCRLF 517 + ' ' + DestinationPath + StrCRLF 503 518 + 'is read-only and cannot be replaced.' ); 504 519 exit; … … 530 545 // But that's overkill for NewView 531 546 DoErrorDlg( 'Installation Error', 532 'This file is in use: ' + EndLine533 + ' ' + DestinationPath + EndLine547 'This file is in use: ' + StrCRLF 548 + ' ' + DestinationPath + StrCRLF 534 549 + 'and cannot be replaced.' ); 535 550 exit; … … 545 560 // error 546 561 DoErrorDlg( 'Install Error', 547 'Could not unlock ' + EndLine548 + ' ' + DestinationPath + EndLine562 'Could not unlock ' + StrCRLF 563 + ' ' + DestinationPath + StrCRLF 549 564 + SysErrorMessage( rc ) ); 550 565 … … 555 570 begin 556 571 DoErrorDlg( 'Install Error', 557 'Unable to acces ' + Endline558 + ' ' + DestinationPath + EndLine572 'Unable to acces ' + StrCRLF 573 + ' ' + DestinationPath + StrCRLF 559 574 + SysErrorMessage( rc ) ); 560 575 exit; … … 575 590 // error 576 591 DoErrorDlg( 'Install Error', 577 'Could not backup ' + EndLine578 + ' ' + DestinationPath + EndLine579 + ' to' + EndLine580 + ' ' + Backup + EndLine581 + EndLine592 'Could not backup ' + StrCRLF 593 + ' ' + DestinationPath + StrCRLF 594 + ' to' + StrCRLF 595 + ' ' + Backup + StrCRLF 596 + StrCRLF 582 597 + SysErrorMessage( rc ) ); 583 598 exit; … … 595 610 // error 596 611 DoErrorDlg( 'Install Error', 597 'Could not copy new file ' + EndLine598 + ' ' + SourcePath + EndLine599 + ' to' + EndLine600 + ' ' + DestinationPath + EndLine601 + EndLine612 'Could not copy new file ' + StrCRLF 613 + ' ' + SourcePath + StrCRLF 614 + ' to' + StrCRLF 615 + ' ' + DestinationPath + StrCRLF 616 + StrCRLF 602 617 + SysErrorMessage( rc ) ); 603 618 exit; … … 618 633 619 634 Files := TStringList.Create; 620 List Directory( FSourceDir,635 ListFilesInDirectory( FSourceDir, 621 636 Filter, 622 Files,623 nil); // don't need subdirs637 false, // don't need subdirs 638 Files); // don't need subdirs 624 639 625 640 for i := 0 to Files.Count - 1 do … … 678 693 // work out remaining length of buffer 679 694 // so we don't overrun it if the data is invalid, ie. non terminated 680 RemainingLength := PChar Diff( pHandleListData + HandleListSize,695 RemainingLength := PCharPointerDiff( pHandleListData + HandleListSize, 681 696 pHandleString ); 682 HandleString := Str NPas( pHandleString, RemainingLength );697 HandleString := StrPasWithLength( pHandleString, RemainingLength ); 683 698 684 699 // convert to integer object handle … … 740 755 inc( pHandleString ); 741 756 742 ActualLength := PChar Diff( pHandleString, pHandleListData );757 ActualLength := PCharPointerDiff( pHandleString, pHandleListData ); 743 758 result := PrfWriteProfileData( HINI_USER, 744 759 FilterAssociationsKey, … … 786 801 // association one of more file filters, 787 802 // separated by commas, with the given object 788 function MakeDefaultAssociations( const Mask: string;803 function MakeDefaultAssociations( const aMask: string; 789 804 hDesktopObject: HOBJECT ): boolean; 790 805 var 791 Filter: string; 792 RemainingMask: string; 806 tmpMask : String; 807 tmpMasks : TStringList; 808 i : longint; 793 809 begin 794 810 Result := false; 795 RemainingMask := Mask; 796 while RemainingMask <> '' do 797 begin 798 Filter := ExtractNextValue( RemainingMask, ',' ); 799 if not MakeDefaultAssociation( Filter, hDesktopObject ) then 800 exit; 801 end; 811 812 tmpMasks := TStringList.Create; 813 StrExtractStrings(tmpMasks, aMask, [','], #0); 814 815 for i := 0 to tmpMasks.Count - 1 do 816 begin 817 tmpMask := tmpMasks[i]; 818 if not makeDefaultAssociation(tmpMask, hDesktopObject ) then 819 begin 820 tmpMasks.Destroy; 821 exit; 822 end; 823 end; 824 825 tmpMasks.Destroy; 826 802 827 Result := true; 803 828 end; … … 838 863 WPERR_INVALID_FOLDER: 839 864 DoErrorDlg( 'Warning', 840 'Unable to create desktop icon:' + EndLine865 'Unable to create desktop icon:' + StrCRLF 841 866 + IntToHex( PMError, 8 ) 842 867 + ': The desktop is not correctly installed ' … … 845 870 WPERR_NOT_WORKPLACE_CLASS: 846 871 DoErrorDlg( 'Warning', 847 'Unable to create desktop icon:' + EndLine872 'Unable to create desktop icon:' + StrCRLF 848 873 + IntToHex( PMError, 8 ) 849 874 + ': WPProgram class is missing.' ); … … 851 876 else 852 877 DoErrorDlg( 'Installation Error', 853 'Unable to create desktop icon' + EndLine878 'Unable to create desktop icon' + StrCRLF 854 879 + IntToHex( PMError, 8 ) 855 880 + ': There may be some problem with the desktop.' ); … … 870 895 Files: TStringList; 871 896 i: longint; 872 RemainingNames: string;873 897 FileName: string; 874 VarName: string;898 tmpVarNames : TStringList; 875 899 FileDir: string; 876 900 CorrectDir: string; … … 882 906 883 907 FileName := ExtractFileName( CorrectPath ); 884 RemainingNames := VarNames; 885 while RemainingNames <> '' do886 begin887 VarName := ExtractNextValue( RemainingNames, ';' );888 GetFilesForPath( VarName,889 FileName,890 Files );891 end;908 909 tmpVarNames := TStringList.Create; 910 StrExtractStrings(tmpVarNames, VarNames, [';'], #0); 911 for i := 0 to tmpVarNames.Count - 1 do 912 begin 913 GetFilesInPath( tmpVarNames[i], FileName, Files ); 914 end; 915 tmpVarNames.Destroy; 892 916 893 917 CorrectDir := ExtractFilePath( CorrectPath ); … … 903 927 904 928 // if it's where we're aiming for then that's fine 905 if Str ingsSame( FileDir, CorrectDir )906 or Str ingsSame( FileDir, GetApplicationDir )929 if StrEqualIgnoringCase( FileDir, CorrectDir ) 930 or StrEqualIgnoringCase( FileDir, GetApplicationDir ) 907 931 then 908 932 Files.Delete( i ) … … 915 939 DoConfirmListDlg( 'Duplicates Warning', 916 940 'The file' 917 + EndLine941 + StrCRLF 918 942 + ' ' + FileName 919 + EndLine943 + StrCRLF 920 944 + 'will be installed to ' 921 + EndLine945 + StrCRLF 922 946 + ' ' + ExtractFilePath( CorrectPath ) 923 + EndLine947 + StrCRLF 924 948 + 'but there are other copies on your computer. ' 925 949 + 'The wrong file might be used. ' … … 1039 1063 DoErrorDlg( 'Folder Error', 1040 1064 'Could not create the NewView doc folder ' 1041 + DocDir+ EndLine1065 + DocDir+ StrCRLF 1042 1066 + SysErrorMessage( E.ErrorCode ) ); 1043 1067 exit; … … 1290 1314 1291 1315 // validate/create install dir 1292 InstallDir := Add Slash( InstallFolderEdit.Text);1316 InstallDir := AddDirectorySeparator(InstallFolderEdit.Text); 1293 1317 if InstallToSourceCheckbox.Checked then 1294 1318 begin … … 1304 1328 DoErrorDlg( 'Folder Error', 1305 1329 'Could not create the installation folder ' 1306 + InstallDir + EndLine1330 + InstallDir + StrCRLF 1307 1331 + SysErrorMessage( E.ErrorCode ) ); 1308 1332 exit; -
trunk/installer/NewViewInstall.pas
r144 r208 2 2 3 3 Uses 4 Forms, MainFormUnit, ChooseFolderFormUnit; 4 Forms, 5 MainFormUnit, 6 ChooseFolderFormUnit; 5 7 6 8 {$r NewViewInstall.scu}
Note:
See TracChangeset
for help on using the changeset viewer.