You've already forked lazarus-ccr
DeleteShortCut public function added
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5714 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3,14 +3,14 @@
|
|||||||
<ProjectSession>
|
<ProjectSession>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<Version Value="10"/>
|
<Version Value="10"/>
|
||||||
<BuildModes Active="Linux32"/>
|
<BuildModes Active="Win64"/>
|
||||||
<Units Count="28">
|
<Units Count="28">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="testapp.lpr"/>
|
<Filename Value="testapp.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="6"/>
|
<EditorIndex Value="6"/>
|
||||||
<CursorPos X="25" Y="28"/>
|
<CursorPos X="25" Y="28"/>
|
||||||
<UsageCount Value="64"/>
|
<UsageCount Value="65"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
@ -19,9 +19,9 @@
|
|||||||
<ComponentName Value="mainform"/>
|
<ComponentName Value="mainform"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<TopLine Value="8"/>
|
<TopLine Value="157"/>
|
||||||
<CursorPos X="16" Y="15"/>
|
<CursorPos X="4" Y="176"/>
|
||||||
<UsageCount Value="64"/>
|
<UsageCount Value="65"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
<LoadedDesigner Value="True"/>
|
<LoadedDesigner Value="True"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<WindowIndex Value="1"/>
|
<WindowIndex Value="1"/>
|
||||||
<TopLine Value="31"/>
|
<TopLine Value="31"/>
|
||||||
<CursorPos X="48" Y="14"/>
|
<CursorPos X="48" Y="14"/>
|
||||||
<UsageCount Value="47"/>
|
<UsageCount Value="48"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\lazautoupdate_httpclient.pas"/>
|
<Filename Value="..\lazautoupdate_httpclient.pas"/>
|
||||||
@ -43,15 +43,15 @@
|
|||||||
<Unit4>
|
<Unit4>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<WindowIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<TopLine Value="1707"/>
|
<TopLine Value="317"/>
|
||||||
<CursorPos X="73" Y="1722"/>
|
<CursorPos X="41" Y="357"/>
|
||||||
<ExtraEditorCount Value="2"/>
|
<ExtraEditorCount Value="2"/>
|
||||||
<ExtraEditor1>
|
<ExtraEditor1>
|
||||||
<IsVisibleTab Value="True"/>
|
<IsVisibleTab Value="True"/>
|
||||||
<EditorIndex Value="1"/>
|
<WindowIndex Value="1"/>
|
||||||
<TopLine Value="466"/>
|
<TopLine Value="1724"/>
|
||||||
<CursorPos X="37" Y="476"/>
|
<CursorPos X="45" Y="1733"/>
|
||||||
</ExtraEditor1>
|
</ExtraEditor1>
|
||||||
<ExtraEditor2>
|
<ExtraEditor2>
|
||||||
<EditorIndex Value="-1"/>
|
<EditorIndex Value="-1"/>
|
||||||
@ -187,8 +187,8 @@
|
|||||||
<Unit22>
|
<Unit22>
|
||||||
<Filename Value="..\ushortcut.pas"/>
|
<Filename Value="..\ushortcut.pas"/>
|
||||||
<EditorIndex Value="4"/>
|
<EditorIndex Value="4"/>
|
||||||
<TopLine Value="71"/>
|
<TopLine Value="178"/>
|
||||||
<CursorPos X="34" Y="106"/>
|
<CursorPos X="44" Y="213"/>
|
||||||
<UsageCount Value="22"/>
|
<UsageCount Value="22"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit22>
|
</Unit22>
|
||||||
@ -234,129 +234,126 @@
|
|||||||
<OtherDefines Count="1">
|
<OtherDefines Count="1">
|
||||||
<Define0 Value="DEBUGMODE"/>
|
<Define0 Value="DEBUGMODE"/>
|
||||||
</OtherDefines>
|
</OtherDefines>
|
||||||
<General>
|
|
||||||
<ActiveWindowIndexAtStart Value="1"/>
|
|
||||||
</General>
|
|
||||||
<JumpHistory Count="30" HistoryIndex="29">
|
<JumpHistory Count="30" HistoryIndex="29">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="242" Column="24" TopLine="214"/>
|
<Caret Line="232" Column="36" TopLine="214"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="241" Column="34" TopLine="215"/>
|
<Caret Line="281" Column="45" TopLine="259"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
<Position3>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="232" Column="37" TopLine="214"/>
|
<Caret Line="243" TopLine="223"/>
|
||||||
</Position3>
|
</Position3>
|
||||||
<Position4>
|
<Position4>
|
||||||
<Filename Value="C:\laztrunk\fpc\rtl\objpas\classes\classesh.inc"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="426" Column="30" TopLine="399"/>
|
<Caret Line="241" Column="43" TopLine="214"/>
|
||||||
</Position4>
|
</Position4>
|
||||||
<Position5>
|
<Position5>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="232" Column="36" TopLine="214"/>
|
<Caret Line="251" Column="21" TopLine="223"/>
|
||||||
</Position5>
|
</Position5>
|
||||||
<Position6>
|
<Position6>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="281" Column="45" TopLine="259"/>
|
<Caret Line="679" Column="49" TopLine="658"/>
|
||||||
</Position6>
|
</Position6>
|
||||||
<Position7>
|
<Position7>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="243" TopLine="223"/>
|
<Caret Line="701" Column="38" TopLine="687"/>
|
||||||
</Position7>
|
</Position7>
|
||||||
<Position8>
|
<Position8>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="241" Column="43" TopLine="214"/>
|
<Caret Line="457" Column="37" TopLine="444"/>
|
||||||
</Position8>
|
</Position8>
|
||||||
<Position9>
|
<Position9>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="251" Column="21" TopLine="223"/>
|
<Caret Line="466" Column="23" TopLine="452"/>
|
||||||
</Position9>
|
</Position9>
|
||||||
<Position10>
|
<Position10>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="679" Column="49" TopLine="658"/>
|
<Caret Line="470" Column="40" TopLine="460"/>
|
||||||
</Position10>
|
</Position10>
|
||||||
<Position11>
|
<Position11>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="701" Column="38" TopLine="687"/>
|
<Caret Line="583" Column="36" TopLine="552"/>
|
||||||
</Position11>
|
</Position11>
|
||||||
<Position12>
|
<Position12>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="457" Column="37" TopLine="444"/>
|
<Caret Line="553" TopLine="529"/>
|
||||||
</Position12>
|
</Position12>
|
||||||
<Position13>
|
<Position13>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="466" Column="23" TopLine="452"/>
|
<Caret Line="545" Column="6" TopLine="523"/>
|
||||||
</Position13>
|
</Position13>
|
||||||
<Position14>
|
<Position14>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="470" Column="40" TopLine="460"/>
|
<Caret Line="61" Column="74" TopLine="50"/>
|
||||||
</Position14>
|
</Position14>
|
||||||
<Position15>
|
<Position15>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="583" Column="36" TopLine="552"/>
|
<Caret Line="570" Column="28" TopLine="542"/>
|
||||||
</Position15>
|
</Position15>
|
||||||
<Position16>
|
<Position16>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="553" TopLine="529"/>
|
<Caret Line="621" Column="46" TopLine="582"/>
|
||||||
</Position16>
|
</Position16>
|
||||||
<Position17>
|
<Position17>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="545" Column="6" TopLine="523"/>
|
<Caret Line="629" Column="65" TopLine="593"/>
|
||||||
</Position17>
|
</Position17>
|
||||||
<Position18>
|
<Position18>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="61" Column="74" TopLine="50"/>
|
<Caret Line="637" Column="51" TopLine="615"/>
|
||||||
</Position18>
|
</Position18>
|
||||||
<Position19>
|
<Position19>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="570" Column="28" TopLine="542"/>
|
<Caret Line="639" Column="8" TopLine="615"/>
|
||||||
</Position19>
|
</Position19>
|
||||||
<Position20>
|
<Position20>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="621" Column="46" TopLine="582"/>
|
<Caret Line="637" Column="50" TopLine="616"/>
|
||||||
</Position20>
|
</Position20>
|
||||||
<Position21>
|
<Position21>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="629" Column="65" TopLine="593"/>
|
<Caret Line="971" Column="61" TopLine="944"/>
|
||||||
</Position21>
|
</Position21>
|
||||||
<Position22>
|
<Position22>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="637" Column="51" TopLine="615"/>
|
<Caret Line="480" Column="20" TopLine="448"/>
|
||||||
</Position22>
|
</Position22>
|
||||||
<Position23>
|
<Position23>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="639" Column="8" TopLine="615"/>
|
<Caret Line="785" TopLine="758"/>
|
||||||
</Position23>
|
</Position23>
|
||||||
<Position24>
|
<Position24>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="637" Column="50" TopLine="616"/>
|
<Caret Line="784" Column="41" TopLine="757"/>
|
||||||
</Position24>
|
</Position24>
|
||||||
<Position25>
|
<Position25>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="971" Column="61" TopLine="944"/>
|
<Caret Line="474" TopLine="456"/>
|
||||||
</Position25>
|
</Position25>
|
||||||
<Position26>
|
<Position26>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="480" Column="20" TopLine="448"/>
|
<Caret Line="966" Column="70" TopLine="931"/>
|
||||||
</Position26>
|
</Position26>
|
||||||
<Position27>
|
<Position27>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="umainform.pas"/>
|
||||||
<Caret Line="785" TopLine="758"/>
|
<Caret Line="15" Column="16" TopLine="8"/>
|
||||||
</Position27>
|
</Position27>
|
||||||
<Position28>
|
<Position28>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="umainform.pas"/>
|
||||||
<Caret Line="784" Column="41" TopLine="757"/>
|
<Caret Line="152" Column="37" TopLine="146"/>
|
||||||
</Position28>
|
</Position28>
|
||||||
<Position29>
|
<Position29>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="umainform.pas"/>
|
||||||
<Caret Line="474" TopLine="456"/>
|
<Caret Line="154" Column="37" TopLine="148"/>
|
||||||
</Position29>
|
</Position29>
|
||||||
<Position30>
|
<Position30>
|
||||||
<Filename Value="..\ulazautoupdate.pas"/>
|
<Filename Value="..\ulazautoupdate.pas"/>
|
||||||
<Caret Line="966" Column="70" TopLine="931"/>
|
<Caret Line="1014" Column="57" TopLine="977"/>
|
||||||
</Position30>
|
</Position30>
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectSession>
|
</ProjectSession>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
object mainform: Tmainform
|
object mainform: Tmainform
|
||||||
Left = 509
|
Left = 518
|
||||||
Height = 209
|
Height = 209
|
||||||
Top = 326
|
Top = 285
|
||||||
Width = 335
|
Width = 335
|
||||||
BorderIcons = [biSystemMenu]
|
BorderIcons = [biSystemMenu]
|
||||||
Caption = 'mainform'
|
Caption = 'mainform'
|
||||||
@ -93,6 +93,15 @@ object mainform: Tmainform
|
|||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
|
object cmd_MakeDesktopShortcut: TButton
|
||||||
|
Left = 184
|
||||||
|
Height = 25
|
||||||
|
Top = 112
|
||||||
|
Width = 139
|
||||||
|
Caption = 'Make Desktop Shortcut'
|
||||||
|
OnClick = cmd_MakeDesktopShortcutClick
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
object LazAutoUpdate1: TLazAutoUpdate
|
object LazAutoUpdate1: TLazAutoUpdate
|
||||||
About.Description.Strings = (
|
About.Description.Strings = (
|
||||||
'A component for updating your application'#13#10'Designed for projects hosted by SourceForge'#13#10#13#10'Main methods:'#13#10'Procedure AutoUpdate'#13#10'Function NewVersionAvailable: Boolean'#13#10'Function DownloadNewVersion: Boolean'#13#10'Function UpdateToNewVersion: Boolean'#13#10'Procedure ShowWhatsNewIfAvailable'#13#10'For troubleshooting, set DebugMode=TRUE'
|
'A component for updating your application'#13#10'Designed for projects hosted by SourceForge'#13#10#13#10'Main methods:'#13#10'Procedure AutoUpdate'#13#10'Function NewVersionAvailable: Boolean'#13#10'Function DownloadNewVersion: Boolean'#13#10'Function UpdateToNewVersion: Boolean'#13#10'Procedure ShowWhatsNewIfAvailable'#13#10'For troubleshooting, set DebugMode=TRUE'
|
||||||
@ -126,7 +135,7 @@ object mainform: Tmainform
|
|||||||
GitHubRepositoryName = 'TestApp'
|
GitHubRepositoryName = 'TestApp'
|
||||||
GitHubBranchOrTag = 'updates'
|
GitHubBranchOrTag = 'updates'
|
||||||
ShortCut.ShortcutName = 'AnotherName'
|
ShortCut.ShortcutName = 'AnotherName'
|
||||||
ShortCut.Category = scUtility
|
ShortCut.Category = scAudioVideo
|
||||||
Left = 200
|
Left = 200
|
||||||
Top = 24
|
Top = 24
|
||||||
end
|
end
|
||||||
|
@ -45,6 +45,7 @@ type
|
|||||||
{ Tmainform }
|
{ Tmainform }
|
||||||
|
|
||||||
Tmainform = class(TForm)
|
Tmainform = class(TForm)
|
||||||
|
cmd_MakeDesktopShortcut: TButton;
|
||||||
cmd_SilentUpdate: TButton;
|
cmd_SilentUpdate: TButton;
|
||||||
cmd_AutoUpdate: TButton;
|
cmd_AutoUpdate: TButton;
|
||||||
cmd_updateToNewVersion: TButton;
|
cmd_updateToNewVersion: TButton;
|
||||||
@ -56,6 +57,7 @@ type
|
|||||||
StatusBar1: TStatusBar;
|
StatusBar1: TStatusBar;
|
||||||
procedure cmd_AutoUpdateClick(Sender: TObject);
|
procedure cmd_AutoUpdateClick(Sender: TObject);
|
||||||
procedure cmd_DownloadNewVersionClick(Sender: TObject);
|
procedure cmd_DownloadNewVersionClick(Sender: TObject);
|
||||||
|
procedure cmd_MakeDesktopShortcutClick(Sender: TObject);
|
||||||
procedure cmd_NewVersionAvailableClick(Sender: TObject);
|
procedure cmd_NewVersionAvailableClick(Sender: TObject);
|
||||||
procedure cmd_SilentUpdateClick(Sender: TObject);
|
procedure cmd_SilentUpdateClick(Sender: TObject);
|
||||||
procedure cmd_updateToNewVersionClick(Sender: TObject);
|
procedure cmd_updateToNewVersionClick(Sender: TObject);
|
||||||
@ -163,6 +165,17 @@ begin
|
|||||||
LazAutoUpdate1.DownloadNewVersion;
|
LazAutoUpdate1.DownloadNewVersion;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure Tmainform.cmd_MakeDesktopShortcutClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
LazAutoUpdate1.ShortCut.ShortCutName:='Test Application';
|
||||||
|
LazAutoUpdate1.ShortCut.Target:=Application.EXEName;
|
||||||
|
LazAutoUpdate1.ShortCut.IconFilename:=ChangeFileExt(Application.EXEName,'.ico');
|
||||||
|
If LazAutoUpdate1.MakeShortCut then
|
||||||
|
ShowMessage('Success! New shortcut is now on your desktop')
|
||||||
|
else
|
||||||
|
ShowMessage('MakeShortCut failed');
|
||||||
|
end;
|
||||||
|
|
||||||
procedure Tmainform.cmd_AutoUpdateClick(Sender: TObject);
|
procedure Tmainform.cmd_AutoUpdateClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
{$IFDEF DEBUGMODE}
|
{$IFDEF DEBUGMODE}
|
||||||
|
@ -356,6 +356,7 @@ type
|
|||||||
procedure RelocateLauImportFile;
|
procedure RelocateLauImportFile;
|
||||||
// Uses properties in TShortCutClass
|
// Uses properties in TShortCutClass
|
||||||
function MakeShortCut: boolean;
|
function MakeShortCut: boolean;
|
||||||
|
function DeleteShortCut: boolean; // (use fShortCutClass.ShortCutName)
|
||||||
|
|
||||||
// Download lists (now superceded by CopyTree)
|
// Download lists (now superceded by CopyTree)
|
||||||
// TODO: Use Indexed properties to handle list access
|
// TODO: Use Indexed properties to handle list access
|
||||||
@ -966,7 +967,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
// A couple of public functions for installer apps
|
||||||
function TLazAutoUpdate.MakeShortCut: boolean;
|
function TLazAutoUpdate.MakeShortCut: boolean;
|
||||||
begin
|
begin
|
||||||
Result := False; // assume failure, look for success
|
Result := False; // assume failure, look for success
|
||||||
@ -996,6 +997,22 @@ begin
|
|||||||
fShortCutClass.TargetArguments, fShortCutClass.ShortcutName,
|
fShortCutClass.TargetArguments, fShortCutClass.ShortcutName,
|
||||||
fShortCutClass.IconFileName, fShortCutClass.CategoryString);
|
fShortCutClass.IconFileName, fShortCutClass.CategoryString);
|
||||||
end;
|
end;
|
||||||
|
function TLazAutoUpdate.DeleteShortCut: boolean;
|
||||||
|
begin
|
||||||
|
Result := False; // assume failure, look for success
|
||||||
|
if Assigned(fOndebugEvent) then
|
||||||
|
fFireDebugEvent := True;
|
||||||
|
|
||||||
|
if fFireDebugEvent then
|
||||||
|
fOndebugEvent(Self, 'DeleteShortCut', 'DeleteShortCut called');
|
||||||
|
If fShortCutClass.ShortcutName='' then
|
||||||
|
begin
|
||||||
|
if fFireDebugEvent then
|
||||||
|
fOndebugEvent(Self, 'DeleteShortCut', 'ShortCut.ShortCutName was empty!');
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
Result:=DeleteDesktopShortcut(fShortCutClass.ShortCutName);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TLazAutoUpdate.ShowWhatsNewIfAvailable;
|
procedure TLazAutoUpdate.ShowWhatsNewIfAvailable;
|
||||||
begin
|
begin
|
||||||
|
@ -83,6 +83,8 @@ uses
|
|||||||
function CreateDesktopShortCut(Target, TargetArguments, ShortcutName,
|
function CreateDesktopShortCut(Target, TargetArguments, ShortcutName,
|
||||||
IconFileName, Category: string): boolean;
|
IconFileName, Category: string): boolean;
|
||||||
|
|
||||||
|
function DeleteDesktopShortcut(ShortcutName: string):Boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$IFDEF UNIX}
|
{$IFDEF UNIX}
|
||||||
@ -208,18 +210,24 @@ end;
|
|||||||
|
|
||||||
{$ENDIF UNIX}
|
{$ENDIF UNIX}
|
||||||
{$IFDEF MSWINDOWS}
|
{$IFDEF MSWINDOWS}
|
||||||
procedure DeleteDesktopShortcut(ShortcutName: string);
|
Function DeleteDesktopShortcut(ShortcutName: string):Boolean;
|
||||||
var
|
var
|
||||||
PIDL: PItemIDList;
|
PIDL: PItemIDList;
|
||||||
InFolder: array[0..MAX_PATH] of char;
|
InFolder: array[0..MAX_PATH] of char;
|
||||||
LinkName: WideString;
|
LinkName: WideString;
|
||||||
begin
|
begin
|
||||||
|
Result:=FALSE;
|
||||||
{ Get the desktop location }
|
{ Get the desktop location }
|
||||||
SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL);
|
SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL);
|
||||||
SHGetPathFromIDList(PIDL, InFolder);
|
SHGetPathFromIDList(PIDL, InFolder);
|
||||||
LinkName := IncludeTrailingPathDelimiter(InFolder) + ShortcutName + '.lnk';
|
LinkName := IncludeTrailingPathDelimiter(InFolder) + ShortcutName + '.lnk';
|
||||||
SysUtils.DeleteFile(LinkName);
|
If SysUtils.DeleteFile(LinkName) then Result:=TRUE;
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
Function DeleteDesktopShortcut(ShortcutName: string):Boolean;
|
||||||
|
begin
|
||||||
|
Result:=FALSE;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ENDIF MSWINDOWS}
|
{$ENDIF MSWINDOWS}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Reference in New Issue
Block a user