Skip to content

Commit a2b5b76

Browse files
committed
Merge branch 'dev'
2 parents 540e9e0 + 1f0eb66 commit a2b5b76

File tree

6 files changed

+46
-20
lines changed

6 files changed

+46
-20
lines changed

Installer/AddInReg.wxs

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
</Class>
1212
<File Id="fil4320846A83E1D6A9BFA99753384C2099" KeyPath="yes" Source="$(var.SourceOutDir)\CodeStack.Sw.MyToolbar.dll" />
1313
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
14-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
15-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
16-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
17-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
14+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
15+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
16+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
17+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
1818
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
19-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
19+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
2020
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
2121
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
2222
</Component>

Installer/Addin11.wxs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33
<Fragment>
44
<DirectoryRef Id="INSTALLFOLDER">
5-
<Component Id="cmp88292F68F35EB8F79623221F5580BB75" Guid="{58ACFA48-9D5F-4FD8-B5B8-ABEB3ED83825}">
5+
<Component Id="cmp88292F68F35EB8F79623221F5580BB75" Guid="{0E132737-CABA-4F85-9841-A71208CDBF12}">
66
<Class Id="{63496B16-E9AD-4D3A-8473-99D124A1672B}" Context="InprocServer32" Description="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" ThreadingModel="both" ForeignServer="mscoree.dll">
77
<ProgId Id="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Description="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" />
88
</Class>
99
<File Id="fil4320846A83E1D6A9BFA99753384C2099" KeyPath="yes" Source="$(var.SourceOutDir)\CodeStack.Sw.MyToolbar.dll" />
1010
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
11-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
12-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
13-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
14-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.0.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
11+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
12+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
13+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
14+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32\2.1.0.0" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
1515
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Class" Value="CodeStack.Sw.MyToolbar.MyToolbarSwAddin" Type="string" Action="write" />
16-
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
16+
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="Assembly" Value="CodeStack.Sw.MyToolbar, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
1717
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
1818
<RegistryValue Root="HKCR" Key="CLSID\{63496B16-E9AD-4D3A-8473-99D124A1672B}\InprocServer32" Name="CodeBase" Value="file:///[#fil4320846A83E1D6A9BFA99753384C2099]" Type="string" Action="write" />
1919
</Component>

Installer/Product.wxs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Name="MyToolbar" Language="1033" Version="2.0.0.0" Manufacturer="CodeStack" UpgradeCode="{61EB1313-A362-41AC-A3D5-F50D43CE74D8}">
3+
<Product Id="*" Name="MyToolbar" Language="1033" Version="2.1.0.0" Manufacturer="CodeStack" UpgradeCode="{61EB1313-A362-41AC-A3D5-F50D43CE74D8}">
44
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
55

66
<MajorUpgrade DowngradeErrorMessage="A newer version of MyToolbar is already installed." />

MyToolbar/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
[assembly: AssemblyCopyright("Copyright(C) 2019 www.codestack.net")]
2121
[assembly: AssemblyTrademark("")]
2222
[assembly: AssemblyCulture("")]
23-
[assembly: AssemblyVersion("2.0.0.0")]
23+
[assembly: AssemblyVersion("2.1.0.0")]
2424
[assembly: AssemblyDelaySign(false)]
2525
[assembly: AssemblyKeyFile("")]
2626
[assembly: AssemblyKeyName("")]
27-
[assembly: AssemblyFileVersion("2.0.0.0")]
27+
[assembly: AssemblyFileVersion("2.1.0.0")]
2828
[assembly: ComVisible(false)]
2929
[assembly: ApplicationInfo(typeof(AppInfo),
3030
nameof(AppInfo.WorkingDir), nameof(AppInfo.Title), nameof(AppInfo.Icon))]

MyToolbar/Services/MacroEntryPointsExtractor.cs

+24-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System.Collections.Generic;
1212
using System.Linq;
1313
using System;
14+
using System.IO;
1415

1516
namespace CodeStack.Sw.MyToolbar.Services
1617
{
@@ -47,6 +48,8 @@ public int Compare(MacroEntryPoint x, MacroEntryPoint y)
4748
}
4849
}
4950

51+
private const string VSTA_FILE_EXT = ".dll";
52+
5053
private readonly ISldWorks m_App;
5154

5255
public MacroEntryPointsExtractor(ISldWorks app)
@@ -63,16 +66,32 @@ public MacroEntryPoint[] GetEntryPoints(string macroPath)
6366
{
6467
return methods.Select(m =>
6568
{
66-
var ep = m.Split('.');
67-
return new MacroEntryPoint()
69+
if (IsVstaMacro(macroPath))
70+
{
71+
return new MacroEntryPoint()
72+
{
73+
SubName = m
74+
};
75+
}
76+
else
6877
{
69-
ModuleName = ep[0],
70-
SubName = ep[1]
71-
};
78+
var ep = m.Split('.');
79+
return new MacroEntryPoint()
80+
{
81+
ModuleName = ep[0],
82+
SubName = ep[1]
83+
};
84+
}
7285
}).OrderBy(e => e, new EntryPointComparer()).ToArray();
7386
}
7487

7588
return null;
7689
}
90+
91+
public bool IsVstaMacro(string macroPath)
92+
{
93+
return Path.GetExtension(macroPath).Equals(VSTA_FILE_EXT,
94+
StringComparison.CurrentCultureIgnoreCase);
95+
}
7796
}
7897
}

MyToolbar/Structs/MacroEntryPoint.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ public override int GetHashCode()
5858

5959
public override string ToString()
6060
{
61-
return $"{ModuleName}.{SubName}";
61+
if (!string.IsNullOrEmpty(ModuleName))
62+
{
63+
return $"{ModuleName}.{SubName}";
64+
}
65+
else
66+
{
67+
return SubName;
68+
}
6269
}
6370
}
6471
}

0 commit comments

Comments
 (0)