release_updater 1.0.2 release_updater: ^1.0.2 copied to clipboard
A simple way to update release/installation files in a local directory.
example/release_updater_example.dart
import 'dart:io';
import 'package:release_updater/release_updater_io.dart';
void main() async {
var storage = ReleaseStorageDirectory('appx', Directory('/install/path'));
var provider =
ReleaseProviderHttp.baseURL('https://your.domain/appx/releases');
var releaseUpdater = ReleaseUpdater(storage, provider);
print('-- Updating...');
var updatedToVersion = await releaseUpdater.update();
if (updatedToVersion != null) {
print('-- Updated to version: $updatedToVersion');
}
var runExecutable = await storage.currentReleaseFilePath('run.exe');
print('-- Running: $runExecutable');
Process.run(runExecutable!, []);
}