Sign in Join
Wiki copytemporary

LAMW install windows fpcupdeluxe: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Install LAMW and Android Development Environment on Windows using [fpcupdeluxe](https://wiki.freepascal.org/fpcupdeluxe)
22
33See also
44
5-`Forum Post: `[`https://forum.lazarus.freepascal.org/index.php?topic=59226`](https://forum.lazarus.freepascal.org/index.php?topic=59226)\
6-`For Linux How-To see here: `[`https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe`](https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe)
5+```text
6+Forum Post: https://forum.lazarus.freepascal.org/index.php?topic=59226
7+For Linux How-To see here: https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe
8+```
79
8-[`https://wiki.freepascal.org/LAMW`](https://wiki.freepascal.org/LAMW)\
9-[`https://wiki.freepascal.org/fpcupdeluxe`](https://wiki.freepascal.org/fpcupdeluxe)
10+```text
11+https://wiki.freepascal.org/LAMW
12+https://wiki.freepascal.org/fpcupdeluxe
13+```
1014
11-`As of 2023-Feb-06, this error is still happening:`\
12-[`https://forum.lazarus.freepascal.org/index.php/topic,21919.msg441567.html#msg441567`](https://forum.lazarus.freepascal.org/index.php/topic,21919.msg441567.html#msg441567)
15+```text
16+As of 2023-Feb-06, this error is still happening:
17+https://forum.lazarus.freepascal.org/index.php/topic,21919.msg441567.html#msg441567
18+```
1319
1420Motivation
1521
16-`Needed simple instructions to get an up-to-date Android build environment setup on Windows.`\
17-`(installs and runs as a user, no admin privileges are needed)`\
18-`Thanks to other developers for sharing their hard work, utilities, and helpful information.`
22+```text
23+Needed simple instructions to get an up-to-date Android build environment setup on Windows.
24+(installs and runs as a user, no admin privileges are needed)
25+Thanks to other developers for sharing their hard work, utilities, and helpful information.
26+```
1927
2028Everything is self-contained under the "\$BASE\android" folder
2129
22-`($BASE defaults to the user's home folder)`\
23-`$BASE\android\sdk  (android sdk and build tools)`\
24-`$BASE\android\sdk\ndk-bundle  (android ndk)`\
25-`$BASE\android\fpcupdeluxe_app  (FPCUPdeluxe installer)`\
26-`$BASE\android\projects  (default LAMW projects folder)`\
27-`$BASE\android\fpc-lazarus  (FPC, Lazarus built w/ LAMW)`\
28-`$BASE\android\fpc-lazarus\ccr\lamw  (LAMW files)`\
29-`$BASE\android\fpc-lazarus\ccr\lamw-gradle  (gradle build tool)`\
30-`$BASE\android\fpc-lazarus\ccr\lamw\demos (LAMW demo projects)`
30+```text
31+($BASE defaults to the user's home folder)
32+$BASE\android\sdk (android sdk and build tools)
33+$BASE\android\sdk\ndk-bundle (android ndk)
34+$BASE\android\fpcupdeluxe_app (FPCUPdeluxe installer)
35+$BASE\android\projects (default LAMW projects folder)
36+$BASE\android\fpc-lazarus (FPC, Lazarus built w/ LAMW)
37+$BASE\android\fpc-lazarus\ccr\lamw (LAMW files)
38+$BASE\android\fpc-lazarus\ccr\lamw-gradle (gradle build tool)
39+$BASE\android\fpc-lazarus\ccr\lamw\demos (LAMW demo projects)
40+```
3141
3242Versions Tested
3343
34-`Windows 10 Pro 22H2 64-bit with latest updates installed`\
44+``` pascal
45+Windows 10 Pro 22H2 64-bit with latest updates installed
3546
36-`Android Command-Line Tools for Linux build 9477386`\
37-`OpenJDK 11.0.18 LTS (Microsoft's build)`\
38-`Android SDK/API Level 31 (Android 12)`\
39-`Android NDK revision 22`\
40-`Gradle 6.8.3 (installed automatically by FPCUPdeluxe)`\
47+Android Command-Line Tools for Linux build 9477386
48+OpenJDK 11.0.18 LTS (Microsoft's build)
49+Android SDK/API Level 31 (Android 12)
50+Android NDK revision 22
51+Gradle 6.8.3 (installed automatically by FPCUPdeluxe)
4152
42-`FPCUPdeluxe ver 2.2.0n`\
43-`FPC stable v3.2.2`\
44-`Lazarus stable v2.2.4`\
53+FPCUPdeluxe ver 2.2.0n
54+FPC stable v3.2.2
55+Lazarus stable v2.2.4
4556
46-`32-bit CPU Target: ARMv7a + VFPv3 (hardware floating point)`\
47-`64-bit CPU Target: Aarch64 (this always uses hardware floating point)`
57+32-bit CPU Target: ARMv7a + VFPv3 (hardware floating point)
58+64-bit CPU Target: Aarch64 (this always uses hardware floating point)
59+```
4860
4961## Main steps begin here
5062
51-``\
52-`Run these commands in a non-admin powershell console.  I recommend running these`\
53-`one at a time so you can verify the results before moving on to the next step.`
63+```text
5464
65+Run these commands in a non-admin powershell console. I recommend running these
66+one at a time so you can verify the results before moving on to the next step.
67+```
68+
5569``` powershell
5670# (powershell code)
5771# Setup Android Development Environment on Windows (FPCUPdeluxe / LAMW)
5872# Tested on Windows 10 Pro 22H2 64-bit
5973# Targets: 32-bit ARMv7a and 64-bit Aarch64
6074# 2023-Feb-05 ver 0.7
6175
6276$BASE = "$HOME" #change this if you want to install to a different location
6377$ProgressPreference = 'SilentlyContinue' # hide progress for faster downloads
6478$PSDefaultParameterValues=@{'out-file:encoding'='ascii'} #set text redirection to file as ascii
6579
6680# Install OpenJDK
6781# https://docs.microsoft.com/en-us/java/openjdk/download
6882md "$BASE\android"
6983cd "$BASE\android"
7084Invoke-WebRequest "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.zip" -OutFile "microsoft-jdk-Win-x64.zip"
7185Expand-Archive "microsoft-jdk-Win-x64.zip" ".\"
7286del "microsoft-jdk-Win-x64.zip"
7387
7488# Setup java environment for current process
7589${env:JAVA_HOME} = "$BASE\android\jdk-11.0.18+10"
7690${env:Path} = "${env:JAVA_HOME}\bin;" + ${env:Path}
7791
7892# Setup java environment for current user
7993# (this makes it persistent across reboots)
8094[Environment]::SetEnvironmentVariable("JAVA_HOME", "${env:JAVA_HOME}", "User")
8195$UserPath = "${env:JAVA_HOME}\bin;" + [Environment]::GetEnvironmentVariable("Path", "User")
8296[Environment]::SetEnvironmentVariable("Path", $UserPath, "User")
8397
8498# Download and extract Android SDK Command Line Tools for Windows
8599# https://developer.android.com/studio/#downloads
86100md "$BASE\android\sdk\cmdline-tools"
87101cd "$BASE\android\sdk\cmdline-tools"
88102Invoke-WebRequest "https://dl.google.com/android/repository/commandlinetools-win-9477386_latest.zip" -OutFile "commandlinetools-win.zip"
89103Expand-Archive "commandlinetools-win.zip" ".\"
90104ren "cmdline-tools" "latest"
91105del "commandlinetools-win.zip"
92106
93107# Install SDK packages and NDK
94108cd "$BASE\android\sdk\cmdline-tools/latest/bin"
95109@('y','y','y','y','y','y','y','y','y','y') | ./sdkmanager --licenses
96110# (Note: to view a list of available packages use .\sdkmanager --list)
97111.\sdkmanager "platforms;android-31" "build-tools;31.0.0" "tools" "ndk;22.1.7171670" "extras;android;m2repository"
98112
99113# Download FPCUPdeluxe from https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/latest
100114# (tested with version 2.2.0n)
101115md "$BASE\android\fpcupdeluxe_app"
102116cd "$BASE\android\fpcupdeluxe_app"
103117Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0n/fpcupdeluxe-x86_64-win64.exe" -OutFile "fpcupdeluxe-x86_64-win64.exe"
104118"[General]" > fpcupdeluxe.ini
105119"InstallDirectory=$BASE\android\fpc-lazarus" >> fpcupdeluxe.ini
106120.\fpcupdeluxe-x86_64-win64.exe
107121
108122# Using the FPCUPdeluxe GUI
109123# (The install path is already set. e.g. c:\users\[your_user]\android\fpc-lazarus)
110124#
111125# 1) At the bottom of the main Window, click the "LAMW" button
112126#
113127# As of 2023-Feb-05, this installs stable FPC (3.2.2), stable Lazarus (v2.2.4), cross
114128# compilers for arm/android and aarch64/android, gradle v6.8.3, and latest LAMW from git.
115129#
116130# 2) (Optional) On modules tab click the "OPM" button to install Online Package Manager.
117131# 3) Close FPCUPdeluxe
118132
119133# Change name for the desktop shortcut
120134# (this works if $BASE = $HOME, otherwise rename the desktop shortcut manually)
121135ren "$BASE\Desktop\Lazarus_fpc-lazarus.lnk" "Lazarus LAMW.lnk"
122136
123137# Create a directory for android projects
124138md "$BASE\android\projects"
125139
126140# Edit LAMW settings via the ini file
127141$LAMWini="$BASE\android\fpc-lazarus\config_lazarus\LAMW.ini"
128142(Get-Content $LAMWini | Select-String -pattern "PathToWorkspace" -notmatch) | Set-Content $LAMWini
129143"PathToWorkspace=$BASE\android\projects" >> $LAMWini
130144"PathToAndroidSDK=$BASE\android\sdk" >> $LAMWini
131145"PathToAndroidNDK=$BASE\android\sdk\ndk\22.1.7171670" >> $LAMWini
132146"NDK=6" >> $LAMWini
133147
134148# After launching Lazarus-LAMW, you can confirm paths and settings in
135149# the Tools | [LAMW] Android Module Wizard | Path Settings menu
136150```
137151
138152For new LAMW projects
139153
140-`for 32-bit:  ARMv7a + VFPv3 for Architecture/Instructions`\
141-`for 64-bit:  Aarch64 for Architecture/Instructions`\
142-`Min. Device API: 19  (Google recommended minimum SDK version)`\
143-`See here:  `[`https://android-developers.googleblog.com/2021/07/google-play-services-discontinuing-jelly-bean.html`](https://android-developers.googleblog.com/2021/07/google-play-services-discontinuing-jelly-bean.html)
154+```text
155+for 32-bit: ARMv7a + VFPv3 for Architecture/Instructions
156+for 64-bit: Aarch64 for Architecture/Instructions
157+Min. Device API: 19 (Google recommended minimum SDK version)
158+See here: https://android-developers.googleblog.com/2021/07/google-play-services-discontinuing-jelly-bean.html
159+```
144160
145161For demo LAMW projects
146162
147-`(Project | Open Project) Open the controls.lpi file in the demo project jni folder`\
148-`If it asks for a Target API change enter 31 for the target.`\
149-`for 32-bit:  Change LAMW project options | Min SDK: 19 and Build tab | Chipset: ARMv7a+VFPv3`\
150-`for 64-bit:  Change LAMW project options | Min SDK: 19 and Build tab | Chipset: Aarch64`\
151-`Perform a Run | Clean up and Build`
163+```text
164+(Project | Open Project) Open the controls.lpi file in the demo project jni folder
165+If it asks for a Target API change enter 31 for the target.
166+for 32-bit: Change LAMW project options | Min SDK: 19 and Build tab | Chipset: ARMv7a+VFPv3
167+for 64-bit: Change LAMW project options | Min SDK: 19 and Build tab | Chipset: Aarch64
168+Perform a Run | Clean up and Build
169+```
152170
153171Changes
154172
155-`2023-Feb-05 ver 0.7`\
156-` Use $BASE for installation directory (defaults to $HOME)`\
157-` Tested on Win10 Pro 22H2 64-bit`\
158-` Android Command-Line Tools for Linux build 9477386`\
159-` OpenJDK 11.0.18 LTS (Microsoft's build)`\
160-` Gradle 6.8.3 (installed automatically by FPCUPdeluxe)`\
161-` FPCUPdeluxe ver 2.2.0n`\
162-` Lazarus stable v2.2.4`
173+```text
174+2023-Feb-05 ver 0.7
175+ Use $BASE for installation directory (defaults to $HOME)
176+ Tested on Win10 Pro 22H2 64-bit
177+ Android Command-Line Tools for Linux build 9477386
178+ OpenJDK 11.0.18 LTS (Microsoft's build)
179+ Gradle 6.8.3 (installed automatically by FPCUPdeluxe)
180+ FPCUPdeluxe ver 2.2.0n
181+ Lazarus stable v2.2.4
182+```
163183
164-`2022-May-01 ver 0.6 - Initial release`\
165-` Tested on Win10 Pro 21H2 64-bit`\
166-` Android Command-Line Tools for Linux build 8092744`\
167-` OpenJDK 11.0.14 LTS (Microsoft's build)`\
168-` Gradle 7.3.1 (installed automatically by FPCUPdeluxe)`\
169-` FPCUPdeluxe ver 2.2.0i`\
170-` FPC stable v3.2.2`\
171-` Lazarus stable v2.2.0`
184+```text
185+2022-May-01 ver 0.6 - Initial release
186+ Tested on Win10 Pro 21H2 64-bit
187+ Android Command-Line Tools for Linux build 8092744
188+ OpenJDK 11.0.14 LTS (Microsoft's build)
189+ Gradle 7.3.1 (installed automatically by FPCUPdeluxe)
190+ FPCUPdeluxe ver 2.2.0i
191+ FPC stable v3.2.2
192+ Lazarus stable v2.2.0
193+```
172194
173195---
174196*From the Free Pascal wiki, page "LAMW install windows fpcupdeluxe", as it stood on 2023-02-07 after a change by WayneSherman, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history