Skip to content
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

WPF:WINDOWS Added ability to update application installed in Program Files folder #813

Merged

Conversation

abodalevsky
Copy link
Contributor

  1. Desktop application can be installed at any location, the most popular are:
  • User local data folder, in this case the bundle can be stored in the same location and be unique for the user.
  • Program Files folder, in this case the application is unique for the system and will be shared among all users of the system, the bundle should be unique for the system as well.

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.

  1. Small refactoring to share more code between UWP and WPF projects.

  2. Windows examples were updated to react-native-windows 0.43.0-rc.0

@abodalevsky abodalevsky changed the title WPF:WINDOWS Added ability to update eapplication installed in Program Files folder WPF:WINDOWS Added ability to update application installed in Program Files folder Apr 27, 2017
Copy link
Contributor

@sergey-akhalkov sergey-akhalkov left a 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());
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -27,7 +27,7 @@ internal class CodePushConstants
internal const string UnzippedFolderName = "unzipped";
#if WINDOWS_UWP
internal const string AssetsBundlePrefix = "ms-appx:///ReactAssets/";
internal const string FileBundlePrefix = "ms-appdata:///local";
internal const string FileBundlePrefix = "ms-appdata:///local/";
Copy link
Contributor

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?

Copy link
Contributor Author

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

@sergey-akhalkov sergey-akhalkov merged commit 6a1d1ff into microsoft:master Jun 16, 2017
@abodalevsky abodalevsky deleted the feature/wpf-program-data-storage branch June 21, 2017 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants