Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55b3663

Browse files
committed
Try to start pgpro_upgrade over runas plugin
1 parent 38a0487 commit 55b3663

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

nsis/postgresql.nsi

+14-6
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,21 @@ Section $(PostgreSQLString) sec1
507507
AccessControl::GrantOnFile "$INSTDIR\scripts" "$loggedInUser" "FullAccess"
508508
Pop $0 ;"ok" or "error" + error details
509509
${if} $isDataDirExist == 1
510-
; there exist data directory. We need to stop service,
511-
; run pgpro-upgrade script and
512-
DetailPrint "Performing catalog upgradeon $DATA_DIR"
513-
nsExec::ExecToStack '"$INSTDIR/scripts/pgpro_upgrade" "$DATA_DIR"'
510+
; there exist data directory. We need to stop service,
511+
; run pgpro-upgrade script and
512+
513+
;DetailPrint "Performing catalog upgradeon $DATA_DIR"
514+
;nsExec::ExecToStack '"$INSTDIR/scripts/pgpro_upgrade" "$DATA_DIR"'
515+
;Pop $0
516+
;Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
517+
;DetailPrint "$1"
518+
StrCpy $1 $ServiceAccount_text
519+
StrCpy $2 ""
520+
StrCpy $3 '"$INSTDIR/scripts/pgpro_upgrade" "$DATA_DIR"'
521+
StrCpy $4 0
522+
System::Call 'RunAs::RunAsW(w r1, w r2, w r3, *w .r4) i .r0 ? u'
514523
pop $0
515-
Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
516-
DetailPrint "$1"
524+
DetailPrint "pgpro_upgrade over runas return $0"
517525
${endif}
518526

519527
DetailPrint "Start server service..."

0 commit comments

Comments
 (0)