You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started/cpp.mdx
+31-42Lines changed: 31 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -1,60 +1,54 @@
1
-
# Getting Started: C++
1
+
# Getting Started: C / C++
2
2
<AppliesToall />
3
-
Get started with our cross-platform C++ header library.
4
-
5
-
1. Copy [Velopack.hpp](https://github.com/velopack/velopack.fusion/blob/master/for-cpp/Velopack.hpp) and [Velopack.cpp](https://github.com/velopack/velopack.fusion/blob/master/for-cpp/Velopack.cpp) into your project.
6
-
7
-
0. Configure Unicode Support:
8
-
#### Windows
9
-
On Windows, to enable unicode support for this library you ***must***
10
-
[configure the UTF-8 code page](https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page) via your application
11
-
manifest. Failure to do so will potentially result in your application ***failing to update*** if there are any unicode characters in your user's
- If you are using Qt and `QString` is available, there's nothing further you need to do.
25
-
- If you are not using Qt, you'll need to [install ICU4C](https://icu.unicode.org/). Like many other C libraries,
26
-
installing the development package with your package manager (`apt`, `brew` etc) *should* be sufficient to make it available to compilers.
3
+
Get started with our cross-platform C / C++ library.
4
+
5
+
The Velopack C / C++ library is a pre-compiled dynamic library, which you can link into your application to enable auto-updates and installers.
6
+
There is a C and a C++ API available in [Velopack.h](https://github.com/velopack/velopack/blob/develop/src/lib-cpp/include/Velopack.h),
7
+
so this library is suitable for C / C++ application as well as other programming languages which support calling C functions eg. p/invoke.
8
+
9
+
:::tip
10
+
All the strings (eg. `char*` or `std::string`) are expected to be UTF-8 encoded.
11
+
On Windows, you may need to convert `wchar_t*` and `std::wstring` to UTF-8 before passing it to the library.
12
+
:::
13
+
14
+
1. Download the latest `velopack_libc_{version}.zip` from [GitHub Releases](https://github.com/velopack/velopack/releases) and include it into your project.
27
15
28
-
0. Add the `Velopack::startup()` to your entry point (eg. `main()` or `wmain()`) as early as possible, ideally the first statement to run:
16
+
0. Add the `include` directory to your include path, and add the appropriate binary from `lib` to your linker options.
17
+
18
+
0. Add `VelopackApp` to your entry point (eg. `main()` or `wmain()`) as early as possible, ideally the first statement to run:
// download the update, optionally providing progress callbacks
47
+
manager.DownloadUpdates(updInfo.value());
48
+
49
+
// prepare the Updater in a new process, and wait 60 seconds for this process to exit
50
+
manager.WaitExitThenApplyUpdate(updInfo.value());
51
+
exit(0); // exit the app to apply the update
58
52
}
59
53
```
60
54
@@ -69,11 +63,6 @@ Get started with our cross-platform C++ header library.
69
63
70
64
0. Compile your app to a program using your usual compiler (eg. msvc, cmake, gcc, etc)
71
65
72
-
0. Copy `Vfusion.exe`, `VfusionMac` or `VfusionNix` to your build output folder. This is a manual step for now, but may be automated in the future. You can compile this yourself, download a [recent build artifact](https://github.com/velopack/velopack.fusion/actions), or grab the latest [npm release](https://www.npmjs.com/package/velopack?activeTab=code) which also bundles the binaries.
73
-
:::warning
74
-
Until this is automated, failing to copy the fusion binary to your update directory will result in your app being unable to update.
| C++ | ✅ Ready |[quick-start](./getting-started/cpp.mdx), [docs](./reference/cpp/api.md), [gh-releases](https://github.com/velopack/velopack/releases)|
41
+
| Java | Planned | - | - |
42
+
| Python | Planned | - | - |
43
+
| Swift | Planned | - | - |
44
+
| Go | Planned | - | - |
45
+
46
+
Don't see your language here? [Open an issue](https://github.com/velopack/velopack/issues/new) to request and tell us how great it is!
45
47
46
48
## Migrating to Velopack
47
49
It should be easy to migrate to Velopack from other update frameworks. We do have some guides, but if we're missing one for your case please let us know about it on GitHub or Discord!
0 commit comments