diff options
author | Thomas Gaugler <thomas@dadie.net> | 2016-12-29 23:19:27 +0100 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2017-09-04 11:45:05 +0200 |
commit | d4460653744795af7068ef5911970bf189013514 (patch) | |
tree | bb08d6631188dfa369a0e3220c8044ab33f6a926 | |
parent | 2b0c5412940793ccd27c5f50cd01ead4a23f7c2a (diff) |
Create boot entry via pre function of instfiles
This fixes the RPC_E_WRONG_THREAD (0x8001010E) error in case the
function for adding a boot entry was called from the install section.
-rw-r--r-- | main.nsi | 2 | ||||
-rw-r--r-- | s_install.nsi | 57 |
2 files changed, 33 insertions, 26 deletions
@@ -48,7 +48,7 @@ Page custom ShowGraphics ; graphics.nsi Page custom ShowBranch ; download.nsi and branch.nsi !endif Page custom ShowCustom ; custom.nsi -Page instfiles +Page instfiles CreateBootEntry UninstPage uninstConfirm UninstPage instfiles diff --git a/s_install.nsi b/s_install.nsi index 71bb44a..c08d3f2 100644 --- a/s_install.nsi +++ b/s_install.nsi @@ -91,8 +91,34 @@ Function AddBootEntry Pop $0 FunctionEnd -Section "Installer Loader" +Function CreateBootEntry + ${If} $windows_boot_method == bootmgr + ReadRegStr $0 HKLM "${REGSTR_WIN32}" "bootmgr" + ${If} $0 == "" + ${BOOTCFG_CreateGUID} $2 + ${If} $2 != "" + Push "$2" +!ifdef PXE + ${If} $pxe_mode == "true" + Push "$(pxe)" + ${Else} +!endif ; PXE + Push "$(d-i)" +!ifdef PXE + ${EndIf} ; $pxe_mode == "true" +!endif ; PXE + Call AddBootEntry + WriteRegStr HKLM "${REGSTR_WIN32}" "bootmgr" "$2" + Call CleanUp + ${Else} + MessageBox MB_OK|MB_ICONSTOP "$(error_bcdedit_extract_id)" + Quit + ${EndIf} + ${Endif} + ${Endif} +FunctionEnd +Section "Installer Loader" ; ****************************************************************************** ; ***************************************** THIS IS WHERE THE REAL ACTION STARTS ; ****************************************************************************** @@ -477,28 +503,11 @@ ${EndIf} MessageBox MB_OK|MB_ICONSTOP "$(error_copyfiles)" Quit !endif - DetailPrint "$(registering_bootmgr)" - ReadRegStr $0 HKLM "${REGSTR_WIN32}" "bootmgr" - ${If} $0 == "" - ${BOOTCFG_CreateGUID} $2 - ${If} $2 != "" - Push "$2" -!ifdef PXE - ${If} $pxe_mode == "true" - Push "$(pxe)" - ${Else} -!endif ; PXE - Push "$(d-i)" -!ifdef PXE - ${EndIf} ; $pxe_mode == "true" -!endif ; PXE - Call AddBootEntry - WriteRegStr HKLM "${REGSTR_WIN32}" "bootmgr" "$2" - ${Else} - MessageBox MB_OK|MB_ICONSTOP "$(error_bcdedit_extract_id)" - Quit - ${EndIf} - ${Endif} + ${If} $bcdstore != "" + Call CleanUp + ${Else} + DetailPrint "$(registering_bootmgr)" + ${EndIf} ${Endif} ; ********************************************** Needed for systems with compressed NTFS @@ -517,6 +526,4 @@ ${EndIf} nsExec::Exec '"compact" /u $INSTDIR\pxe.lkrn' ${EndIf} !endif ;PXE - - Call CleanUp SectionEnd |