I have an installer that imports data to MongoDB using "mongorestore" by a PowerShell inline script custom action. The system has MongoDB (5.0.4 2008R2Plus) and MongoDB Tools (100.6.1) already installed beforehand. But after running the PS custom action, data gets imported to MongoDB but "Finish Dialog" doesn't appear at the end of the installation. I also use the property "Force Reboot After Install", The reboot prompt after finishing installation also doesn't appear after running this custom action.
Code: Select all
Param($baseDirectory)
$appDataDirectory = $baseDirectory.SubString(0, $baseDirectory.Length-1)
$coreDataPath = "$appDataDirectory\SeedData\mongodb\Data\2c88465c-f791-4b36-9dda-e2af38f11258"
$sampleDataPath = "$appDataDirectory\SeedData\mongodb\Data\SampleDatabase02"
$executablePath = "C:\Program Files\MongoDB\Tools\100\bin\mongorestore.exe"
$coreDataProcess = Start-Process -FilePath "$executablePath" -ArgumentList "--db=`"2c88465c-f791-4b36-9dda-e2af38f11258`"","`"$coreDataPath`"" -PassThru -Wait
$sampleDataProcess = Start-Process -FilePath "$executablePath" -ArgumentList "--db=`"SampleDatabase02`"","`"$sampleDataPath`"" -PassThru -Wait