@@ -99,6 +99,7 @@ static constexpr wchar_t FLAG_CHKCERT_NAME[] = L"-chkCertName=";
9999static constexpr wchar_t FLAG_CHKCERT_SUBJECT[] = L" -chkCertSubject=" ;
100100static constexpr wchar_t FLAG_CHKCERT_KEYID[] = L" -chkCertKeyId=" ;
101101static constexpr wchar_t FLAG_CHKCERT_AUTHORITYKEYID[] = L" -chkCertAuthorityKeyId=" ;
102+ static constexpr wchar_t FLAG_ERRLOGPATH[] = L" -errLogPath=" ;
102103
103104static constexpr wchar_t MSGID_HELP[] =
104105L" Usage:\r\n \
@@ -134,17 +135,20 @@ gup [-vVERSION_VALUE] [-infoUrl=URL] [-forceDomain=URL_PREFIX]\r\n\
134135Update mode:\r\n \
135136\r\n \
136137gup [-vVERSION_VALUE] [-infoUrl=URL] [-chkCertSig=YES_NO] [-chkCertTrustChain]\r\n \
137- [-chkCertRevoc] [-chkCertName=CERT_NAME] [-chkCertSubject= CERT_SUBNAME]\r\n \
138+ [-chkCertRevoc] [-chkCertName=\" CERT_NAME\] [-chkCertSubject = \" CERT_SUBNAME\" ]\r\n \
138139 [-chkCertKeyId=CERT_KEYID] [-chkCertAuthorityKeyId=CERT_AUTHORITYKEYID]\r\n \
140+ [-errLogPath=\" YOUR\\ ERR\\ LOG\\ PATH.LOG\" ]\r\n \
139141\r\n \
140142 -chkCertSig= : Enable signature check on downloaded binary with \" -chkCertSig=yes\" .\r\n \
141143 Otherwise all the other \" -chkCert*\" options will be ignored.\r\n \
142- -chkCertTrustChain : Enable signature trust chain verification.\r\n \
144+ -chkCertTrustChain : Enable signature chain of trust verification.\r\n \
143145 -chkCertRevoc : Enable the verification of certificate revocation state.\r\n \
144146 -chkCertName= : Verify certificate name (quotes allowed for white-spaces).\r\n \
145147 -chkCertSubject= : Verify subject name (quotes allowed for white-spaces).\r\n \
146148 -chkCertKeyId= : Verify certificate key identifier.\r\n \
147149 -chkCertAuthorityKeyId= : Verify certificate authority key identifier.\r\n \
150+ -errLogPath= : override the default error log path. The default value is:\r\n \
151+ \" %LOCALAPPDATA%\\ WinGUp\\ log\\ securityError.log\"\r\n \
148152\r\n \
149153Download & unzip mode:\r\n \
150154\r\n \
@@ -1362,6 +1366,12 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
13621366 securityGuard.setAuthorityKeyId (authority_key_id);
13631367 }
13641368
1369+ wstring errLogPath;
1370+ if (getParamValFromString (FLAG_ERRLOGPATH, params, errLogPath))
1371+ {
1372+ securityGuard.setErrLogPath (errLogPath);
1373+ }
1374+
13651375 // Object (gupParams) is moved here because we need app icon form configuration file
13661376 GupParameters gupParams (L" gup.xml" );
13671377 appIconFile = gupParams.getSoftwareIcon ();
@@ -1652,7 +1662,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR lpszCmdLine, int)
16521662 if (downloadURL.size () <= forceDomain.size () // download URL must be longer than forceDomain
16531663 || downloadURL.compare (0 , forceDomain.size (), forceDomain) != 0 ) // Check if forceDomain is a prefix of download URL
16541664 {
1655- securityGuard.writeSecurityError (L" Domain is not matched for download URL :" , downloadURL);
1665+ securityGuard.writeSecurityError (L" Download URL does not match the expected domain :" , downloadURL);
16561666 return -1 ;
16571667 }
16581668 }
0 commit comments