SQLSetupTool

Installation Flow &
Project Structure

Fully automatic SQL Server deployment - from start to a finished instance

PowerShell 5.1 WinForms GUI 18 PostInstall steps Domain-aware Ola Maintenance
Overview

7 Phases - From Start to Operation

1
Start & load configuration

Read settings.ini, detect the domain, validate source paths

2
GUI opens

Version, edition, instance name, port, disk layout, optional components

3
User input

Check the AD account, calculate the TCP port automatically, choose the collation

4
Copy sources

SQL installation sources from the SourceShare to a local drive

5
PreInstall checks

4 checks: instance conflict, 64K NTFS, snapshot reminder, HPU AD group

6
Installation

SQL Server + optional components (SSRS, SSAS, SSMS, SSIS, TDP) + drivers

7
PostInstall - 18 steps

Memory, MAXDOP, TempDB, Ola Maintenance, Splunk, SQL scripts, report

Phase 1 & 2

Start, Configuration & GUI

Loading the configuration

  • Read settings.ini
  • Detect domain → Config\domains\<DOMAIN>.ini
  • Fallback: DEFAULT.ini
  • Collation list from collations.txt
  • Validate all source paths
Domain profiles Each domain has its own defaults: disk layout, sysadmin groups, collation, ports

GUI elements

  • Version → from [Versions] Available
  • Edition → Standard / Developer / SQL2025
  • TCP port → BasePort + (instance number x increment)
  • Disk layout → domain-specific
  • Optional components → only active when _Enabled=true AND the source is reachable
  • Drivers JDBC / ODBC / DB2 → with a version check
Phase 5

PreInstall Checks

#CheckBehaviorControl
1 SQL instance already installed? Warning + Yes/No dialog - No = abort always active
2 NTFS 64K block size Every SQL drive checked - offers to format on mismatch Format64kCheck
3 Snapshot reminder Info dialog - create a snapshot manually, then OK SnapshotEnabled
4 HPU AD group membership Get-sqmHpuAllowGroup → ADSI check - not a member = abort HpuCheck
Every check is configurable [PreInstall] in settings.ini - each check individually controlled via true/false
Phase 6

Installation

6.1 SQL Server

  • Features from [Installation] Features
  • Product key from [SerialNumbers]
  • TempDB: file size & growth configurable
  • TCP / named pipes / browser from the INI
  • Service account from the GUI (optional)

6.2 Optional Components

  • SSRS, SSAS, SSMS, SSIS, TDP
  • Each installed only if its checkbox is active

6.3 Drivers with Version Comparison

JDBC / ODBC / DB2

Installed version vs. source version (VersionInfo / filename regex)

Test-sqmDriverInstalled
Older?
Yes/No dialog
  • Yes: uninstall + install fresh
  • No: skip
  • Same/newer: "OK: current (vX.X)"
Phase 7

PostInstall - 18 Steps

#Step
1Set NTFS permissions
2Max server memory (90% RAM)
2aMAXDOP, cost threshold, ad-hoc
2bConfigure the TCP port
3SQL Agent autostart
4Optimize TempDB (CPU-based, max 8)
5Recovery model FULL
6Disable the SQL Browser
7Assign sysadmin groups
#Step
8SA obfuscation
9Monitoring key in the registry
10Instance validation (best practice)
11Custom PostInstall script
12Ola Maintenance Solution
13Ola jobs (index, integrity)
14SysDB backup job
15User DB backup jobs (FULL/DIFF/LOG)
16Configure the Splunk forwarder
17Run company SQL scripts
18Create the setup report
Project Structure

Directory Structure - Root & Config

SQLSetupTool\ Main.ps1 # Entry point Start-SQLSetupTool.cmd # Starts as admin settings.ini # Main configuration collations.txt # Collations Start-AdminConfig.ps1 # Admin config form Start-DomainConfig.ps1 # Domain config form   Config\ settings.ini # Global defaults collations.txt domains\ DEFAULT.ini # Fallback profile CONTOSO.ini # Domain profile HLB.ini

settings.ini - Key Sections

  • [General] — SourceShare, instance name, paths
  • [Versions] — Available: 2019, 2022, 2025
  • [Editions] — Standard / Developer
  • [Ports] — BasePort, PortIncrement
  • [DiskLayout_Standard] — drive letters
  • [PreInstall] — Format64kCheck, Snapshot, HpuCheck
  • [Installation] — Features, TempDB parameters
  • [Drivers] — JDBC/ODBC/DB2 Enabled + SourcePath
  • [PostInstall] — Splunk, SqlScriptsPath
  • [Monitoring] — MonitoringEnabled, type
  • [SerialNumbers] — product keys per version/edition
  • [SysadminGroups] — Standard + Domain_<NAME>
Project Structure

Directory Structure - Modules & GUI

Modules\ — Business Logic

Modules\ Config.psm1 # Load INI, config object CopySource.psm1 # Sources to local disk DiskLayout.psm1 # Drives + 64K check Installation.psm1 # SQL Server Setup.exe PreInstall.psm1 # 4 PreInstall checks PostInstall.psm1 # 18 PostInstall steps Drivers.psm1 # JDBC/ODBC/DB2 + upgrade DbaToolsSetup.psm1# dbatools installation Validation.psm1 # Best-practice checks

GUI\ — WinForms Interface

GUI\ MainForm.ps1 # Main setup dialog ConfigForm.ps1 # Admin configuration DomainConfigForm.ps1# Domain profiles

Scripts\

Scripts\ New-SqlSourceStructure.ps1 PostInstall.ps1
Clean separation The GUI layer calls the modules - no business logic in forms, no GUI code in modules
Driver Management

Intelligent Version Comparison

Flow for every driver

1
Installed?

Test-sqmDriverInstalled -DriverType ODBC|JDBC|DB2

2
Determine the source version

ODBC/DB2: VersionInfo from MSI/EXE - JDBC: regex from the filename

3
Comparison

[System.Version] comparison: source newer → dialog

4
Upgrade or skip

Yes: Uninstall-sqm*Driver → Install-sqm*Driver

Three Uninstall Functions

Uninstall-sqmOdbcDriver

ProductCode from the registry → msiexec /x {GUID} /quiet

Uninstall-sqmJdbcDriver

Deletes mssql-jdbc*.jar from %ProgramFiles% - no MSI

Uninstall-sqmDb2Driver

Registry MSI or Setup.exe /silent /uninstall

All three return Status: Uninstalled | NotFound | Error
Configuration

Domain Profiles - Environment Flexibility

How it works

  • The tool detects the domain automatically at startup
  • Loads Config\domains\<DOMAIN>.ini
  • Fallback: DEFAULT.ini if no profile exists
  • The domain profile overrides the global settings.ini
New environment = new .ini file No code change needed - just create a new domain profile

Domain-Specific Settings

ParameterExample
Disk layoutD: E: F: G: H:
Sysadmin groupsDOMAIN\SQL-Admins
CollationLatin1_General_CI_AS
BasePort1433, 1450, 1470
SourceShare\\Server\SQL-Sources
Monitoring typeSplunk | TSM
Quick Reference

Key Entry Points

Start

Start-SQLSetupTool.cmd
# starts as admin
# loads settings.ini
# opens MainForm
Start-AdminConfig.cmd
# global configuration
# ConfigForm.ps1

Configure

Start-DomainConfig.cmd
# maintain the domain profile
# DomainConfigForm.ps1
# New domain profile:
Config\domains\
  MYDOMAIN.ini

Logs & Report

# Setup report after
# step 18 as HTML
# in the temp directory
# opened automatically
Troubleshooting Every module logs to the GUI output via LogCallback
Summary

SQLSetupTool - What It Delivers

Standardization

  • No manual clicking through the SQL Setup wizard
  • The same configuration on every server
  • Best-practice settings from the start
  • MAXDOP, memory, TempDB - automatically correct
  • Ola Maintenance built in directly

Flexibility

  • Any number of domain profiles
  • Optional components individually controllable
  • Drivers with automatic version upgrade
  • Custom PostInstall scripts can be plugged in
  • Monitoring integration (Splunk, TSM)
Result A fully configured, production-ready SQL Server instance - reproducible, documented, in under 30 minutes.