-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't throw error on WASM install when MSFS2024 isn't installed #1917
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
using MobiFlight.InputConfig; | ||
using Newtonsoft.Json; | ||
using System.IO; | ||
using FSUIPC; | ||
|
||
namespace MobiFlight.UI | ||
{ | ||
|
@@ -2253,12 +2254,20 @@ private void InstallWasmModule() | |
|
||
if (Is2020Different) | ||
{ | ||
Update2020Successful = HandleWasmInstall(updater, Is2020Different, updater.CommunityFolder, "2020"); | ||
Update2020Successful = HandleWasmInstall(updater, updater.CommunityFolder, "2020"); | ||
} | ||
else | ||
{ | ||
Log.Instance.log($"WASM module for MSFS2020 is already up-to-date.", LogSeverity.Info); | ||
} | ||
|
||
if (Is2024Different) | ||
{ | ||
Update2024Successful = HandleWasmInstall(updater, Is2024Different, updater.CommunityFolder2024, "2024"); | ||
Update2024Successful = HandleWasmInstall(updater, updater.CommunityFolder2024, "2024"); | ||
} | ||
else | ||
{ | ||
Log.Instance.log($"WASM module for MSFS2024 is already up-to-date.", LogSeverity.Info); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this also be logged even if the user doesn't have 2024 installed? |
||
} | ||
|
||
// If either update is successful then show the success dialog. | ||
|
@@ -2287,22 +2296,15 @@ private void InstallWasmModule() | |
/// Handles all the necessary and log messages for installing the WASM with different versions of MSFS. | ||
/// </summary> | ||
/// <param name="updater">The WASM updater to use</param> | ||
/// <param name="isDifferent">True if the versions of WASM were different</param> | ||
/// <param name="communityFolder">The path to the community folder</param> | ||
/// <param name="msfsVersion">The version of MSFS, either "2020" or "2024"</param> | ||
/// <returns></returns> | ||
private static bool HandleWasmInstall(WasmModuleUpdater updater, bool isDifferent, string communityFolder, string msfsVersion) | ||
private static bool HandleWasmInstall(WasmModuleUpdater updater, string communityFolder, string msfsVersion) | ||
{ | ||
if (String.IsNullOrEmpty(communityFolder)) | ||
{ | ||
Log.Instance.log($"Skipping WASM install for MSFS{msfsVersion} since no community folder was found. This likely means MSFS{msfsVersion} is not installed.", LogSeverity.Info); | ||
return false; | ||
} | ||
|
||
if (!isDifferent) | ||
{ | ||
Log.Instance.log($"WASM module for MSFS{msfsVersion} is already up-to-date.", LogSeverity.Info); | ||
return false; | ||
return true; | ||
} | ||
|
||
bool result = updater.InstallWasmModule(communityFolder); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this also be logged even if the user doesn't have 2020 installed?