Skip to content

Latest commit

 

History

History
281 lines (194 loc) · 8.06 KB

WINDOWS.md

File metadata and controls

281 lines (194 loc) · 8.06 KB

Windows

Instructions to run the wallet on Windows.

Install Android Studio

See the releases that most fits for your use:

Configure Android Studio Environment Variables

INFO: The following commands should be run in your PowerShell terminal.

As the SDK installation by default is installed at $env:USERPROFILE\AppData\Local\Android\Sdk, add the following environment variables targeting your user:

Set ANDROID_SDK_ROOT

[System.Environment]::SetEnvironmentVariable('ANDROID_SDK_ROOT',"$env:USERPROFILE\AppData\Local\Android\Sdk",[System.EnvironmentVariableTarget]::User)

Set ANDROID_HOME

[System.Environment]::SetEnvironmentVariable('ANDROID_HOME',"$env:USERPROFILE\AppData\Local\Android\Sdk",[System.EnvironmentVariableTarget]::User)

Now add the path for the Android Virtual Devices (AVD), this folder contains your configured devices.

Set ANDROID_AVD_HOME

[System.Environment]::SetEnvironmentVariable('ANDROID_AVD_HOME',"$env:USERPROFILE\.android\avd",[System.EnvironmentVariableTarget]::User)

Add Android Studio tools on executables PATH

INFO: For more details see Command-line tools.

Add the following paths to your environment PATH variable:

Set ANDROID_HOME/tools

$env:PATH += ";$env:ANDROID_HOME\tools"

Set ANDROID_HOME/tools/bin

$env:PATH += ";$env:ANDROID_HOME\tools\bin"

Set ANDROID_HOME/platform-tools

$env:PATH += ";$env:ANDROID_HOME\platform-tools"

Check the new paths

$env:PATH

Persist the new paths in your user environment

[System.Environment]::SetEnvironmentVariable('Path',$env:PATH,[System.EnvironmentVariableTarget]::User)

Check the PATH variable in your user environment

[System.Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::User)

Hardware Acceleration

INFO: For more details read Configure hardware acceleration for the Android Emulator

Intel processor + enabled Hyper-V

For intel processors and necessity to run Windows feature hyper-v (required by WSL), go with HAXM:

https://github.com/intel/haxm

Install Dependencies and Utilities

Install Chocolatey

It is a straight forward package manager software for Windows and it will be used in installation instructions that follows. Read the installation instructions for Chocolatey.

Install Java OpenJDK 11

Using Chocolatey

See the available options:

choco search openjdk11

Choose your desired version and install:

choco install microsoft-openjdk11
Using winget

See the available options:

winget search Microsoft.OpenJDK

Choose your desired version and install:

winget install Microsoft.OpenJDK.11

The installed JDK should be found at C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot.

Configure JDK environment variable

Add JAVA_HOME to your environment varibales targeting your user:

[System.Environment]::SetEnvironmentVariable('JAVA_HOME',"$env:ProgramFiles\Microsoft\jdk-11.0.16.101-hotspot",[System.EnvironmentVariableTarget]::User)

Install Make

See more about make tool, an utility to help build software, and used in the build process of the wallet.

Install by Chocolatey On windows you can install with Chocolatey:
choco install make

Install POEDIT

See more about POEDIT, a utility to manage and edit translations, see TRANSLATING.md

Install by Chocolatey

On windows you can install with Chocolatey:

choco install poedit

However the current available version is **2.4.2, while downloading from the website you get the most recent version.

  • or install by download

The installed POEDIT should be found at C:\Program Files (x86)\Poedit.

Configure POEDIT executable PATH

POEDIT uses some software tools underneath, a major one is GettextTools, and its executable is required for i18n compilation script of the wallet.

Add the GettextTools executable to PATH:

$env:PATH += ";${env:ProgramFiles(x86)}\Poedit\GettextTools\bin\;"

Persist the new PATH value in your user environment:

[System.Environment]::SetEnvironmentVariable('Path',$env:PATH,[System.EnvironmentVariableTarget]::User)

After run the command above restart your PowerShell session, then verify running the following command:

msgmerge --version

You should see a result like this:

msgmerge.exe (GNU gettext-tools) 0.21
Copyright (C) 1995-2020 Free Software Foundation, Inc.
Licença GPLv3+: GNU GPL versão 3 ou posterior <https://gnu.org/licenses/gpl.html>
Este é um software livre: você é livre para alterá-lo e redistribuí-lo.
NÃO HÁ QUALQUER GARANTIA, na máxima extensão permitida em lei.
Escrito por Peter Miller.
C:\Program Files (x86)\Poedit\GettextTools\bin\msgmerge.exe: erro de escrita

i18n compilation

Update the pot file at locale\texts.pot

npm run locale-update-pot

Navigate to locale directory

cd locale

Merge a pot file to po file:

msgmerge -D <any-subdirectory>\hathor-wallet-mobile\locale\ pt-br\texts.po texts.pot -o <any-subdirectory>\hathor-wallet-mobile\locale\pt-br\texts.po

for pt-br

msgmerge -D <any-subdirectory>\hathor-wallet-mobile\locale\ da\texts.po texts.pot -o <any-subdirectory>\hathor-wallet-mobile\locale\da\texts.po

for da

msgmerge -D <any-subdirectory>\hathor-wallet-mobile\locale\ ru-ru\texts.po texts.pot -o <any-subdirectory>\hathor-wallet-mobile\locale\ru-ru\texts.po

for ru-ru

Create the directory of compiled translations into src\locale\<locale> for each locale

mkdir src\locale\pt-br || mkdir src\locale\da || mkdir src\locale\ru-ru

Run i18n function to compile translations for each locale

make i18n

If you get an error like this:

make: *** [Makefile:34: src/locale/pt-br/texts.po.json] Error 1

then comment the line 34 from Makefile file and run again.

If you get an error like this:

npx ttag po2json locale/pt-br/texts.po > src/locale/pt-br/texts.po.json
if [  = 1 ]; then \
        msgcmp locale/da/texts.po locale/texts.pot; \
else \
        msgcmp --use-untranslated locale/da/texts.po locale/texts.pot; \
fi
...
make: *** [Makefile:57: locale/da/texts.po] Error 255

then copy the file src\pt-br\texts.po.json to src\da\ and src\ru-ru\, just to make the android build pass.

Add a mobile device in the emulator

  1. Open Android Studio
  2. Open the Virtual Device Manager
  3. Click in "Create device"
  4. Select a phone definition, like "Pixel 6"
  5. Choose an Android version and click on the icon of download besides the version name
  6. After download, click next
  7. Give a name for the ADV
  8. Accept the default values and click finish

Run

  1. Open 2 terminals
  2. On terminal (1) run npm start
  3. On terminal (2) run npm run android

Play with Hathor mobile wallet

After the android build:

  1. open your device emulation
  2. open the apps panel
  3. touch on Hathor icon and start playing around