Skip to content

Commit

Permalink
- further obfuscated email in test script
Browse files Browse the repository at this point in the history
- added test script back in without my email in it
- modified email address to fake email
- updated generate setup script to scan for certain file types to add to the release
- added intall bat, and install.ps1 to ease intall / reinstall
  • Loading branch information
tcartwright committed Sep 4, 2021
1 parent 7026259 commit 70a3b0e
Show file tree
Hide file tree
Showing 8 changed files with 384 additions and 17 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/generate_setup_script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ Write-Output "Get contents of $binaryPath as binary string, now that it is signe
$clrBinString = FileToBinString -fileName $binaryPath

$setupSql = @"
:setvar DatabaseName "$databaseName"
USE master
GO
IF DB_ID('$databaseName') IS NULL BEGIN
CREATE DATABASE [$databaseName] -- create the database with all of the default options
END
GO
IF NOT EXISTS (SELECT * FROM sys.certificates c WHERE c.name = 'SQLServerClrCert') BEGIN
RAISERROR( 'CREATE CERTIFICATE [SQLServerClrCert]', 0, 1) WITH NOWAIT
Expand Down Expand Up @@ -139,15 +133,18 @@ $script = $script -ireplace "CREATE\s+ASSEMBLY\s+(\[.*?\])[\w\W]*?GO", "CREATE A
Write-Output "Remove the alter assembly statement. Not needed and only bloats the script"
$script = $script -ireplace "ALTER\s+ASSEMBLY[\w\W]*?GO", ""

$configuration = "2012_and_lower"
$configuration = "2012-and-lower"
if ($rootPath -imatch "4.5") {
$configuration = "2014_and_greater"
$configuration = "2014-and-greater"
}

Write-Output "Set up script written to '$rootPath\$databaseName-$configuration-setup.sql'"
[System.IO.File]::WriteAllText("$rootPath\$databaseName-$configuration-setup.sql", "$setupSql`r`n$script")

Write-Output "Creating release zip to $releasePath"
Get-ChildItem $rootPath | Compress-Archive -Destination "$releasePath" -CompressionLevel Optimal -Update
$types = ".bat", ".ps1", ".sql"
Get-ChildItem $rootPath `
| Where-Object { $types -icontains [System.IO.Path]::GetExtension($_.FullName) } `
| Compress-Archive -Destination "$releasePath" -CompressionLevel Optimal -Update

popd
popd
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,5 @@ ASALocalRun/
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/
.mfractor/
/package-lock.json
15 changes: 13 additions & 2 deletions SqlServer.ClrCommon.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
# Visual Studio Version 16
VisualStudioVersion = 16.0.31605.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SqlServer.ClrCommon", "SqlServer.ClrCommon\SqlServer.ClrCommon.sqlproj", "{80F6878B-B3C3-4E1D-B535-892CA26C9EB4}"
EndProject
Expand All @@ -19,6 +19,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Readme - How To Target Multiple .Net Frameworks.txt = Readme - How To Target Multiple .Net Frameworks.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{72F276AF-0231-46F0-8FEA-5B775F445671}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{42E4C412-5AF0-4169-9202-6BD2FB942E20}"
ProjectSection(SolutionItems) = preProject
.github\workflows\generate_setup_script.ps1 = .github\workflows\generate_setup_script.ps1
.github\workflows\pipeline.yml = .github\workflows\pipeline.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,6 +59,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{42E4C412-5AF0-4169-9202-6BD2FB942E20} = {72F276AF-0231-46F0-8FEA-5B775F445671}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94F2A7F4-BF59-41DB-B2BB-D76BCE698997}
EndGlobalSection
Expand Down
Binary file added SqlServer.ClrCommon/Install.bat
Binary file not shown.
Binary file added SqlServer.ClrCommon/Install.ps1
Binary file not shown.
22 changes: 18 additions & 4 deletions SqlServer.ClrCommon/SqlServer.ClrCommon.sqlproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<Folder Include="cmn\Tables\" />
<Folder Include="cmn\Functions\" />
<Folder Include="Security\" />
<Folder Include="Readmes" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -137,12 +138,20 @@
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
<None Include="TestScript.sql" />
<None Include="Help\SqlServer.ClrCommon.shfbproj" />
<None Include="Readme - How To Target Multiple .Net Frameworks.txt" />
<None Include="Readme - How to generate the Create Assembly script.txt" />
<None Include="Readme - How to DEBUG.txt" />
<None Include="SqlServer.ClrCommon.publish.xml" />
<None Include="Readmes\Readme - How to DEBUG.txt" />
<None Include="Readmes\Readme - How To Target Multiple .Net Frameworks.txt" />
<None Include="Readmes\Readme - How to generate the Create Assembly script.txt" />
<None Include="Install.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Install.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="TestScript.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="DebugScript.sql" />
Expand All @@ -155,6 +164,11 @@
<Build Include="Security\cmn.sql" />
<Build Include="Security\clr.sql" />
</ItemGroup>
<ItemGroup>
<None Include="setup-start.sql">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
Expand Down
Loading

0 comments on commit 70a3b0e

Please sign in to comment.