Skip to content

Commit 862e722

Browse files
authored
Merge pull request #4525 from bclothier/FixDeployment
Deployment bug fixes
2 parents f9881bc + bbfce56 commit 862e722

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Rubberduck.Deployment/BuildRegistryScript.ps1

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,31 @@ try
113113
if(!$result)
114114
{
115115
Write-Warning "VSSetup not installed; extracting...";
116-
Expand-Archive "$projectDir\OleWoo\VSSetup.zip" "$([Environment]::GetFolderPath("MyDocuments"))\WindowsPowerShell\Modules\VSSetup" -Force
116+
$moduleDirPath = "$([Environment]::GetFolderPath("MyDocuments"))\WindowsPowerShell";
117+
if(!(Test-Path -Path $moduleDirPath -PathType Container))
118+
{
119+
Write-Warning "WindowsPowerShell directory not found in user's documents. Creating.";
120+
New-Item -Path $moduleDirPath -ItemType Directory;
121+
}
122+
$moduleDirPath += "\Modules";
123+
if(!(Test-Path -Path $moduleDirPath -PathType Container))
124+
{
125+
Write-Warning "WindowsPowerShell\Modules directory not found in user's documents. Creating.";
126+
New-Item -Path $moduleDirPath -ItemType Directory;
127+
}
128+
$moduleDirPath += "\VSSetup";
129+
if(!(Test-Path -Path $moduleDirPath -PathType Container))
130+
{
131+
Write-Warning "WindowsPowerShell\Modules\VSSetup directory not found in user's documents. Creating.";
132+
New-Item -Path $moduleDirPath -ItemType Directory;
133+
}
134+
# Sanity check
135+
if(!(Test-Path -Path $moduleDirPath -PathType Container))
136+
{
137+
Write-Error "WindowsPowerShell\Modules\VSSetup directory still not found in user's documents after attempt to create it. Cannot continue";
138+
throw [System.IO.DirectoryNotFoundException] "Cannot create or locate the directory at path '$moduleDirPath'";
139+
}
140+
Expand-Archive "$projectDir\OleWoo\VSSetup.zip" $moduleDirPath -Force;
117141
}
118142

119143
try {

Rubberduck.Deployment/IdlGeneration/IdlGenerator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public string GenerateIdl(Assembly assembly)
3939
var owLib = new OWTypeLib(lib);
4040
owLib.Listeners.Add(new IdlListener());
4141

42+
formatter.AddString("midl_pragma warning( disable: 2400 2401 ) ");
43+
formatter.NewLine();
44+
4245
owLib.BuildIDLInto(formatter);
4346
return formatter.ToString();
4447
}

0 commit comments

Comments
 (0)