Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
delphilite committed Oct 18, 2019
1 parent 4d4fa7d commit 91a7fd0
Show file tree
Hide file tree
Showing 22 changed files with 7,119 additions and 1 deletion.
Binary file added Bin/Wke.dll
Binary file not shown.
Empty file added Dcu/.gitignore
Empty file.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# AriaNgWke
A smaller aria2 desktop frontend than AriaNg-Native, based on miniblink and delphi.
[![License](https://img.shields.io/github/license/delphilite/AriaNgWke.svg?style=flat)](https://github.com/delphilite/AriaNgWke/blob/master/LICENSE)
[![Lastest Release](https://img.shields.io/github/release/delphilite/AriaNgWke.svg?style=flat)](https://github.com/delphilite/AriaNgWke/releases)

## Introduction
AriaNgWke is a smaller aria2 desktop frontend built by [miniblink](https://github.com/weolar/miniblink49) and [Wke4Delphi](https://gitee.com/LangjiApp/Wke4Delphi), containing full feature of [AriaNg](https://github.com/mayswind/AriaNg). You can run AriaNgWke on Windows without any browser. In addition, AriaNgWke also has many features that [AriaNg](https://github.com/mayswind/AriaNg) cannot implement.

#### Extra features
1. More user-friendly interface
2. Local file system operating support

## Introduction of AriaNg
Please visit [https://github.com/mayswind/AriaNg](https://github.com/mayswind/AriaNg) for more information.

## Screenshots
#### Windows
![AriaNg Native](https://raw.githubusercontent.com/mayswind/AriaNg-WebSite/master/screenshots/ariang_native_windows.png)

## Installation
#### Prebuilt release
Latest Release: [https://github.com/delphilite/AriaNgWke/releases](https://github.com/delphilite/AriaNgWke/releases)

#### Building from source
Make sure you have [Delphi XE2+](https://www.embarcadero.com/products/delphi) installed. Then download the source code, and open AriaNg.dproj file and build all, the builds will be placed in the bin directory.

## License
[MIT](https://github.com/delphilite/AriaNgWke/blob/master/LICENSE)
16 changes: 16 additions & 0 deletions Resource/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set PATH=%PATH%;"C:\Program Files\CodeGear\RAD Studio\5.0\bin";"C:\Program Files (x86)\CodeGear\RAD Studio\5.0\bin"
set PATH=%PATH%;"C:\Program Files\Embarcadero\RAD Studio\9.0\bin";"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin"

del Aria2ControlFrm.res
del Aria2ControlFrm.rc

echo INDEX RCDATA index.html > Aria2ControlFrm.rc

brcc32 -l0409 Aria2ControlFrm.rc
ren Aria2ControlFrm.res Aria2ControlFrm.res

del Aria2ControlFrm.rc

copy /y Aria2ControlFrm.res ..\Source\Aria2ControlFrm.res

pause
559 changes: 559 additions & 0 deletions Resource/index.html

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions Source/Aria2ControlFrm.dfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
object Aria2ControlForm: TAria2ControlForm
Left = 0
Top = 0
Caption = 'AriaNg'
ClientHeight = 561
ClientWidth = 974
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
end
108 changes: 108 additions & 0 deletions Source/Aria2ControlFrm.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{ *********************************************************************** }
{ }
{ AriaNg WKE 自动化浏览器项目单元 }
{ }
{ 设计:Lsuper 2017.09.11 }
{ 备注: }
{ 审核: }
{ }
{ Copyright (c) 1998-2019 Super Studio }
{ }
{ *********************************************************************** }

unit Aria2ControlFrm;

interface

uses
System.SysUtils, Vcl.Forms, Langji.Wke.Webbrowser;

type
TAria2ControlForm = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
FWebBrowser: TWkeWebBrowser;
private
procedure ExtractWebIndexFile(const AFile: string);
private
procedure WkeWebBrowser1TitleChange(Sender: TObject; sTitle: string);
end;

var
Aria2ControlForm: TAria2ControlForm;

implementation

{$R *.dfm}
{$R *.res} { index.html }

uses
System.Classes, System.Types, Vcl.Controls, Langji.Wke.Lib;

{ TAria2ControlForm }

procedure TAria2ControlForm.ExtractWebIndexFile(const AFile: string);
var
F: string;
S: TResourceStream;
begin
F := ExtractFileDir(AFile);
if not DirectoryExists(F) then
ForceDirectories(F);
if not DirectoryExists(F) then
Exit;
S := TResourceStream.Create(HInstance, 'INDEX', RT_RCDATA);
with TFileStream.Create(AFile, fmCreate) do
try
CopyFrom(S, S.Size);
finally
Free;
S.Free;
end;
end;

procedure TAria2ControlForm.FormCreate(Sender: TObject);
const
defLocalStoragePathFmt = '%s\LocalStorage';
var
S: string;
begin
S := GetModuleName(0);
S := ExtractFileDir(S);

wkeLibFileName := Format('%s\WKE.dll', [S]);

FWebBrowser := TWkeWebBrowser.Create(Self);
FWebBrowser.Parent := Self;
FWebBrowser.Align := alClient;

S := Format(defLocalStoragePathFmt, [S]);
if not DirectoryExists(S) then
ForceDirectories(S);
FWebBrowser.CookiePath := S;
FWebBrowser.CookieEnabled := True;
FWebBrowser.LocalStoragePath := S;

FWebBrowser.OnTitleChange := WkeWebBrowser1TitleChange;
end;

procedure TAria2ControlForm.FormShow(Sender: TObject);
var
F: string;
begin
F := GetModuleName(0);
F := ExtractFilePath(F);
F := F + 'App\index.html';
if not FileExists(F) then
ExtractWebIndexFile(F);
if FileExists(F) then
FWebBrowser.LoadFile(F);
end;

procedure TAria2ControlForm.WkeWebBrowser1TitleChange(Sender: TObject; sTitle: string);
begin
Caption := sTitle;
end;

end.
Binary file added Source/Aria2ControlFrm.res
Binary file not shown.
39 changes: 39 additions & 0 deletions Source/AriaNg.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ *********************************************************************** }
{ }
{ AriaNg WKE 自动化浏览器项目单元 }
{ }
{ 设计:Lsuper 2017.09.11 }
{ 备注: }
{ 审核: }
{ }
{ Copyright (c) 1998-2019 Super Studio }
{ }
{ *********************************************************************** }

program AriaNg;

{$IF CompilerVersion >= 21.0}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}
{$IFEND}

uses
{
FastMM4,
}
System.SysUtils,
Winapi.Windows,
Vcl.Forms,

Aria2ControlFrm in 'Aria2ControlFrm.pas' {Aria2ControlForm};

{$R *.res}

{$SETPEFLAGS IMAGE_FILE_LARGE_ADDRESS_AWARE or IMAGE_FILE_RELOCS_STRIPPED}

begin
Application.Title := 'AriaNg';
Application.Initialize;
Application.CreateForm(TAria2ControlForm, Aria2ControlForm);
Application.Run;
end.
147 changes: 147 additions & 0 deletions Source/AriaNg.dproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{3B0F01FA-3D73-4AEE-A41B-5B6743B09B83}</ProjectGuid>
<MainSource>AriaNg.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>13.4</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_MajorVer>2</VerInfo_MajorVer>
<Icon_MainIcon>AriaNg.ico</Icon_MainIcon>
<DCC_ImageBase>00400000</DCC_ImageBase>
<VerInfo_Keys>CompanyName=Super Studio;FileDescription=AriaNg;FileVersion=2.0.0.0;InternalName=AriaNg;LegalCopyright=;LegalTrademarks=;OriginalFilename=AriaNg;ProductName=AriaNg;ProductVersion=2.0.0.0;Comments=AriaNg, a modern web frontend making aria2 easier to use.</VerInfo_Keys>
<Manifest_File>AriaNg.manifest</Manifest_File>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace>
<DCC_UnitSearchPath>..\Wke4Delphi;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_ExeOutput>..\Bin</DCC_ExeOutput>
<VerInfo_Locale>2052</VerInfo_Locale>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_DcuOutput>..\Dcu</DCC_DcuOutput>
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_DebugInformation>false</DCC_DebugInformation>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;DEBUGMESSAGE;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Aria2ControlFrm.pas">
<Form>Aria2ControlForm</Form>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">AriaNg.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">2052</VersionInfo>
<VersionInfo Name="CodePage">936</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
</Delphi.Personality>
<Platforms>
<Platform value="Win64">False</Platform>
<Platform value="Win32">True</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
</Project>
Binary file added Source/AriaNg.ico
Binary file not shown.
Loading

0 comments on commit 91a7fd0

Please sign in to comment.