Skip to content

Commit 9b71042

Browse files
committed
Add fusion CLI quick start guide
1 parent 299c065 commit 9b71042

File tree

3 files changed

+124
-4
lines changed

3 files changed

+124
-4
lines changed

docs/getting-started/fusion-cli.mdx

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Fusion CLI
2+
<AppliesTo all />
3+
Integrate directly using the command line interface.
4+
5+
If there isn't a native library, or command line bindings for your language yet, you can directly integrate Velopack using the command line.
6+
7+
***There are two binaries needed.***
8+
9+
## Fusion
10+
`Vfusion.exe` / `VfusionMac` / `VFusionNix`<br/>
11+
Provides support for getting current version, checking for updates, downloading updates etc.
12+
13+
:::warning
14+
At this time, the fusion binary is not automatically distributed, and you need to copy this into your compiler output directory.
15+
You can download a [recent build artifact](https://github.com/velopack/velopack.fusion/actions) and make sure it's copied to your output dir during builds.
16+
:::
17+
18+
### Example
19+
```
20+
> Vfusion.exe check --url https://the.place/you-host/updates
21+
```
22+
23+
These are the possible outputs:
24+
- **No updates are available:** empty stdout and `exitCode == 0`.
25+
- **Unrecoverable error:** empty stdout and `exitCode != 0`. A [log file](#logging) will be created.
26+
- **Update is availble:** stdout contains json object and `exitCode == 0`.
27+
28+
When an update is available, you'll receive an [UpdateInfo](../reference/cs/Velopack/UpdateInfo.md) object via stdout:
29+
30+
```json
31+
{
32+
"isDowngrade": false,
33+
"targetFullRelease": {
34+
"packageId": "YourPackageId",
35+
"version": "2.0.1",
36+
"type": "Full",
37+
"fileName": "YourPackageId-2.0.1-full.nupkg",
38+
"sha1": "331a4f44a6a875b2ce139ae0c9ce5bb5e1ec0d97",
39+
"size": 90654,
40+
"notesMarkdown": "# Release v2.0.1 \n Your message here",
41+
"notesHtml": "<h1>Release v2.0.1</h2><br/>Your message here"
42+
}
43+
}
44+
```
45+
46+
The next step is to download an update to disk, using the `fileName` property from the previous command:
47+
48+
```
49+
> Vfusion.exe download \
50+
--url https://the.place/you-host/updates \
51+
--name YourPackageId-2.0.1-full.nupkg
52+
```
53+
54+
During this command, fusion will output the current download progress to stdout. For example:
55+
```
56+
10
57+
20
58+
30
59+
40
60+
...
61+
```
62+
63+
You can parse each line of stdout (split by `\n`) and show progress to your users.
64+
65+
If `exitCode == 0` the command was successful.
66+
67+
To get the final path to the downloaded asset, you can combine the result of `Vfusion.exe get-packages` and `fileName`.
68+
69+
To install the update, please see the next section.
70+
71+
:::tip
72+
There are other commands (eg. `get-version`) which may be useful, explore them with `Vfusion.exe -h`
73+
:::
74+
75+
## Updater
76+
`Update.exe` / `UpdateMac` / `UpdateNix`<br/>
77+
Provides support for installing downloaded updates, prompting for elevation (if required), bootstrapping [dependencies](../packaging/bootstrapping.mdx), and so forth.
78+
79+
:::info
80+
This binary is automatically copied into your package when building `vpk`, you just need to locate it relative to your main executable.
81+
:::
82+
83+
You will use the `update apply` command to install a downloaded update.
84+
85+
### Example
86+
87+
```
88+
> Update.exe apply --restart
89+
```
90+
91+
Running the above command will immediately close your program, install the update, and restart your app on the new version.
92+
93+
:::tip
94+
If called with no arguments, Update will apply the newest downloaded release, as long as it's newer than the currently installed release.
95+
If you would like to install an older release, you need to specify the `--package` parameter.
96+
:::
97+
98+
All of the available apply options are below:
99+
100+
```
101+
update apply:
102+
Applies a staged / prepared update, installing prerequisite runtimes if necessary
103+
-r, --restart Restart the application after the update
104+
-w, --wait Wait for the parent process to terminate before applying the update
105+
--waitPid <PID> Wait for the specified process to terminate before applying the update
106+
-p, --package <FILE> Update package to apply
107+
-h, --help Print help
108+
[EXE_ARGS]... Arguments to pass to the restarted executable. Must be preceeded by '--'.
109+
```
110+
111+
## Logging
112+
Since errors are not printed on stdout, it is important to know where to locate log files to diagnose errors.
113+
114+
### Windows
115+
Updater will log to it's own directory, and Fusion will log to the folder one above itself.
116+
In a typical installation, this will result in both the Fusion logs and Updater log being merged into one log file.
117+
118+
### Linux and MacOS
119+
On UNIX-like operating systems, the logs for these binaries always go to `/tmp/velopack.log`.

docs/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ To enable your application to make full use of Velopack, you need to do 3 things
1313
## Language Support
1414
There are libraries planned or supported for the languages below.
1515

16-
:::tip
17-
If your language is not listed, you can [open an issue to request it](https://github.com/velopack/velopack.fusion/issues), or if your language supports running a process you can integrate directly with the Fusion CLI.
18-
:::
19-
2016
| Lang | Status | Runtime Deps | Async | Links |
2117
|:-:|---|---|---|---|
2218
| C# | ✅ Ready | ✅ None | ✅ Yes | [quick start](./getting-started/csharp.mdx), [docs](./reference/cs/Velopack/), [samples](https://github.com/velopack/velopack/tree/master/samples), [nuget.org](https://nuget.org/packages/velopack) |
@@ -28,6 +24,10 @@ If your language is not listed, you can [open an issue to request it](https://gi
2824
| Swift | Planned | - | - | - | - |
2925
| Go | Planned | - | - | - | - |
3026

27+
:::info
28+
If your language is not listed, you can [**open an issue to request it**](https://github.com/velopack/velopack.fusion/issues),
29+
or if your language supports running a process you can [**integrate directly with the Fusion CLI**](./getting-started/fusion-cli.mdx).
30+
:::
3131

3232
<!-- ## Migrating to Velopack
3333
import DocCardList from '@theme/DocCardList';

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const sidebars: SidebarsConfig = {
4747
doc("getting-started/cpp", "C++"),
4848
doc("getting-started/electron", "JS / Electron"),
4949
doc("getting-started/rust", "Rust"),
50+
doc("getting-started/fusion-cli", "Fusion CLI"),
5051
],
5152
link: { type: 'generated-index' },
5253
},

0 commit comments

Comments
 (0)