File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 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 {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments