From 02aed4b66f736ae0b78ba5971aa9f392749488e9 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 8 Apr 2010 14:55:51 +0200 Subject: [PATCH] [feature/webpi] Package files for Microsoft Web Platform Installer --- build/webpi/install/mssql.sql | 39 ++++++ build/webpi/install/mysql.sql | Bin 0 -> 732 bytes build/webpi/manifest.xml | 13 ++ build/webpi/parameters.xml | 226 ++++++++++++++++++++++++++++++++++ 4 files changed, 278 insertions(+) create mode 100644 build/webpi/install/mssql.sql create mode 100644 build/webpi/install/mysql.sql create mode 100644 build/webpi/manifest.xml create mode 100644 build/webpi/parameters.xml diff --git a/build/webpi/install/mssql.sql b/build/webpi/install/mssql.sql new file mode 100644 index 0000000000..390b4ffc02 --- /dev/null +++ b/build/webpi/install/mssql.sql @@ -0,0 +1,39 @@ +/**********************************************************************/ +/* Install.SQL */ +/* Creates a login and makes the user a member of db roles */ +/* */ +/**********************************************************************/ + +-- Declare variables for database name, username and password +DECLARE @dbName sysname, + @dbUser sysname, + @dbPwd nvarchar(max); + +-- Set variables for database name, username and password +SET @dbName = 'PlaceHolderForDb'; +SET @dbUser = 'PlaceHolderForUser'; +SET @dbPwd = 'PlaceHolderForPassword'; + +DECLARE @cmd nvarchar(max) + +-- Create login +IF( SUSER_SID(@dbUser) is null ) +BEGIN + print '-- Creating login ' + SET @cmd = N'CREATE LOGIN ' + quotename(@dbUser) + N' WITH PASSWORD ='''+ replace(@dbPwd, '''', '''''') + N'''' + EXEC(@cmd) +END + +-- Create database user and map to login +-- and add user to the datareader, datawriter, ddladmin and securityadmin roles +-- +SET @cmd = N'USE ' + quotename(@DBName) + N'; +IF( NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' + replace(@dbUser, '''', '''''') + N''')) +BEGIN + print ''-- Creating user''; + CREATE USER ' + quotename(@dbUser) + N' FOR LOGIN ' + quotename(@dbUser) + N'; + print ''-- Adding user''; + EXEC sp_addrolemember ''db_owner'', ''' + replace(@dbUser, '''', '''''') + N'''; +END' +EXEC(@cmd) +GO diff --git a/build/webpi/install/mysql.sql b/build/webpi/install/mysql.sql new file mode 100644 index 0000000000000000000000000000000000000000..ca9d1b2f839525829b8dd7338e6f6536c499a0b4 GIT binary patch literal 732 zcmb`FOH0F05QWcL@ITyz5Oq-$+_`B?ng@ioG>Pa+)VLFbw(7rEzqvQ4wWZm}Fv%p$ zIdkUm`O&J@L{4)(>t2s~QlS^(j%cZjc&StmI>HWh;62qsGZ2QdD1jkWOKeOfC`WWd zRI9-q%pG>8SFJp++u%z)GA1`D+2;Ick!CRuoe9vvy7B?^9KQHSG^owa? literal 0 HcmV?d00001 diff --git a/build/webpi/manifest.xml b/build/webpi/manifest.xml new file mode 100644 index 0000000000..1ecae7bae6 --- /dev/null +++ b/build/webpi/manifest.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/webpi/parameters.xml b/build/webpi/parameters.xml new file mode 100644 index 0000000000..03d269f3eb --- /dev/null +++ b/build/webpi/parameters.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file