Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: installer/src/custom-action/close_application.cpp

Issue 6689082285490176: Issue 1598 - The set up was unable to automatically close IE while uninstall
Left Patch Set: Created March 18, 2015, 1:42 a.m.
Right Patch Set: Treat Basic UI as interactive mode Created March 19, 2015, 2:15 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | installer/src/msi/adblockplusie.wxs » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /** 1 /**
2 * \file close_application.cpp 2 * \file close_application.cpp
3 */ 3 */
4 4
5 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "session.h" 7 #include "session.h"
8 #include "property.h" 8 #include "property.h"
9 #include "database.h" 9 #include "database.h"
10 #include "process.h" 10 #include "process.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 */ 199 */
200 /* 200 /*
201 * The UILevel property indicates whether we have the ability to put dialog boxes up. 201 * The UILevel property indicates whether we have the ability to put dialog boxes up.
202 * Levels 2 (silent) and 3 (basic) do not have this ability. 202 * Levels 2 (silent) and 3 (basic) do not have this ability.
203 * Levels 4 (reduced) and 5 (full) do. 203 * Levels 4 (reduced) and 5 (full) do.
204 * 204 *
205 * MSDN [UILevel property](http://msdn.microsoft.com/en-us/library/windows/d esktop/aa372096%28v=vs.85%29.aspx) 205 * MSDN [UILevel property](http://msdn.microsoft.com/en-us/library/windows/d esktop/aa372096%28v=vs.85%29.aspx)
206 */ 206 */
207 std::wstring uilevel = Property( session, L"UILevel" ) ; 207 std::wstring uilevel = Property( session, L"UILevel" ) ;
208 bool interactive ; 208 bool interactive ;
209 if ( uilevel == L"5" || uilevel == L"4" ) 209 if ( uilevel == L"5" || uilevel == L"4" || uilevel == L"3")
210 { 210 {
211 interactive = true ; 211 interactive = true ;
212 // Assert state is one of { notKnown, allow, passive, active, automatic } 212 // Assert state is one of { notKnown, allow, passive, active, automatic }
213 } 213 }
214 else if ( uilevel == L"3" || uilevel == L"2" ) 214 else if (uilevel == L"2")
215 { 215 {
216 // Assert installer is running without user interaction. 216 // Assert installer is running without user interaction.
217 interactive = false ; 217 interactive = false ;
218 if ( state == notKnown ) 218 if ( state == notKnown )
219 { 219 {
220 // Assert AVOIDREBOOT was not specified 220 // Assert AVOIDREBOOT was not specified
221 /* 221 /*
222 * This is where we specify default behavior for non-interactive operati on. 222 * This is where we specify default behavior for non-interactive operati on.
223 * The choice of "allow" makes it act like other installers, which is to make no effort to avoid a reboot after installation. 223 * The choice of "allow" makes it act like other installers, which is to make no effort to avoid a reboot after installation.
224 */ 224 */
225 » state = notKnown ; 225 » state = allow ;
Eric 2015/03/18 16:13:47 Assigning a state that you just checked is not nee
226 » session.Log( "Reboot NOT allowed by default in non-interactive session." ) ; 226 » session.Log( "Reboot allowed by default in non-interactive session." ) ;
227 } 227 }
228 else if ( state == active ) 228 else if ( state == active )
229 { 229 {
230 throw std::runtime_error( "AVOIDREBOOT=ACTIVE in non-interative session is not consistent" ) ; 230 throw std::runtime_error( "AVOIDREBOOT=ACTIVE in non-interative session is not consistent" ) ;
231 } 231 }
232 // Assert state is one of { allow, passive, automatic } 232 // Assert state is one of { allow, passive, automatic }
233 } 233 }
234 else 234 else
235 { 235 {
236 throw std::runtime_error( "unrecognized value for UILevel" ) ; 236 throw std::runtime_error( "unrecognized value for UILevel" ) ;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 return ERROR_INSTALL_FAILURE ; 441 return ERROR_INSTALL_FAILURE ;
442 } 442 }
443 catch( ... ) 443 catch( ... )
444 { 444 {
445 session.LogNoexcept( "terminated by unknown exception" ) ; 445 session.LogNoexcept( "terminated by unknown exception" ) ;
446 return ERROR_INSTALL_FAILURE ; 446 return ERROR_INSTALL_FAILURE ;
447 } 447 }
448 // Should be unreachable. 448 // Should be unreachable.
449 return ERROR_INSTALL_FAILURE ; 449 return ERROR_INSTALL_FAILURE ;
450 } 450 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld