Forum Discussion
MSIX with Pre-requisites
Hi,
I have a similar problem. I would like to ship an app as an .msix. This app needs to have Sql Server Localdb installed. Our current installer (made by installshield) checks if Localdb is installed, and if not installs it (after having asked the user for permission).
Is it possible to achieve something like that with msix?
- Darren_HoehnaDec 02, 2019
Microsoft
Would another option be to install the server during convert time of the MSI?
I've ran into this issue when apps use Java. When running the MSIX packaging tool I first install Java then I run the msi. That way Java is installed in the package.
- Tim ManganDec 02, 2019MVP
Darren_Hoehna I am guessing that the Sql Server LocalDB is a service which is why I was thinking about scripts. But now support for services was announced at Ignite, and can be tested now using Insider builds of the packaging tool and insider build of the 2020H1 OS. You wouldn't need the packaging tool, except maybe to do a test capture to learn the manifest syntax that would have to be manually added to the manifest file.
This option wasn't available when this thread started, but could be tried now.
- Darren_HoehnaDec 02, 2019
Microsoft
Ahh. Yes. if localDB is a service then my first option may not work. So, maybe the localDB installer can be packaged with the app and a script can be useeat startup to install the service.
Basically what you said.
- FredrikDahlbergOct 09, 2019Copper Contributor
Thanks for your reply Tim. I've tried to add the psf files plus a config.json to my to my "Windows Application Packaging Project", but I'm not really sure how to continue from here. Is there any example of this that you can direct me to?
Also a beginner when it comes to Powershell scripting. Do you know of any good resource for checking and installing an app from powershell.
- Tanaka_JimhaDec 02, 2019Former Employee
If you to use PSF scripts to install SQL server from the App Packaging project you need to:
- Add PsfLauncher*.exe, PsfRunDLL*.exe, PsfRuntime*.dll, and StartingScriptWrapper.ps1 to your package
- Make a config.json file.
- Make your own .ps1 file that will install SQL
I found a few inks that may be helpful:
https://www.niallbrady.com/2018/04/25/install-sql-server-2017-powershell-script-download-it-here/
https://colinsalmcorner.com/post/install-and-configure-sql-server-using-powershell-dsc - Add the script to the config.json
If everything is right the script will start when the app starts and install SQL.
You can also add an ending script that will shut down SQL when the app exits.
Hope this helps.
Tanaka
- Tim ManganDec 01, 2019MVP
FredrikDahlberg I built some tooling to help with the Psf, but it only works for repackaging scenarios, not in package build projects.
There are lots of good online resources for PowerShell, and by now you've probably found a few. But if not, all you'd really need is enough PowerShell knowledge to have a ps1 file that runs a cmd.exe process with arguments "/c filename.cmd" and you can then have a cmd script instead. (Similarly if you prefer cscript you can start a cscript.exe command line).
Someday maybe I'll extend the Psf scripting to support directly specifying a cmd, cscript, or wscript file in addition to the ps1 filetype, but it isn't very high on my priority list.