OSDN Git Service

【更新内容】
[ring-lang-081/ring.git] / docs / en / source / distribute.txt
1 .. index:: 
2         single: Distributing Ring Application; Introduction
3
4 ==============================
5 Distributing Ring Applications
6 ==============================
7
8 In this chapter we will learn about distributing Ring applications.
9
10 The next method is old and was used in Ring 1.5 and previous versions!
11
12 Starting from Ring 1.6 we have a nice tool called Ring2EXE
13
14 Using Ring2EXE we can distribute applications quickly for Windows, Linux and macOS 
15
16 Check the Ring2EXE chapter for more information!
17
18
19 .. index:: 
20         pair: Distributing Ring Application; Distributing Applications for Microsoft Windows
21
22 Distributing Applications for Microsoft Windows
23 ===============================================
24
25 Step 1:
26
27 .. code-block:: none
28
29         Copy c:\ring\bin folder to be for example c:\myapp
30
31 Step 2:
32
33 .. code-block:: none
34
35         Rename c:\myapp\ring.exe to c:\myapp\myapp.exe
36
37 Step 3:
38
39 .. code-block:: none
40
41         Create a file c:\myapp\ring.ring 
42
43 And write
44
45 .. code-block:: ring
46
47         Load "myapp.ring"
48
49 When you run myapp.exe the file ring.ring will be executed automatically
50
51 So your file myapp.ring will be called and executed
52
53 Or just rename myapp.ring to ring.ring
54
55 It's a fast way to distribute applications.
56
57 .. index:: 
58         pair: Distributing Ring Application; Protecting the Source Code
59
60 Protecting the Source Code
61 ==========================
62
63 Step 1:
64
65 Execute the next command 
66
67 .. code-block:: none
68
69         ring myapp.ring -go
70
71 This will generate one object file (myapp.ringo) from the project files (*.ring)
72
73 Step 2:
74
75 .. code-block:: none
76
77         Rename myapp.ringo to ring.ringo
78
79 When you run the executable file (ring.exe) or (myapp.exe) the file ring.ringo will be executed.
80
81 .. index:: 
82         pair: Distributing Ring Application; The files ring.ring and ring.ringo
83
84 The files ring.ring and ring.ringo
85 ==================================
86
87 Ring will run ring.ring or ring.ringo only when
88
89 (1) The file exist in the current directory
90 (2) No file is passed to (ring.exe) to execute
91
92 We added the support to ring.ring (and ring.ringo) for a way to distribute Ring apps (before Ring2EXE)
93
94 .. index:: 
95         pair: Distributing Ring Application; Creating Windows Installer
96
97 Creating Windows Installer
98 ==========================
99
100 There are many tools that you can use to distribute your application.
101
102 Check : nullsoft scriptable install system
103
104 URL : http://nsis.sourceforge.net/Main_Page
105
106 .. index:: 
107         pair: Distributing Ring Application; Using C/C++ Compiler and Linker
108
109 Using C/C++ Compiler and Linker
110 ===============================
111
112 Another method to distribute applications is to use a C/C++ compiler.
113
114 Ring can be embedded in C/C++ projects, We can create executable files using a C/C++ compiler
115 by embedding the Ring language in our project.
116
117 Check the "Embedding Ring Language in C/C++ Programs" chapter.
118
119 Using this way we will avoid using ring.ring or ring.ringo files.
120
121 .. index:: 
122         pair: Distributing Ring Application; Distributing Applications and Games for Mobile
123
124 Distributing Applications and Games for Mobile
125 ==============================================
126
127 Ring can be embedded in a Qt projects or LibSDL projects to build Mobile applications and Games.
128
129 You can build the Qt project or the LibSDL project and get the Android package directly (*.apk)
130
131 Check Ring distributions for Mobile development using Qt or LibSDL.