By default. SIF installs Sitecore in “<SystemDrive>\inetpub\wwwroot\<SiteName>”.  That’s not ideal for me, as I don’t put any real data on my C drive. It all goes on my D drive.  How can we fix this?  We’ll need to make one change to two different files.

In either sitecore-XP0.json or xconnect-xp0.json, look for the following line:

// The sites full path on disk
"Site.PhysicalPath": "[joinpath(environment('SystemDrive'), 'inetpub', 'wwwroot', parameter('SiteName'))]",

This essentially hard-codes the path.   We can fix that though, and it’s not too complex.  First step will be to add a new parameter to the file:

"InstallDirectory": {
    "Type": "string",
    "Description": "The install diectory for the site."
}

Now we can use that parameter in the variable declaration:

 

// The sites full path on disk
"Site.PhysicalPath": "[joinpath(parameter('InstallDirectory'), parameter('SiteName'))]",

That’s it.  You’ll have to make that change to both sitecore-xp0.json and xconnect-xp0.json.  When you run the install with the “-InstallDirectory <YourPath>”, you’ll see the sites created in the desired path.

If you’re not feeling up to making these mods, you can grab the modified copies here.