• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..23-Jun-2021-

WIXInstallers/H23-Jun-2021-415378

build_debug_installer.cmdH A D23-Jun-2021884 2823

build_prerelease.cmdH A D23-Jun-20212 KiB7261

buildui.cmdH A D23-Jun-20211.4 KiB4536

doinstaller_wix.cmdH A D23-Jun-20216.5 KiB198159

dorelease.cmdH A D23-Jun-20215.6 KiB164127

readme.mdH A D23-Jun-20215.3 KiB145108

s3_prerelease.cmdH A D23-Jun-2021686 2014

readme.md

1# Windows Build Setup
2
3## Install Prereqs
4
5### Go
6- [go for windows](https://golang.org/dl)
7- Environment: `set GOPATH=C:\work`
8
9### Git
10
11- [git for windows](https://git-scm.com/downloads)
12  - Select "Use Git and optional Unix tools from the Command Prompt" (so scripts with `rm` will work)
13  - Checkout as-is, conmmit Unix style line endings
14  - Use Windows' default console window (especially on Windows 10)
15
16- Open a command console and make a directory for cloning the repo, e.g.:
17```
18git clone https://github.com/keybase/client.git c:\work\src\github.com\keybase\client
19git clone https://github.com/keybase/go-updater.git c:\work\src\github.com\keybase\go-updater
20```
21
22### Build Service, Etc
23
24- set GOPATH, e.g. `set GOPATH=c:\work`
25- `cd %GOPATH%\src\github.com\keybase\client\go\keybase`
26- `go build`
27
28### Electron
29
30#### Node
31
32- Easiest way is via [nodjs binary download](https://nodejs.org/en/download/)
33- Alternative way:
34  - [node version manager](https://github.com/coreybutler/nvm-windows):
35
36```
37> nvm install latest
38> nvm use [version]
39```
40
41#### Yarn
42
43`npm` should be in your path from the previous step. Then:
44
45```
46> npm i -g yarn
47```
48
49###  Mingpw
50
51- [GCC via Mingw-64](https://sourceforge.net/projects/mingw-w64/) (for building kbfsdokan)
52  - Be sure and choose architecture x86-64, NOT i686
53  - Also recommend not installing in `program files`
54    - Try `C:\mingw-w64\.... instead`
55
56## Building
57[GCC via Mingw-64](https://sourceforge.net/projects/mingw-w64/) (for building kbfsdokan)
58- Be sure and choose architecture x86-64, NOT i686
59- Also recommend not installing in `program files`, e.g. `C:\mingw-w64\...` instead of `C:\Program Files (x86)\mingw-w64\...`
60
61Environment:
62```
63set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
64set CC=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc
65set CPATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include
66```
67
68## Building Installers
69
70- [Visual Studio 2015 Professional](https://visualstudio.microsoft.com/vs/older-downloads/)
71(may require live.com account)
72
73- Environment:
74  - `call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"`
75  - [.net 3.5.1](https://www.microsoft.com/en-us/download/details.aspx?id=22) (needed for WIX)
76  - [WIX tools 3.11.1](http://wixtoolset.org/releases/) (needed to build the installer)
77  - Codesigning: see /keybase/team/keybase.builds.windows/readme.html
78
79## Building a debug installer without codesigning
80
81- Environment:
82  - `set KEYBASE_WINBUILD=0`
83
84- Invoke the scripts to build the executables:
85
86```cmd
87build_prerelease.cmd
88buildui.cmd
89doinstaller_wix.cmd debug
90```
91
92- OR, there's a little script that combines the above:
93   - `.\build_debug_installer.cmd`
94
95- Make sure you restart `CMD.exe` after doing the above installs; otherwise, these scripts
96  won't be able to find WIX.
97
98## Production CMD Scripts
99- `build_prerelease.cmd` builds most of the client executables
100- `buildui.cmd` builds the ui
101- `doinstaller_wix.cmd` does codesigning on all the executabls and builds the installer (requires signing certificate)
102- `dorelease.cmd` calls the above scripts and copies to s3. Invoked by the build bot.
103
104# Upgrading Dokan
105Download `DokanSetup_redist.exe` from https://github.com/dokan-dev/dokany/releases
106Upload to S3 at prerelease.keybase.io/windows-support/dokan-dev/[VERSION]/DokanSetup_redist.exe
107Get the sha1 hash of DokanSetup_redist.exe:
108`powershell Get-FileHash -Algorithm sha1 DokanSetup_redist.exe`
109Set the hash and version numbers in the installer project file: https://github.com/keybase/client/blob/master/packaging/windows/WIXInstallers/KeybaseApps/KeybaseApps.wixproj#L68
110Change the version the service considers new enough: https://github.com/keybase/client/blob/master/go/install/fuse_status_windows.go#L17
111Optional: change the minimum version KBFS will work with: https://github.com/keybase/client/blob/master/go/kbfs/dokan/loaddll.go#L110
112
113# Windows VMs
114- available [here](https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/)
115- full isos [here](https://www.microsoft.com/en-gb/software-download/windows10ISO), which might need product keys
116
117#  Might be Useful...
118- [Chocolatey](https://chocolatey.org/install) (helpful for yarn)
119  - then: `choco install yarn`
120
121# Installed Product Layout and Functionality
122The installer places/updates all the files and adds:
123- startup shortcut for
124- start menu shortcut
125- background tile color
126
127The service is invoked by the GUI with this command:
128`[INSTALLFOLDER]\keybaserq.exe keybase.exe --log-format=file --log-prefix="[INSTALLFOLDER]watchdog." ctl watchdog`
129This starts a copy of keybase.exe in watchdog mode, which in turn runs the service and updater and kbfs processes, restarting them if they die or are killed.
130If the service is closed with `keybase ctl stop`, which the GUI does when the widtget menu is used, the watchdog will see a different exit code and shut down all everything it's watching.
131
132`keybaserq.exe` has 2 main jobs: de-elevating permissions to run as current user, and running Keybase invisibly, without the CMD window appearing, since it is a console program.
133
134Notable executables
135`DokanSetup_redist.exe` - Dokan driver package, invoked from files tab in GUI
136`git-remote-keybase.exe` - GIT helper
137`kbfsdokan.exe` - kbfs
138`kbnm.exe` - browser extension
139`keybase.exe` - service
140`keybaserq.exe` - quiet launcher and de-elevator
141`prompter.exe` - updater GUI
142`upd.exe` - updater
143`Gui\Keybase.exe` - GUI
144
145