windowspostgresqlvisual-c++installationadvanced-installer

install postgres on windows using advancedinstaller fails


I have this .bat file:

set INSTALL_PATH=%1
set CONFIG_PATH=%2
set DB_PASSWORD=%3
set DB_PORT=%4
set DB_PASSWORD=%DB_PASSWORD:"=%
set DB_PORT=%DB_PORT:"=%

%INSTALL_PATH% --mode unattended --unattendedmodeui minimal --disable-components stackbuilder --superpassword %DB_PASSWORD% --serverport %DB_PORT% --debugtrace postgres_install_logs.txt
powershell -Command "(gc '%CONFIG_PATH%' -raw) -replace '(?ms)spring.datasource.password=.*?$', 'spring.datasource.password=%DB_PASSWORD%' | Out-File -encoding ASCII '%CONFIG_PATH%'"
powershell -Command "(gc '%CONFIG_PATH%' -raw) -replace '(?ms)spring.datasource.url=jdbc:postgresql://localhost:5432/postgres', 'spring.datasource.url=jdbc:postgresql://localhost:%DB_PORT%/postgres' | Out-File -encoding ASCII '%CONFIG_PATH%'"

I'm using advancedinstaller to create an .exe installation file. I get this error message: "An error occured executing the Microsoft VC++ runtime installer." If I use the batch file directly it works OK and installs postgres.


Solution

  • Try to include the VC++ runtime installer as a prerequisite into your Advanced Installer Setup Project. Just check this in Prerequisites view of your setup project.

    Seems like a missing dependency (VC++ runtime) of your setup package.