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

Get promocode from registry #619

Merged
merged 2 commits into from Oct 12, 2018
Merged

Get promocode from registry #619

merged 2 commits into from Oct 12, 2018

Conversation

@simonhong
Copy link
Collaborator

simonhong commented Oct 12, 2018

This pr is based on #613.

Promo code will be came from stub installer filename.
To pass promocode stub installer stores its filename that including promocode to registry.

Omaha client PR is here - brave/omaha#5.

Fixes brave/brave-browser#1515

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

Create key - \HKEY_CURRENT_USER\BraveSofware\Promo
and add string value (ex, BraveBrowserSetup-RED397.exe) with StubInstallerPath key.
Then, run mini_installer.

A file named promoCode is written to the user-data-dir
The promoCode file contains the appropriate code (e.g., RED397 in the example given above)
installs as expected

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source
Copy link
Contributor

emerick left a comment

LGTM

+
+ const wchar_t* last_argument = args[argument_count - 1];
+ if (StrStartsWith(last_argument, L"--"))
+ if (StrStartsWith(value, L"--"))

This comment has been minimized.

Copy link
@emerick

emerick Oct 12, 2018

Contributor

We probably don't need this check, since we're not passing a command-line flag anymore (this check was just to ensure that we were looking at a filename and not a --flag).

emerick and others added 2 commits Oct 11, 2018
The stub installer will parse its own filename and pass it to the mini
installer via the command line interface (it should be the last
argument on the command line). The mini installer will parse the
filename for a referral code and send it to the setup program as usual
if found. This will allow referrals to work via the updateable
installer.
Stub installer path is fetched from registry instead of args
because stub installer will store its path to registry.
@simonhong simonhong force-pushed the get_promo_from_reg branch from e9c51c2 to ef3f8d7 Oct 12, 2018
Copy link
Contributor

emerick left a comment

LGTM

@emerick emerick merged commit ad9f67f into master Oct 12, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
emerick added a commit that referenced this pull request Oct 12, 2018
Get promocode from registry
emerick added a commit that referenced this pull request Oct 12, 2018
Get promocode from registry
@emerick
Copy link
Contributor

emerick commented Oct 12, 2018

master: ad9f67f
0.55.x: 37414dc
0.56.x: b5cc8b1

@emerick emerick deleted the get_promo_from_reg branch Oct 12, 2018
@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.