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

Introduce silent tag for silent installer #17

Merged
merged 1 commit into from Dec 5, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Introduce silent tag for silent installer

When silent tag is added in tag list, "/silent /install" is added to
command line by metainstaller.
silent tag should be added at last of tag list.
  • Loading branch information
simonhong committed Dec 5, 2018
commit 399fb4be8867b660d95c1dce9eeec5e26497a4e7
@@ -121,7 +121,7 @@ def Tagging(args, omaha_dir, debug):
tag = tag.replace("TAG_APP_NAME", args.tag_app_name[0])
tag = tag.replace("TAG_AP", args.tag_ap[0])

silent_tag = 'appguid=APP_GUID&appname=TAG_APP_NAME&needsadmin=TAG_ADMIN&lang=en&ap=TAG_AP'
silent_tag = 'appguid=APP_GUID&appname=TAG_APP_NAME&needsadmin=TAG_ADMIN&lang=en&ap=TAG_AP&silent'
silent_tag = silent_tag.replace("TAG_ADMIN", 'False')
silent_tag = silent_tag.replace("APP_GUID", args.guid[0])
silent_tag = silent_tag.replace("TAG_APP_NAME", args.tag_app_name[0])
@@ -212,10 +212,32 @@ class MetaInstaller {
HandleError(hr);
return hr;
}
SafeCStringAppendCmdLine(&command_line, _T(" /%s %s /%s"),
kCmdLineInstallSource,
kCmdLineInstallSource_TaggedMetainstaller,
kCmdLineInstall);

const CString original_tag(tag.get());
CString silent_tag;
silent_tag.Format(_T("&%s"), kCmdLineSilent);
const int silent_tag_len = silent_tag.GetLength();
// If tag has silent tag, append \silent \install to command line.
// Also silent tag is removed from tag list and assign it to |tag|
// buffer again. silent tag isn't recognized by brave updater.
if (original_tag.Right(silent_tag_len).CompareNoCase(silent_tag) == 0) {
const CString revised_tag =
original_tag.Left(original_tag.GetLength() - silent_tag_len);
const int revised_tag_len = revised_tag.GetLength();
char *new_tag_buffer = new char[revised_tag_len + 1];
strncpy(new_tag_buffer, tag.get(), revised_tag_len);
new_tag_buffer[revised_tag_len] = NULL;
tag.reset(new_tag_buffer);

SafeCStringAppendCmdLine(&command_line, _T(" /%s /%s"),
kCmdLineSilent,
kCmdLineInstall);
} else {
SafeCStringAppendCmdLine(&command_line, _T(" /%s %s /%s"),
kCmdLineInstallSource,
kCmdLineInstallSource_TaggedMetainstaller,
kCmdLineInstall);
}
} else {
SafeCStringAppendCmdLine(&command_line, _T(" %s"), cmd_line_);

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.