Creating database with a relative path I am supposed to be testing a piece of software that uses mssql express as the backend for data storage. When it is creating its databases, it tries to create them in my home directory that is on a network share, which does not work. I.e. it does

create database [db] on primary (name=N'db' filename=N'g:\my docs\app\db\db.mdf' ...


and a bunch more of parameters.

I tried to disconnect the computer from the network, then it tried to run

create database [db] on primary (name=N'db' filename=N'\app\db\db.mdf' ...


which also did not work. 

Basically my question is then: How can I convince mssql express to use another base directory when creating new files?
The software installer is reading the %userprofile% or %homepath% environment variables to create the user database, you will have to change the installation script or temporary change the environment variables while running the installer. 

This has nothing to do with Express itself as it is creating the databases where it's asked to do so by the installation script. 
Now if you want to have the database in the home directory you are better off by using SQL Server Express LocalDB. I would consider this software a failure.