Ticket #8376: installthewindowsway.patch

File installthewindowsway.patch, 1.3 KB (added by mttp, 5 years ago)
  • new file changes/bug8376

    diff --git a/changes/bug8376 b/changes/bug8376
    new file mode 100644
    index 0000000..5a6bfe6
    - +  
     1  o Bugfixes:
     2    - The Windows installer will now automatically run itself as Administrator
     3      (or fail helpfully on very old systems). This behavior better conforms
     4      to what Windows users probably expect.
  • contrib/win32build/tor-mingw.nsi.in

    diff --git a/contrib/win32build/tor-mingw.nsi.in b/contrib/win32build/tor-mingw.nsi.in
    index f5c02db..182819a 100644
    a b  
    1616 
    1717 
    1818SetCompressor /SOLID LZMA ;Tighter compression
    19 RequestExecutionLevel user ;Updated for Vista compatibility
     19RequestExecutionLevel admin
    2020OutFile ${INSTALLER}
    2121InstallDir $PROGRAMFILES\Tor
    2222SetOverWrite ifnewer
    Var CONFIGDIR 
    6161Var CONFIGFILE
    6262
    6363Function .onInit
     64        UserInfo::GetAccountType
     65        pop $0
     66        ${If} $0 != "admin" ; Windows 95 through Windows XP-SP* lack User
     67                            ; Account Control, and so will go to this check
     68                            ; instead of ignoring the RequestExecutionLevel
     69                            ; flag and failing due to insufficient privileges.
     70                MessageBox mb_iconstop "Installer should be run as Administrator."
     71                SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
     72                Quit
     73        ${EndIf}
    6474        Call ParseCmdLine
    6575FunctionEnd
    6676