diff options
author | Thomas Gaugler <thomas@dadie.net> | 2016-12-29 23:28:12 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2017-09-04 11:45:17 +0200 |
commit | 121ca1b6bb56041e7f412ffc15f18ea74c822f74 (patch) | |
tree | 251c93fc0bc8e7e3400f8602a4ad3b0f3ee703d1 | |
parent | d4460653744795af7068ef5911970bf189013514 (diff) |
Remove boot entry via pre function of uninstaller instfiles
This fixes the RPC_E_WRONG_THREAD (0x8001010E) error in case the
function for removing a boot entry was called from the uninstall section.
-rw-r--r-- | main.nsi | 2 | ||||
-rw-r--r-- | s_uninstall.nsi | 36 |
2 files changed, 20 insertions, 18 deletions
@@ -51,7 +51,7 @@ Page custom ShowCustom ; custom.nsi Page instfiles CreateBootEntry UninstPage uninstConfirm -UninstPage instfiles +UninstPage instfiles un.RemoveBootEntry ;-------------------------------- Var /GLOBAL c diff --git a/s_uninstall.nsi b/s_uninstall.nsi index e1da2ea..a51d34e 100644 --- a/s_uninstall.nsi +++ b/s_uninstall.nsi @@ -20,6 +20,25 @@ ${un.BOOTCFG_DeleteObject} ${un.BOOTCFG_RemoveBootEntry} +Function un.RemoveBootEntry + ReadRegStr $0 HKLM "${REGSTR_WIN32}" "bootmgr" + ${If} $0 != "" + ${un.BOOTCFG_DeleteObject} $services $basebcdstore $bcdstore $0 $2 $1 + ${If} $1 != 0 + IntFmt $1 "0x%08X" $1 + MessageBox MB_OK "$2: $1" + ${EndIf} + ${un.BOOTCFG_RemoveBootEntry} $services $basebcdstore $bcdstore \ + $basebcdobject $0 $2 $1 + ${If} $1 != 0 + IntFmt $1 "0x%08X" $1 + MessageBox MB_OK "$2: $1" + ${EndIf} + ${Endif} + + Call un.CleanUp +FunctionEnd + Section "Uninstall" ; Initialise $c ReadRegStr $c HKLM "${REGSTR_WIN32}" "system_drive" @@ -37,26 +56,9 @@ Section "Uninstall" DeleteINIStr "$c\boot.ini" "boot loader" "old_timeout_win32-loader" no_saved_boot_ini_timeout: - ReadRegStr $0 HKLM "${REGSTR_WIN32}" "bootmgr" - ${If} $0 != "" - ${un.BOOTCFG_RemoveBootEntry} $services $basebcdstore $bcdstore \ - $basebcdobject $0 $2 $1 - ${If} $1 != 0 - IntFmt $1 "0x%08X" $1 - DetailPrint "$2: $1" - ${EndIf} - ${un.BOOTCFG_DeleteObject} $services $basebcdstore $bcdstore $0 $2 $1 - ${If} $1 != 0 - IntFmt $1 "0x%08X" $1 - DetailPrint "$2: $1" - ${EndIf} - ${Endif} - DeleteRegKey HKLM "${REGSTR_WIN32}" DeleteRegKey HKLM "${REGSTR_UNINST}" Delete $c\g2ldr Delete $c\g2ldr.mbr RMDir /r /REBOOTOK $INSTDIR - - Call ${BOOTCFG_UNFUNC}CleanUp SectionEnd |