Skip to content

Commit

Permalink
refs: #1
Browse files Browse the repository at this point in the history
  • Loading branch information
MiYABiS committed Jun 16, 2018
1 parent c0c3fac commit a61373d
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 24 deletions.
10 changes: 5 additions & 5 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<WordPublishLocation>$(ProjLocation)\WordTFSAddIn\$(ProjLocationReleaseDir)\bin\Release\app.publish</WordPublishLocation>
<SetupPublishLocation>$(ProjLocation)\SetupProject\$(ProjLocationReleaseDir)\bin\Release</SetupPublishLocation>
<DeploymentFolder>$(ProjLocation)\Publish\</DeploymentFolder>
<ExcelPublishVer>1.4.0.0</ExcelPublishVer>
<PowerPointPublishVer>1.4.0.0</PowerPointPublishVer>
<ProjectPublishVer>1.4.0.0</ProjectPublishVer>
<VisioPublishVer>1.4.0.0</VisioPublishVer>
<WordPublishVer>1.4.0.0</WordPublishVer>
<ExcelPublishVer>1.5.0.0</ExcelPublishVer>
<PowerPointPublishVer>1.5.0.0</PowerPointPublishVer>
<ProjectPublishVer>1.5.0.0</ProjectPublishVer>
<VisioPublishVer>1.5.0.0</VisioPublishVer>
<WordPublishVer>1.5.0.0</WordPublishVer>
</PropertyGroup>


Expand Down
1 change: 0 additions & 1 deletion ExcelTFSAddIn/ExcelTFSAddIn.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
<EmbeddedResource Include="TfsRibbon.resx">
<DependentUpon>TfsRibbon.vb</DependentUpon>
</EmbeddedResource>
<None Include="TFSAddinKey.pfx" />
<None Include="Key.snk" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
Expand Down
1 change: 0 additions & 1 deletion PowerPointTFSAddIn/PowerPointTFSAddIn.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
<DependentUpon>TfsRibbon.vb</DependentUpon>
</EmbeddedResource>
<None Include="Key.snk" />
<None Include="TFSAddinKey.pfx" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
</None>
Expand Down
1 change: 0 additions & 1 deletion ProjectTFSAddIn/ProjectTFSAddIn.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@
<DependentUpon>TfsRibbon.vb</DependentUpon>
</EmbeddedResource>
<None Include="Key.snk" />
<None Include="TFSAddinKey.pfx" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
</None>
Expand Down
2 changes: 1 addition & 1 deletion SetupProject/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?define ProductName = "MiYABiS MS Office TFS Addin"?>
<?define ProductCode = "99069A66-5896-454D-8D79-22BCFCF4BCBA"?>
<?define UpgradeCode = "9f5439f3-3cce-4252-80bc-9bf2ebb6a428"?>
<?define ProductVersion = "1.4.0.0"?>
<?define ProductVersion = "1.5.0.0"?>
<?define Manufacturer = "MiYABiS"?>

<Product Id="$(var.ProductCode)"
Expand Down
6 changes: 3 additions & 3 deletions TfCommand/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Imports System.Runtime.InteropServices
<Assembly: ComVisible(False)>

'このプロジェクトが COM に公開される場合、次の GUID がタイプ ライブラリの ID になります。
<Assembly: Guid("db7ed243-5425-4d10-8428-7fcc5d289650")>
<Assembly: Guid("db7ed243-5425-4d10-8428-7fcc5d289650")>

' アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
'
Expand All @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' 既定値にすることができます:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.1.0.0")>
<Assembly: AssemblyFileVersion("1.1.0.0")>
<Assembly: AssemblyVersion("1.2.0.0")>
<Assembly: AssemblyFileVersion("1.2.0.0")>
72 changes: 62 additions & 10 deletions TfCommand/TfExe.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Public Class TfExe

#Region " Declare "

Const C_TFEXE As String = "TF.exe"

Private _vsversion As Integer

Private tfExePath As String
Expand Down Expand Up @@ -375,9 +377,66 @@ Public Class TfExe
End Function

Private Sub _init()
Const C_TFEXE As String = "TF.exe"
Const C_VALUE As String = "InstallDir"

_searchTF2017()
_searchTFNo2017()

If String.IsNullOrEmpty(tfExePath) Then
Return
End If

tfExeInfo = New ProcessStartInfo()
tfExeInfo.LoadUserProfile = True
tfExeInfo.UseShellExecute = False
tfExeInfo.CreateNoWindow = True
tfExeInfo.RedirectStandardError = True
tfExeInfo.RedirectStandardOutput = True
tfExeInfo.FileName = tfExePath
End Sub

Private Sub _searchTF2017()
Const devenvPath As String = "Common7\IDE\"
Const tfPath As String = "CommonExtensions\Microsoft\TeamFoundation\Team Explorer\"
Dim vswhere As String
Dim vswhereOpt As String
Dim vsPath As String
Dim ps As New Process

vswhere = Environment.ExpandEnvironmentVariables("%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe")
If Not File.Exists(vswhere) Then
Return
End If

vswhereOpt = "-latest -products * -property installationPath"
ps.StartInfo.UseShellExecute = False
ps.StartInfo.RedirectStandardOutput = True
ps.StartInfo.RedirectStandardInput = False
ps.StartInfo.RedirectStandardError = True
ps.StartInfo.CreateNoWindow = True

ps.StartInfo.FileName = vswhere
ps.StartInfo.Arguments = vswhereOpt
If Not ps.Start() Then
Return
End If

vsPath = ps.StandardOutput.ReadToEnd().Replace(vbCrLf, String.Empty)
Me.InstallDir = Path.Combine(vsPath, devenvPath)
Dim wk As String = Path.Combine(Path.Combine(Me.InstallDir, tfPath), C_TFEXE)
If Not File.Exists(wk) Then
Return
End If

tfExePath = wk
End Sub

Private Sub _searchTFNo2017()
If Not String.IsNullOrEmpty(Me.InstallDir) Then
Return
End If

Dim vers() As Integer = {14, 12, 11, 10}
Const C_VALUE As String = "InstallDir"
Dim key As RegistryKey = Nothing
For Each ver As Integer In vers
key = Registry.CurrentUser.OpenSubKey(String.Format("Software\Microsoft\VisualStudio\{0}.0_Config", ver))
Expand All @@ -389,16 +448,9 @@ Public Class TfExe
If key Is Nothing Then
Return
End If

Me.InstallDir = key.GetValue(C_VALUE)
tfExePath = Path.Combine(Me.InstallDir, C_TFEXE)

tfExeInfo = New ProcessStartInfo()
tfExeInfo.LoadUserProfile = True
tfExeInfo.UseShellExecute = False
tfExeInfo.CreateNoWindow = True
tfExeInfo.RedirectStandardError = True
tfExeInfo.RedirectStandardOutput = True
tfExeInfo.FileName = tfExePath
End Sub

Private Function _commandExecute(ByVal args As String) As Boolean
Expand Down
1 change: 0 additions & 1 deletion VisioTFSAddIn/VisioTFSAddIn.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@
<DependentUpon>TfsRibbon.vb</DependentUpon>
</EmbeddedResource>
<None Include="Key.snk" />
<None Include="TFSAddinKey.pfx" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
</None>
Expand Down
1 change: 0 additions & 1 deletion WordTFSAddIn/WordTFSAddIn.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
<EmbeddedResource Include="TfsRibbon.resx">
<DependentUpon>TfsRibbon.vb</DependentUpon>
</EmbeddedResource>
<None Include="TFSAddinKey.pfx" />
<None Include="Key.snk" />
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.vb</DependentUpon>
Expand Down

0 comments on commit a61373d

Please sign in to comment.