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

Skip to content

Commit 07e4b81

Browse files
committed
Installation will save options for pgAdmin"
1 parent e30f476 commit 07e4b81

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nsis/postgresql.nsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
!insertmacro VersionCompare
2828
;--------------------------------
2929
!define LANGFILE_LANGDLL_FMT "%ENGNAME%" ; or %NATIVEASCIINAME%, %NATIVENAME% can also be used but it will display ? in some cases.
30+
!define PG_REG_KEY_FOR_PGADIN "SOFTWARE\PostgreSQL\Services\"
31+
3032
;General
3133
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
3234
OutFile "${BUILD_DIR}\installers\${PRODUCT_NAME}_${PG_DEF_VERSION}_${PG_INS_SUFFIX}"
@@ -1264,6 +1266,16 @@ Function WriteInstallOptions
12641266
WriteRegStr HKLM "${PG_REG_SERVICE_KEY}" "Display Name" $Branding_text
12651267
WriteRegStr HKLM "${PG_REG_SERVICE_KEY}" "Product Code" $ServiceID_text
12661268
WriteRegStr HKLM "${PG_REG_SERVICE_KEY}" "Service Account" $ServiceAccount_text
1269+
1270+
;for pgAdmin
1271+
;MessageBox MB_OK|MB_ICONINFORMATION "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text"
1272+
WriteRegStr HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Data Directory" $DATA_DIR
1273+
WriteRegStr HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Database Superuser" $UserName_text
1274+
WriteRegStr HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Display Name" $Branding_text
1275+
WriteRegDWORD HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Port" $TextPort_text
1276+
WriteRegStr HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Product Code" $ServiceID_text
1277+
WriteRegStr HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Service Account" $ServiceAccount_text
1278+
12671279
FunctionEnd
12681280

12691281
Function un.DeleteInstallOptions
@@ -1306,6 +1318,16 @@ Function un.DeleteInstallOptions
13061318
DeleteRegKey /ifempty HKLM "${PG_OLD_REG_KEY}"
13071319
DeleteRegKey /ifempty HKLM "${PG_OLD_REG_SERVICE_KEY}"
13081320
${endif}
1321+
;for pgAdmin
1322+
;MessageBox MB_OK|MB_ICONINFORMATION "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text"
1323+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Data Directory"
1324+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Database Superuser"
1325+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Display Name"
1326+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Port"
1327+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Product Code"
1328+
DeleteRegValue HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text" "Service Account"
1329+
DeleteRegKey /ifempty HKLM "${PG_REG_KEY_FOR_PGADIN}$ServiceID_text"
1330+
13091331
FunctionEnd
13101332

13111333
Function un.ChecExistInstall

0 commit comments

Comments
 (0)