Work-in-progress.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5720 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
gbamber
2017-01-28 08:18:06 +00:00
parent 4fa832acde
commit 0b3de90fc7
3 changed files with 198 additions and 167 deletions

View File

@ -10,7 +10,7 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="8"/> <EditorIndex Value="8"/>
<CursorPos X="25" Y="28"/> <CursorPos X="25" Y="28"/>
<UsageCount Value="67"/> <UsageCount Value="94"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -21,7 +21,7 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<TopLine Value="208"/> <TopLine Value="208"/>
<CursorPos X="66" Y="220"/> <CursorPos X="66" Y="220"/>
<UsageCount Value="67"/> <UsageCount Value="94"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit1> </Unit1>
@ -32,25 +32,25 @@
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="31"/> <TopLine Value="31"/>
<CursorPos X="48" Y="14"/> <CursorPos X="48" Y="14"/>
<UsageCount Value="50"/> <UsageCount Value="77"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="..\lazautoupdate_httpclient.pas"/> <Filename Value="..\lazautoupdate_httpclient.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos X="97" Y="12"/> <CursorPos X="97" Y="12"/>
<UsageCount Value="22"/> <UsageCount Value="19"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<IsVisibleTab Value="True"/> <EditorIndex Value="1"/>
<WindowIndex Value="1"/> <TopLine Value="44"/>
<TopLine Value="1707"/> <CursorPos X="63" Y="61"/>
<CursorPos X="44" Y="1747"/>
<ExtraEditorCount Value="2"/> <ExtraEditorCount Value="2"/>
<ExtraEditor1> <ExtraEditor1>
<EditorIndex Value="1"/> <IsVisibleTab Value="True"/>
<TopLine Value="1058"/> <WindowIndex Value="1"/>
<CursorPos X="68" Y="1025"/> <TopLine Value="1707"/>
<CursorPos X="44" Y="1747"/>
</ExtraEditor1> </ExtraEditor1>
<ExtraEditor2> <ExtraEditor2>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
@ -58,7 +58,7 @@
<TopLine Value="-1"/> <TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/> <CursorPos X="-1" Y="-1"/>
</ExtraEditor2> </ExtraEditor2>
<UsageCount Value="32"/> <UsageCount Value="45"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
@ -67,20 +67,20 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="101"/> <TopLine Value="101"/>
<CursorPos Y="154"/> <CursorPos Y="154"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<Filename Value="..\..\..\..\applications\foobot\monitor\foobot_sensors.pas"/> <Filename Value="..\..\..\..\applications\foobot\monitor\foobot_sensors.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="76"/> <TopLine Value="76"/>
<CursorPos X="75" Y="77"/> <CursorPos X="75" Y="77"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="..\..\..\..\applications\foobot\foobot.lpr"/> <Filename Value="..\..\..\..\applications\foobot\foobot.lpr"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos Y="21"/> <CursorPos Y="21"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
<Filename Value="C:\trunklatest\lazarus\lcl\asyncprocess.pp"/> <Filename Value="C:\trunklatest\lazarus\lcl\asyncprocess.pp"/>
@ -88,27 +88,27 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="22"/> <TopLine Value="22"/>
<CursorPos X="31" Y="31"/> <CursorPos X="31" Y="31"/>
<UsageCount Value="11"/> <UsageCount Value="8"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
<Filename Value="C:\trunklatest\lazarus\components\lazutils\utf8process.pp"/> <Filename Value="C:\trunklatest\lazarus\components\lazutils\utf8process.pp"/>
<UnitName Value="UTF8Process"/> <UnitName Value="UTF8Process"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos X="3" Y="85"/> <CursorPos X="3" Y="85"/>
<UsageCount Value="11"/> <UsageCount Value="8"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="..\..\..\..\applications\foobot\monitor\umainform.pas"/> <Filename Value="..\..\..\..\applications\foobot\monitor\umainform.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="25"/> <TopLine Value="25"/>
<CursorPos X="22" Y="36"/> <CursorPos X="22" Y="36"/>
<UsageCount Value="20"/> <UsageCount Value="17"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="C:\trunklatest\fpc\rtl\objpas\sysutils\osutilsh.inc"/> <Filename Value="C:\trunklatest\fpc\rtl\objpas\sysutils\osutilsh.inc"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos X="10" Y="20"/> <CursorPos X="10" Y="20"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit11> </Unit11>
<Unit12> <Unit12>
<Filename Value="..\versionsupport.pas"/> <Filename Value="..\versionsupport.pas"/>
@ -116,28 +116,28 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="4"/> <TopLine Value="4"/>
<CursorPos X="8" Y="31"/> <CursorPos X="8" Y="31"/>
<UsageCount Value="17"/> <UsageCount Value="14"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
<Filename Value="C:\laztrunk\fpc\examples\httpd22\minimain.pas"/> <Filename Value="C:\laztrunk\fpc\examples\httpd22\minimain.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="3"/> <TopLine Value="3"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="..\uappisrunning.pas"/> <Filename Value="..\uappisrunning.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="124"/> <TopLine Value="124"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit14> </Unit14>
<Unit15> <Unit15>
<Filename Value="..\..\..\cryptini\latest_stable\ucryptini.pas"/> <Filename Value="..\..\..\cryptini\latest_stable\ucryptini.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="372"/> <TopLine Value="372"/>
<UsageCount Value="9"/> <UsageCount Value="6"/>
</Unit15> </Unit15>
<Unit16> <Unit16>
<Filename Value="..\updatehmsource\updatehm.lpr"/> <Filename Value="..\updatehmsource\updatehm.lpr"/>
@ -145,7 +145,7 @@
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="132"/> <TopLine Value="132"/>
<CursorPos X="6" Y="338"/> <CursorPos X="6" Y="338"/>
<UsageCount Value="22"/> <UsageCount Value="35"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit16> </Unit16>
<Unit17> <Unit17>
@ -154,13 +154,13 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="24"/> <TopLine Value="24"/>
<CursorPos Y="33"/> <CursorPos Y="33"/>
<UsageCount Value="11"/> <UsageCount Value="8"/>
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="..\trayicon\trayupdater.lpr"/> <Filename Value="..\trayicon\trayupdater.lpr"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit18> </Unit18>
<Unit19> <Unit19>
<Filename Value="..\..\..\mbColorLib\mbutils.pas"/> <Filename Value="..\..\..\mbColorLib\mbutils.pas"/>
@ -168,28 +168,28 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="4"/> <TopLine Value="4"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit19> </Unit19>
<Unit20> <Unit20>
<Filename Value="..\..\..\mbColorLib\ScreenWin.pas"/> <Filename Value="..\..\..\mbColorLib\ScreenWin.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit20> </Unit20>
<Unit21> <Unit21>
<Filename Value="..\..\..\mbColorLib\LVColorPicker.pas"/> <Filename Value="..\..\..\mbColorLib\LVColorPicker.pas"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<WindowIndex Value="1"/> <WindowIndex Value="1"/>
<TopLine Value="290"/> <TopLine Value="290"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit21> </Unit21>
<Unit22> <Unit22>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<TopLine Value="251"/> <TopLine Value="219"/>
<CursorPos X="69" Y="278"/> <CursorPos X="87" Y="240"/>
<UsageCount Value="23"/> <UsageCount Value="36"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit22> </Unit22>
<Unit23> <Unit23>
@ -197,14 +197,14 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="116"/> <TopLine Value="116"/>
<CursorPos X="24" Y="125"/> <CursorPos X="24" Y="125"/>
<UsageCount Value="11"/> <UsageCount Value="8"/>
</Unit23> </Unit23>
<Unit24> <Unit24>
<Filename Value="C:\laztrunk\fpc\packages\winunits-base\src\shlobj.pp"/> <Filename Value="C:\laztrunk\fpc\packages\winunits-base\src\shlobj.pp"/>
<EditorIndex Value="7"/> <EditorIndex Value="7"/>
<TopLine Value="2203"/> <TopLine Value="2203"/>
<CursorPos X="56" Y="2335"/> <CursorPos X="56" Y="2335"/>
<UsageCount Value="12"/> <UsageCount Value="25"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit24> </Unit24>
<Unit25> <Unit25>
@ -212,7 +212,7 @@
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<TopLine Value="399"/> <TopLine Value="399"/>
<CursorPos X="30" Y="426"/> <CursorPos X="30" Y="426"/>
<UsageCount Value="11"/> <UsageCount Value="24"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit25> </Unit25>
<Unit26> <Unit26>
@ -220,14 +220,14 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="12"/> <TopLine Value="12"/>
<CursorPos X="5" Y="39"/> <CursorPos X="5" Y="39"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit26> </Unit26>
<Unit27> <Unit27>
<Filename Value="..\aboutlazautoupdateunit.pas"/> <Filename Value="..\aboutlazautoupdateunit.pas"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<TopLine Value="65"/> <TopLine Value="65"/>
<CursorPos X="41" Y="86"/> <CursorPos X="41" Y="86"/>
<UsageCount Value="11"/> <UsageCount Value="24"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit27> </Unit27>
<Unit28> <Unit28>
@ -235,13 +235,13 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="10"/> <TopLine Value="10"/>
<CursorPos X="25" Y="40"/> <CursorPos X="25" Y="40"/>
<UsageCount Value="10"/> <UsageCount Value="7"/>
</Unit28> </Unit28>
<Unit29> <Unit29>
<Filename Value="C:\laztrunk\fpc\rtl\objpas\sysutils\finah.inc"/> <Filename Value="C:\laztrunk\fpc\rtl\objpas\sysutils\finah.inc"/>
<EditorIndex Value="6"/> <EditorIndex Value="6"/>
<CursorPos X="10" Y="33"/> <CursorPos X="10" Y="33"/>
<UsageCount Value="10"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit29> </Unit29>
<Unit30> <Unit30>
@ -250,7 +250,7 @@
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<TopLine Value="273"/> <TopLine Value="273"/>
<CursorPos X="3" Y="278"/> <CursorPos X="3" Y="278"/>
<UsageCount Value="10"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit30> </Unit30>
</Units> </Units>
@ -259,124 +259,124 @@
</OtherDefines> </OtherDefines>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="785" TopLine="758"/> <Caret Line="176" Column="4" TopLine="157"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="784" Column="41" TopLine="757"/> <Caret Line="170" Column="45" TopLine="159"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="474" TopLine="456"/> <Caret Line="194" TopLine="170"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="966" Column="70" TopLine="931"/> <Caret Line="147" TopLine="145"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="15" Column="16" TopLine="8"/> <Caret Line="146" TopLine="144"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="152" Column="37" TopLine="146"/> <Caret Line="148" TopLine="146"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="154" Column="37" TopLine="148"/> <Caret Line="125" TopLine="108"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="1014" Column="57" TopLine="977"/> <Caret Line="118" Column="30" TopLine="93"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="176" Column="4" TopLine="157"/> <Caret Line="124" Column="45" TopLine="103"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="170" Column="45" TopLine="159"/> <Caret Line="125" Column="45" TopLine="104"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="194" TopLine="170"/> <Caret Line="198" Column="3" TopLine="196"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="147" TopLine="145"/> <Caret Line="214" Column="56" TopLine="201"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="umainform.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="146" TopLine="144"/> <Caret Line="216" Column="56" TopLine="203"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="umainform.pas"/>
<Caret Line="148" TopLine="146"/>
</Position14>
<Position15>
<Filename Value="umainform.pas"/>
<Caret Line="125" TopLine="108"/>
</Position15>
<Position16>
<Filename Value="umainform.pas"/>
<Caret Line="118" Column="30" TopLine="93"/>
</Position16>
<Position17>
<Filename Value="umainform.pas"/>
<Caret Line="124" Column="45" TopLine="103"/>
</Position17>
<Position18>
<Filename Value="umainform.pas"/>
<Caret Line="125" Column="45" TopLine="104"/>
</Position18>
<Position19>
<Filename Value="umainform.pas"/>
<Caret Line="198" Column="3" TopLine="196"/>
</Position19>
<Position20>
<Filename Value="umainform.pas"/>
<Caret Line="214" Column="56" TopLine="201"/>
</Position20>
<Position21>
<Filename Value="umainform.pas"/>
<Caret Line="216" Column="56" TopLine="203"/>
</Position21>
<Position22>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="1004" Column="101" TopLine="970"/> <Caret Line="1004" Column="101" TopLine="970"/>
</Position14>
<Position15>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="268" Column="79" TopLine="239"/>
</Position15>
<Position16>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="235" Column="60" TopLine="216"/>
</Position16>
<Position17>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="272" Column="25" TopLine="245"/>
</Position17>
<Position18>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="233" Column="47" TopLine="214"/>
</Position18>
<Position19>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="239" Column="20" TopLine="229"/>
</Position19>
<Position20>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="295" Column="31" TopLine="259"/>
</Position20>
<Position21>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="289" Column="22" TopLine="268"/>
</Position21>
<Position22>
<Filename Value="..\ushortcut.pas"/>
<Caret Line="278" Column="71" TopLine="268"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="268" Column="79" TopLine="239"/> <Caret Line="306" Column="78" TopLine="269"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="235" Column="60" TopLine="216"/> <Caret Line="289" Column="57" TopLine="261"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="272" Column="25" TopLine="245"/> <Caret Line="255" Column="57" TopLine="229"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="233" Column="47" TopLine="214"/> <Caret Line="308" Column="21" TopLine="277"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="239" Column="20" TopLine="229"/> <Caret Line="149" Column="39" TopLine="121"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="295" Column="31" TopLine="259"/> <Caret Line="999" Column="4" TopLine="970"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="289" Column="22" TopLine="268"/> <Caret Line="186" Column="24" TopLine="160"/>
</Position29> </Position29>
<Position30> <Position30>
<Filename Value="..\ushortcut.pas"/> <Filename Value="..\ushortcut.pas"/>
<Caret Line="278" Column="71" TopLine="268"/> <Caret Line="245" Column="26" TopLine="218"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectSession> </ProjectSession>

View File

@ -993,15 +993,15 @@ begin
fOndebugEvent(Self, 'MakeShortCut', Format('Category=%s', fOndebugEvent(Self, 'MakeShortCut', Format('Category=%s',
[fShortCutClass.CategoryString])); [fShortCutClass.CategoryString]));
{$ENDIF} {$ENDIF}
Result := CreateDesktopShortCut(fShortCutClass.Target, Result := CreateDesktopShortCut(fShortCutClass.Target,
fShortCutClass.TargetArguments, fShortCutClass.ShortcutName, fShortCutClass.TargetArguments, fShortCutClass.ShortcutName,
fShortCutClass.IconFileName, fShortCutClass.CategoryString); fShortCutClass.IconFileName, fShortCutClass.CategoryString);
fLastError:=GetShortCutDebugString;
if fFireDebugEvent then if fFireDebugEvent then
if Result = True then if Result = True then
fOndebugEvent(Self, 'MakeShortCut', 'MakeShortCut succeded.') fOndebugEvent(Self, 'MakeShortCut', 'MakeShortCut succeded.')
else else
fOndebugEvent(Self, 'MakeShortCut', 'MakeShortCut failed. Error: ' + GetShortCutErrorString); fOndebugEvent(Self, 'MakeShortCut', 'MakeShortCut failed. Error(s): ' + GetShortCutDebugString);
end; end;
function TLazAutoUpdate.DeleteShortCut: boolean; function TLazAutoUpdate.DeleteShortCut: boolean;
@ -1025,7 +1025,7 @@ begin
if Result = True then if Result = True then
fOndebugEvent(Self, 'MakeShortCut', 'DeleteShortCut succeded.') fOndebugEvent(Self, 'MakeShortCut', 'DeleteShortCut succeded.')
else else
fOndebugEvent(Self, 'MakeShortCut', 'DeleteShortCut failed. Error: ' + GetShortCutErrorString); fOndebugEvent(Self, 'MakeShortCut', 'DeleteShortCut failed. Error: ' + GetShortCutDebugString);
end; end;

View File

@ -36,7 +36,7 @@ Code adapted from fpcup (@BigChimp and @DonAlfredo at freepascal forum)
Use Use
=== ===
Use public function 'GetShortCutErrorString' to show an error when debugging Use public function 'GetShortCutErrorString' to show errors/info when debugging
Linux Shortcut Info Linux Shortcut Info
=================== ===================
@ -85,28 +85,34 @@ interface
uses uses
Classes, SysUtils, LazUTF8, FileUtil, LazFileUtils Classes, SysUtils, LazUTF8, FileUtil, LazFileUtils
{$IFDEF LINUX}, process{$ENDIF} {$IFDEF LINUX},process,strutils{$ENDIF}
{$IFDEF WINDOWS}, Windows, shlobj {for special folders}, ActiveX, {$IFDEF WINDOWS}, Windows, shlobj {for special folders}, ActiveX,
ComObj, ShellAPI{$ENDIF} ; ComObj, ShellAPI{$ENDIF} ;
function CreateDesktopShortCut(Target, TargetArguments, ShortcutName, function CreateDesktopShortCut(Target, TargetArguments, ShortcutName,
IconFileName, Category: string): boolean; IconFileName, Category: string): boolean;
function DeleteDesktopShortcut(ShortcutName: string): boolean; function DeleteDesktopShortcut(ShortcutName: string): boolean;
function GetShortCutDebugString: string;
function GetShortCutErrorString: string;
implementation implementation
var var
sErrorString: string; sDebugString: string;
// Functions and procs to aid Debugging
function GetShortCutErrorString: string; function GetShortCutDebugString: string;
begin begin
if (sErrorString = '') then if (sDebugString = '') then
Result := 'OK' Result := 'OK'
else else
Result := sErrorString; Result := sDebugString;
end;
// Builds up a string with linebreaks
procedure AddToDebugString(Astring:String);
begin
if (sDebugString = '') then
sDebugString:=LineEnding + '* ' + Astring
else
sDebugString:=sDebugString + LineEnding + '* ' + Astring;
end; end;
{$IFDEF UNIX} {$IFDEF UNIX}
@ -138,7 +144,7 @@ IN:
OUT: OUT:
True = Success True = Success
False = Fail False = Fail
Use function GetShortCutErrorString to get most recent error as a string Use function GetShortCutDebugString to get most recent error as a string
} }
var var
IObject: IUnknown; IObject: IUnknown;
@ -149,19 +155,21 @@ var
LinkName: WideString; LinkName: WideString;
begin begin
Result := True; Result := True;
sErrorString := 'OK'; sDebugString := '';
// Simple failure check // Simple failure check
if not FileExistsUTF8(Target) then if not FileExistsUTF8(Target) then
Result := False; begin
if Result = False then AddToDebugString('Filename ' + Target + ' does not exist');
Exit; Result := False;
Exit;
end;
try try
{ Creates an instance of IShellLink } { Creates an instance of IShellLink }
IObject := CreateComObject(CLSID_ShellLink); IObject := CreateComObject(CLSID_ShellLink);
ISLink := IObject as IShellLink; ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile; IPFile := IObject as IPersistFile;
TRY
ISLink.SetPath(PChar(Target)); ISLink.SetPath(PChar(Target));
ISLink.SetArguments(PChar(TargetArguments)); ISLink.SetArguments(PChar(TargetArguments));
ISLink.SetWorkingDirectory(PChar(ExtractFilePath(Target))); ISLink.SetWorkingDirectory(PChar(ExtractFilePath(Target)));
@ -172,10 +180,13 @@ begin
LinkName := IncludeTrailingPathDelimiter(InFolder) + ShortcutName + '.lnk'; LinkName := IncludeTrailingPathDelimiter(InFolder) + ShortcutName + '.lnk';
{ Get rid of any existing shortcut first } { Get rid of any existing shortcut first }
SysUtils.DeleteFile(LinkName); If Not SysUtils.DeleteFile(LinkName) then
AddToDebugString('Could not delete existing link ' + LinkName);
{ Create the link } { Create the link }
IPFile.Save(PWChar(LinkName), False); IPFile.Save(PWChar(LinkName), False);
finally
FreeAndNil(IPFile);
end;
except except
Result := False; Result := False;
end; end;
@ -195,113 +206,133 @@ IN:
OUT: OUT:
True = Success True = Success
False = Fail False = Fail
Use function GetShortCutErrorString to get most recent error as a string Use function GetShortCutDebugString to get errors as a string
} }
var var
XdgDesktopContent: TStringList; XdgDesktopStringList: TStrings;
XdgDesktopFile: string; XdgDesktopFile: string;
Aprocess: TProcess; Aprocess: TProcess;
sPathToShare: string; sPathToShare: string;
sDesktopFilename:String;
begin begin
// Suceed by default: // Suceed by default:
Result := True; Result := True;
sErrorString := 'OK'; sDebugString := '';
// Simple failure checks // Simple failure checks
if not FileExistsUTF8(Target) then if not FileExistsUTF8(Target) then
begin begin
sErrorString := 'File "' + Target + '" cannot be located.'; AddToDebugString('File "' + Target + '" cannot be located. Quitting.');
Result := False; Result := False;
Exit; Exit;
end; end;
if not FileExistsUTF8(IconFileName) then if not FileExistsUTF8(IconFileName) then
begin begin
sErrorString := 'File "' + IconFileName + '" cannot be located.'; AddToDebugString('File "' + IconFileName + '" cannot be located. Using Target.');
IconFileName := Target; IconFileName := Target;
end; end;
if ShortCutName = '' then if ShortCutName = '' then
begin begin
sErrorString := 'ShortcutName is blank.'; AddToDebugString('ShortcutName is blank. Quitting.');
Result := False; Result := False;
Exit; Exit;
end; end;
if Category = '' then if Category = '' then
begin begin
sErrorString := 'Category is blank. Using "Utility"'; AddToDebugString('Category is blank. Using "Utility"');
Category := 'Utility'; Category := 'Utility';
end; end;
// Make up a compliant filename
sDesktopFilename:=Copy2Space(shortcutname);
sDesktopFilename:=LeftStr(sDesktopFilename,8);
AddToDebugString('Desktop filename = ' + sDesktopFilename);
// Standard path to DeskTop files
sPathToShare := IncludeTrailingPathDelimiter(ExpandFileNameUTF8('~')) + sPathToShare := IncludeTrailingPathDelimiter(ExpandFileNameUTF8('~')) +
'usr/share/applications' + DirectorySeparator + 'test.desktop'; 'usr/share/applications' + DirectorySeparator +
{ sDesktopFilename + '.desktop';
// Temp directory path
XdgDesktopFile := IncludeTrailingPathDelimiter(GetTempDir(False)) + XdgDesktopFile := IncludeTrailingPathDelimiter(GetTempDir(False)) +
shortcutname + '.desktop'; sDesktopFilename + '.desktop';
}
// ExtractFileNameOnly(GetTempDir(False)); AddToDebugString('XdgDesktopFile = ' + XdgDesktopFile);
XdgDesktopFile := IncludeTrailingPathDelimiter(GetTempDir(False)) + AddToDebugString('sPathToShare = ' + sPathToShare);
'test.desktop';
XdgDesktopContent := TStringList.Create; // Make up the desktop file
XdgDesktopStringList := TStringList.Create;
try try
XdgDesktopContent.Add('[Desktop Entry]'); XdgDesktopStringList.Add('[Desktop Entry]');
XdgDesktopContent.Add('Encoding=UTF-8'); XdgDesktopStringList.Add('Encoding=UTF-8');
XdgDesktopContent.Add('Type=Application'); XdgDesktopStringList.Add('Type=Application');
//XdgDesktopContent.Add('Nodisplay=True'); //XdgDesktopStringList.Add('NoDisplay=True');
XdgDesktopContent.Add('Icon=' + IconFileName); XdgDesktopStringList.Add('Icon=' + IconFileName);
if TargetArguments <> '' then if TargetArguments <> '' then
XdgDesktopContent.Add('Exec=' + Target + ' ' + TargetArguments) XdgDesktopStringList.Add('Exec=' + Target + ' ' + TargetArguments)
else else
XdgDesktopContent.Add('Exec=' + Target); XdgDesktopStringList.Add('Exec=' + Target);
XdgDesktopContent.Add('Name=' + ShortcutName); XdgDesktopStringList.Add('Name=' + ShortcutName);
XdgDesktopContent.Add('Category=' + Category); XdgDesktopStringList.Add('Category=' + Category);
// We're going to try and call xdg-desktop-icon // We're going to try and call xdg-desktop-icon
// this may fail if shortcut exists already // this may fail if shortcut exists already
AProcess := TProcess.Create(nil); AProcess := TProcess.Create(nil);
try try
try try
if FileExistsUTF8(XdgDesktopFile) then DeleteFile(XdgDesktopFile); if FileExistsUTF8(XdgDesktopFile) then DeleteFile(XdgDesktopFile);
XdgDesktopContent.SaveToFile(XdgDesktopFile); Sleep(100);
XdgDesktopStringList.SaveToFile(XdgDesktopFile);
if Not FileExistsUTF8(XdgDesktopFile) then
AddToDebugString('XdgDesktopFile wasn''t saved');
if FileExistsUTF8(XdgDesktopFile) then if FileExistsUTF8(XdgDesktopFile) then
begin begin
Sleep(100);
Aprocess.Executable := 'xdg-desktop-icon install'; Aprocess.Executable := 'xdg-desktop-icon install';
AProcess.CurrentDirectory := ProgramDirectory; AProcess.CurrentDirectory := ProgramDirectory;
AProcess.Parameters.Clear; AProcess.Parameters.Clear;
AProcess.Parameters.Add(XdgDesktopFile); AProcess.Parameters.Add(XdgDesktopFile);
Aprocess.Execute; Aprocess.Execute;
Sleep(100); Sleep(100);
end end;
else
if FileExistsUTF8(sPathToShare) then DeleteFile(sPathToShare);
XdgDesktopContent.SaveToFile(sPathToShare);
If Not FileExistsUTF8(sPathToShare) then
begin
Result:=FALSE;
sErrorString := 'SaveToFile(' + sPathToShare + ') failed';
end;
except except
// xdg-desktop-icon install failed.
Result := False; Result := False;
sErrorString := 'Exception running "xdg-desktop-icon install"'; AddToDebugString('Exception running "xdg-desktop-icon install"');
// OK. Try usr/share/applications
if FileExistsUTF8(sPathToShare) then
begin
If SysUtils.DeleteFile(sPathToShare) then
AddToDebugString('Successfully deleted existing ' + sPathToShare)
else
AddToDebugString('Unable to delete existing ' + sPathToShare);
end;
// Save the stringlist directly to usr/share/applications
XdgDesktopStringList.SaveToFile(sPathToShare);
If Not FileExistsUTF8(sPathToShare) then
begin
Result:=FALSE;
AddToDebugString('SaveToFile(' + sPathToShare + ') failed');
end;
end; end;
finally finally
AProcess.Free; AProcess.Free;
end; end;
if Result = False then if Result = False then
// Temp file is no longer needed....
try try
If FileExistsUTF8(XdgDesktopFile) then If (FileExistsUTF8(XdgDesktopFile)) AND (NOT FileExistsUTF8(sPathToShare)) then
BEGIN BEGIN
// Last try to copy file to usr/share/applications
if CopyFile(XdgDesktopFile, sPathToShare) then if CopyFile(XdgDesktopFile, sPathToShare) then
Result := True Result := True
else else
sErrorString := Format('Unable to copy %s file to %s', [XdgDesktopFile, sPathToShare]); AddToDebugString(Format('Unable to copy %s file to %s', [XdgDesktopFile, sPathToShare]));
if not DeleteFile(XdgDesktopFile) then // Temp file is no longer needed....
sErrorString := 'Unable to delete temporary ' + XdgDesktopFile; if not SysUtils.DeleteFile(XdgDesktopFile) then
AddToDebugString('Unable to delete temporary ' + XdgDesktopFile);
end end
else sErrorString := 'Unable to locate temporary ' + XdgDesktopFile; else AddToDebugString('Unable to locate temporary ' + XdgDesktopFile);
finally finally
// Swallow, let filesystem maintenance clear it up // Swallow, let filesystem maintenance clear it up
end; end;
finally finally
XdgDesktopContent.Free; XdgDesktopStringList.Free;
end; end;
end; end;
@ -314,7 +345,7 @@ var
LinkName: WideString; LinkName: WideString;
begin begin
Result := False; Result := False;
sErrorString := 'OK'; sDebugString := '';
try try
{ Get the desktop location } { Get the desktop location }
SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL); SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL);
@ -323,7 +354,7 @@ begin
if SysUtils.DeleteFile(LinkName) then if SysUtils.DeleteFile(LinkName) then
Result := True; Result := True;
except except
sErrorString := 'Exception deleting ' + LinkName; AddToDebugString('Exception deleting ' + LinkName);
// Eat the exception // Eat the exception
end; end;
end; end;
@ -331,7 +362,7 @@ end;
{$ELSE} {$ELSE}
function DeleteDesktopShortcut(ShortcutName: string): boolean; function DeleteDesktopShortcut(ShortcutName: string): boolean;
begin begin
sErrorString := 'OK'; sDebugString := 'DeleteDesktopShortcut not implemented in Linux';
Result := False; Result := False;
end; end;