mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 07:43:42 +08:00
fix https://github.com/StarCitizenToolBox/app/issues/27 : unp4k missing runtime
This commit is contained in:
parent
536daa176a
commit
62289b3b30
@ -83,10 +83,7 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
errorMessage: "${state.errorMessage}\n${event.data}");
|
errorMessage: "${state.errorMessage}\n${event.data}");
|
||||||
}
|
}
|
||||||
if (!_hasUnp4kRunTimeError) {
|
if (!_hasUnp4kRunTimeError) {
|
||||||
if (state.errorMessage.contains(
|
if (checkRunTimeError(state.errorMessage)) {
|
||||||
"You must install .NET to run this application") ||
|
|
||||||
state.errorMessage.contains(
|
|
||||||
"You must install or update .NET to run this application")) {
|
|
||||||
_hasUnp4kRunTimeError = true;
|
_hasUnp4kRunTimeError = true;
|
||||||
AnalyticsApi.touch("unp4k_no_runtime");
|
AnalyticsApi.touch("unp4k_no_runtime");
|
||||||
}
|
}
|
||||||
@ -246,6 +243,19 @@ class Unp4kCModel extends _$Unp4kCModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool checkRunTimeError(String errorMessage) {
|
||||||
|
if (errorMessage
|
||||||
|
.contains("You must install .NET to run this application") ||
|
||||||
|
errorMessage.contains(
|
||||||
|
"You must install or update .NET to run this application") ||
|
||||||
|
errorMessage.contains(
|
||||||
|
"It was not possible to find any compatible framework version")) {
|
||||||
|
AnalyticsApi.touch("unp4k_no_runtime");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<Uint8List> unp4kTools(
|
static Future<Uint8List> unp4kTools(
|
||||||
String applicationBinaryModuleDir, List<String> args) async {
|
String applicationBinaryModuleDir, List<String> args) async {
|
||||||
await BinaryModuleConf.extractModule(
|
await BinaryModuleConf.extractModule(
|
||||||
|
@ -235,10 +235,7 @@ class AdvancedLocalizationUIModel extends _$AdvancedLocalizationUIModel {
|
|||||||
return iniData;
|
return iniData;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
final errorMessage = e.toString();
|
final errorMessage = e.toString();
|
||||||
if (errorMessage
|
if (Unp4kCModel.checkRunTimeError(errorMessage)) {
|
||||||
.contains("You must install .NET to run this application") ||
|
|
||||||
errorMessage.contains(
|
|
||||||
"You must install or update .NET to run this application")) {
|
|
||||||
AnalyticsApi.touch("advanced_localization_no_runtime");
|
AnalyticsApi.touch("advanced_localization_no_runtime");
|
||||||
}
|
}
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
|
@ -302,10 +302,7 @@ class UnP4kErrorWidget extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (errorMessage.contains(
|
if (Unp4kCModel.checkRunTimeError(errorMessage)) ...[
|
||||||
"You must install .NET to run this application") ||
|
|
||||||
errorMessage.contains(
|
|
||||||
"You must install or update .NET to run this application")) ...[
|
|
||||||
Text(
|
Text(
|
||||||
S.current.tools_unp4k_missing_runtime,
|
S.current.tools_unp4k_missing_runtime,
|
||||||
style: const TextStyle(fontSize: 16),
|
style: const TextStyle(fontSize: 16),
|
||||||
|
Loading…
Reference in New Issue
Block a user