-
Notifications
You must be signed in to change notification settings - Fork 1.6k
WPF:WINDOWS Added ability to update application installed in Program Files folder #813
Conversation
sergey-akhalkov
left a comment
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.
Hi @abodalevsky, thank you so much for your contribution, LGMT. I have just several questions for clarification.
| return GetAppFolder(); | ||
| #endif | ||
| var codePushSubPathArray = fullPath.Split(Path.DirectorySeparatorChar); | ||
| return String.Join("/", codePushSubPathArray.SkipWhile((value, index) => codePushSubPathArray.Length - index > 4).ToArray()); |
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.
@abodalevsky, could you please clarify what means number 4?
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.
4 means last 4 segments of the path where JS bundle is located. The idea of the change was to unify the calculation of js bundle file location for UWP and WPF. While they have different prefix but last 4 segments are the same for both implementations.
For example for
F:\react-native-code-push\Examples\CodePushDemoApp\windows\CodePushDemoApp.Wpf\bin\x64\DebugBundle\CodePush\cc1dd1ab\CodePush\index.windows.bundle
the part that will be added to specific prefix will be:
CodePush/cc1dd1ab/CodePush/index.windows.bundle
| #if WINDOWS_UWP | ||
| internal const string AssetsBundlePrefix = "ms-appx:///ReactAssets/"; | ||
| internal const string FileBundlePrefix = "ms-appdata:///local"; | ||
| internal const string FileBundlePrefix = "ms-appdata:///local/"; |
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.
@abodalevsky, do I get it right if FileBundlePrefix const is used in GetJavaScriptBundleFileAsync method only, so there are no possible issues with this change?
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.
It should be fine I have checked it before commit
Usually, user has no write access to Program Files folder or at least admin privileges have to been requested. In this case the bundle will be stored in ProgramData folder as it is recommended.
Small refactoring to share more code between UWP and WPF projects.
Windows examples were updated to
react-native-windows 0.43.0-rc.0