├── .gitattributes ├── .gitignore ├── Build └── BuildInstaller.cmd ├── LICENSE ├── README.md └── Source ├── AddInManager.sln ├── ExcelDna.AddInManager.Common ├── AddInFile.cs ├── Bitness.cs ├── ExcelDna.AddInManager.Common.csproj ├── Utils.cs └── XmlSerializer.cs ├── ExcelDna.AddInManager.IndexGenerator ├── ExcelDna.AddInManager.IndexGenerator.csproj └── Program.cs ├── ExcelDna.AddInManager ├── AddInVersionInfo.cs ├── AddInsSource.cs ├── Controller.cs ├── Dialogs │ ├── AddInsListView.xaml │ ├── AddInsListView.xaml.cs │ ├── InstallDialog.xaml │ ├── InstallDialog.xaml.cs │ ├── ManageDialog.xaml │ ├── ManageDialog.xaml.cs │ ├── OptionsDialog.xaml │ └── OptionsDialog.xaml.cs ├── ExcelDna.AddInManager.csproj ├── ExceptionHandler.cs ├── GeneralOptions.cs ├── MainAddIn.cs ├── Ribbon.cs ├── RibbonResources.Designer.cs ├── RibbonResources.resx ├── RibbonResources │ ├── Image1.png │ └── Ribbon.xml └── Storage.cs └── Installer ├── ExcelAddInDeploy ├── CustomMessages.wxl ├── EnglishLoc.wxl ├── ExcelAddInDeploy.wixproj ├── Product.wxs └── Resources │ ├── Banner.jpg │ ├── Dialog.jpg │ ├── EULA.rtf │ └── Icon.ico ├── Installer.sln ├── InstallerCA ├── ClosePromptForm.cs ├── ClosePromptForm.designer.cs ├── CustomAction.config ├── CustomAction.cs ├── InstallerCA.csproj ├── InstallerClass.Designer.cs ├── InstallerClass.cs ├── PromptCloseApplication.cs ├── Properties │ └── AssemblyInfo.cs └── WindowWrapper.cs └── WiRunSQL.vbs /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | 254 | # Task Canvas 255 | *.TaskCanvasSL 256 | 257 | # Tabs Studio 258 | *.marker.tss 259 | 260 | /Source/ExcelDna.AddInManager/Properties/launchSettings.json 261 | /Source/ExcelDna.AddInManager.IndexGenerator/Properties/launchSettings.json 262 | /Source/Installer/ExcelAddInDeploy/SourceFiles 263 | -------------------------------------------------------------------------------- /Build/BuildInstaller.cmd: -------------------------------------------------------------------------------- 1 | setlocal 2 | 3 | set MSBuildPath="c:\Program Files\Microsoft Visual Studio\2022\Preview\Msbuild\Current\Bin\amd64\MSBuild.exe" 4 | set OutFileName=ExcelDna.AddInManager.msi 5 | 6 | del /q %OutFileName% 7 | 8 | %MSBuildPath% ..\Source\AddInManager.sln /t:restore,build /p:Configuration=Release 9 | @if errorlevel 1 goto end 10 | 11 | xcopy ..\Source\ExcelDna.AddInManager\bin\Release\net6.0-windows\publish ..\Source\Installer\ExcelAddInDeploy\SourceFiles /I /Y 12 | 13 | "c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" ..\Source\Installer\Installer.sln /t:Rebuild /p:Configuration=Release 14 | @if errorlevel 1 goto end 15 | 16 | copy "..\Source\Installer\ExcelAddInDeploy\bin\Release\en-us\ExcelAddInDeploy.msi" %OutFileName% 17 | 18 | :end 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Excel-DNA 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AddInManager 2 | The _Excel-DNA Add-In Manager_ assists in distributing and managing Excel add-ins. 3 | 4 | ![image](https://github.com/Excel-DNA/AddInManager/assets/414659/23ad51d8-9915-4d88-a9cb-e74ccce1c7aa) 5 | 6 | -------------------------------------------------------------------------------- /Source/AddInManager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33006.217 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExcelDna.AddInManager", "ExcelDna.AddInManager\ExcelDna.AddInManager.csproj", "{CE907517-6F55-49EC-A6CE-BB614C292CF1}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelDna.AddInManager.IndexGenerator", "ExcelDna.AddInManager.IndexGenerator\ExcelDna.AddInManager.IndexGenerator.csproj", "{598D30ED-1525-45C5-81D6-4A26AFAC1CAA}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelDna.AddInManager.Common", "ExcelDna.AddInManager.Common\ExcelDna.AddInManager.Common.csproj", "{AF852BE1-3522-4EB5-B546-50F412A17EE9}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {CE907517-6F55-49EC-A6CE-BB614C292CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {CE907517-6F55-49EC-A6CE-BB614C292CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {CE907517-6F55-49EC-A6CE-BB614C292CF1}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {CE907517-6F55-49EC-A6CE-BB614C292CF1}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {598D30ED-1525-45C5-81D6-4A26AFAC1CAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {598D30ED-1525-45C5-81D6-4A26AFAC1CAA}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {598D30ED-1525-45C5-81D6-4A26AFAC1CAA}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {598D30ED-1525-45C5-81D6-4A26AFAC1CAA}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {AF852BE1-3522-4EB5-B546-50F412A17EE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {AF852BE1-3522-4EB5-B546-50F412A17EE9}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {AF852BE1-3522-4EB5-B546-50F412A17EE9}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {AF852BE1-3522-4EB5-B546-50F412A17EE9}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {6F72F8CC-8B73-4E05-90AD-A99783DCDBF2} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.Common/AddInFile.cs: -------------------------------------------------------------------------------- 1 | namespace ExcelDna.AddInManager.Common 2 | { 3 | public class AddInFile 4 | { 5 | public string? FileName; 6 | public string? CompanyName; 7 | public string? ProductName; 8 | public string? Version; 9 | public Bitness Bitness; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.Common/Bitness.cs: -------------------------------------------------------------------------------- 1 | namespace ExcelDna.AddInManager.Common 2 | { 3 | public enum Bitness 4 | { 5 | Unknown = 0, 6 | Bit32 = 32, 7 | Bit64 = 64, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.Common/ExcelDna.AddInManager.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0-windows 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.Common/Utils.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace ExcelDna.AddInManager.Common 4 | { 5 | public class Utils 6 | { 7 | public const string IndexFileName = "index.xml"; 8 | 9 | public static List GetSourceAddins(string sourcePath) 10 | { 11 | List addins = new(); 12 | if (Directory.Exists(sourcePath)) 13 | addins.AddRange(Directory.GetFiles(sourcePath, "*.xll").Select(i => GetAddInInfo(i))); 14 | 15 | return addins; 16 | } 17 | 18 | public static AddInFile GetAddInInfo(string path) 19 | { 20 | AddInFile result = new(); 21 | result.FileName = Path.GetFileName(path); 22 | 23 | FileVersionInfo version = FileVersionInfo.GetVersionInfo(path); 24 | result.CompanyName = version.CompanyName; 25 | result.ProductName = version.ProductName; 26 | result.Version = version.FileVersion; 27 | 28 | if (result.ProductName == "Excel-DNA Add-In Framework for Microsoft Excel" && result.CompanyName == "Govert van Drimmelen") 29 | { 30 | result.CompanyName = null; 31 | result.ProductName = null; 32 | result.Version = null; 33 | } 34 | 35 | if (TryFindBitness(path, out Bitness bitness)) 36 | result.Bitness = bitness; 37 | 38 | return result; 39 | } 40 | 41 | private static bool TryFindBitness(string exePath, out Bitness bitness) 42 | { 43 | bitness = Bitness.Unknown; 44 | 45 | try 46 | { 47 | using (var fileStream = File.OpenRead(exePath)) 48 | { 49 | using (var reader = new BinaryReader(fileStream)) 50 | { 51 | // See http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx 52 | // Offset to PE header is always at 0x3C. 53 | // The PE header starts with "PE\0\0" = 0x50 0x45 0x00 0x00, 54 | // followed by a 2-byte machine type field (see the document above for the enum). 55 | 56 | fileStream.Seek(0x3c, SeekOrigin.Begin); 57 | var peOffset = reader.ReadInt32(); 58 | 59 | fileStream.Seek(peOffset, SeekOrigin.Begin); 60 | var peHead = reader.ReadUInt32(); 61 | 62 | if (peHead != 0x00004550) // "PE\0\0", little-endian 63 | { 64 | return false; 65 | } 66 | 67 | var machineType = (MachineType)reader.ReadUInt16(); 68 | 69 | switch (machineType) 70 | { 71 | case MachineType.ImageFileMachineI386: 72 | { 73 | bitness = Bitness.Bit32; 74 | return true; 75 | } 76 | case MachineType.ImageFileMachineAmd64: 77 | case MachineType.ImageFileMachineIa64: 78 | { 79 | bitness = Bitness.Bit64; 80 | return true; 81 | } 82 | default: 83 | { 84 | bitness = Bitness.Unknown; 85 | return false; 86 | } 87 | } 88 | } 89 | } 90 | } 91 | catch 92 | { 93 | } 94 | 95 | return false; 96 | } 97 | 98 | private enum MachineType : ushort 99 | { 100 | ImageFileMachineAmd64 = 0x8664, 101 | ImageFileMachineI386 = 0x14c, 102 | ImageFileMachineIa64 = 0x200, 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.Common/XmlSerializer.cs: -------------------------------------------------------------------------------- 1 | namespace ExcelDna.AddInManager.Common 2 | { 3 | public class XmlSerializer 4 | { 5 | /// 6 | public static void XmlSerialize(string file, T o) 7 | { 8 | try 9 | { 10 | System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings(); 11 | settings.Indent = true; 12 | using (System.Xml.XmlWriter stream = System.Xml.XmlWriter.Create(file, settings)) 13 | { 14 | CreateSerializer().Serialize(stream, o); 15 | } 16 | } 17 | catch (Exception e) 18 | { 19 | throw new ApplicationException(e.Message); 20 | } 21 | } 22 | 23 | /// 24 | public static T XmlDeserialize(string file) 25 | { 26 | try 27 | { 28 | using (System.Xml.XmlReader stream = System.Xml.XmlReader.Create(file)) 29 | { 30 | return (T)CreateSerializer().Deserialize(stream)!; 31 | } 32 | } 33 | catch (Exception e) 34 | { 35 | throw new ApplicationException(e.Message); 36 | } 37 | } 38 | 39 | private static System.Xml.Serialization.XmlSerializer CreateSerializer() 40 | { 41 | return new System.Xml.Serialization.XmlSerializer(typeof(T)); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.IndexGenerator/ExcelDna.AddInManager.IndexGenerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0-windows 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager.IndexGenerator/Program.cs: -------------------------------------------------------------------------------- 1 | using ExcelDna.AddInManager.Common; 2 | 3 | namespace ExcelDna.AddInManager.IndexGenerator 4 | { 5 | internal class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | if (args.Length != 1 || !Directory.Exists(args[0])) 10 | { 11 | Console.WriteLine("Usage: ExcelDna.AddInManager.IndexGenerator.exe [Add-Ins Source Path]"); 12 | return; 13 | } 14 | 15 | string sourcePath = args[0]; 16 | List addins = Utils.GetSourceAddins(sourcePath); 17 | 18 | string indexFile = Path.Combine(sourcePath, Utils.IndexFileName); 19 | XmlSerializer.XmlSerialize(indexFile, addins); 20 | 21 | Console.WriteLine("Generated " + indexFile); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/AddInVersionInfo.cs: -------------------------------------------------------------------------------- 1 | using ExcelDna.AddInManager.Common; 2 | 3 | namespace ExcelDna.AddInManager 4 | { 5 | internal class AddInVersionInfo 6 | { 7 | public AddInVersionInfo(string path) : this(Utils.GetAddInInfo(path), path, null) 8 | { 9 | } 10 | 11 | public AddInVersionInfo(string sourceDirectory, AddInFile addInFile) : this(addInFile, System.IO.Path.Combine(sourceDirectory, addInFile.FileName ?? string.Empty), null) 12 | { 13 | } 14 | 15 | public AddInVersionInfo(Uri sourceDirectory, AddInFile addInFile) : this(addInFile, null, new Uri(sourceDirectory, addInFile.FileName)) 16 | { 17 | } 18 | 19 | private AddInVersionInfo(AddInFile addInFile, string? path, Uri? uri) 20 | { 21 | Path = path; 22 | Uri = uri; 23 | CompanyName = addInFile.CompanyName; 24 | ProductName = addInFile.ProductName; 25 | Bitness = addInFile.Bitness; 26 | if (Version.TryParse(addInFile.Version, out Version? version)) 27 | Version = version; 28 | 29 | IsVersioned = !string.IsNullOrWhiteSpace(CompanyName) && !string.IsNullOrWhiteSpace(ProductName) && Version != null; 30 | } 31 | 32 | public string? Path { get; } 33 | public Uri? Uri { get; } 34 | public bool IsVersioned { get; } 35 | public string? CompanyName { get; } 36 | public string? ProductName { get; } 37 | public Version? Version { get; } 38 | public Bitness Bitness { get; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/AddInsSource.cs: -------------------------------------------------------------------------------- 1 | namespace ExcelDna.AddInManager 2 | { 3 | public class AddInsSource 4 | { 5 | public string? source; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Controller.cs: -------------------------------------------------------------------------------- 1 | using ExcelDna.AddInManager.Common; 2 | using ExcelDna.Integration; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.IO; 5 | 6 | namespace ExcelDna.AddInManager 7 | { 8 | internal class Controller 9 | { 10 | public Controller() 11 | { 12 | LoadGeneralOptions(); 13 | 14 | if (!Directory.Exists(installedDir)) 15 | return; 16 | 17 | if (generalOptions.autoUpdateAddIns) 18 | AutoUpdateAddIns(); 19 | 20 | foreach (string xll in Directory.GetFiles(installedDir, "*.del")) 21 | { 22 | try 23 | { 24 | File.Delete(xll); 25 | } 26 | catch 27 | { 28 | } 29 | } 30 | 31 | foreach (var i in GetInstalledAddins()) 32 | { 33 | Register(i.Path!); 34 | } 35 | } 36 | 37 | public void OnInstall() 38 | { 39 | InstallDialog dialog = new InstallDialog(GetSourceAddins()); 40 | if (dialog.ShowDialog().GetValueOrDefault()) 41 | { 42 | var installedAddIns = GetInstalledAddins(); 43 | foreach (var i in dialog.GetSelectedAddins()!) 44 | { 45 | Install(i, installedAddIns, true); 46 | } 47 | } 48 | } 49 | 50 | public void OnManage() 51 | { 52 | ManageDialog dialog = new ManageDialog(GetInstalledAddins()); 53 | if (dialog.ShowDialog().GetValueOrDefault()) 54 | { 55 | foreach (var i in dialog.GetAddinsForUninstall()!) 56 | { 57 | Uninstall(i.Path!); 58 | } 59 | } 60 | } 61 | 62 | public void OnOptions() 63 | { 64 | OptionsDialog dialog = new OptionsDialog(generalOptions); 65 | if (dialog.ShowDialog().GetValueOrDefault()) 66 | { 67 | Storage.SaveGeneralOptions(generalOptions); 68 | } 69 | } 70 | 71 | private void AutoUpdateAddIns() 72 | { 73 | var installedVersionedAddins = GetInstalledAddins().Where(i => i.IsVersioned).ToList(); 74 | if (installedVersionedAddins.Count() == 0) 75 | return; 76 | 77 | var sourceAddIns = GetSourceAddins().Where(i => i.IsVersioned); 78 | foreach (var installedAddIn in installedVersionedAddins) 79 | { 80 | var latestSourceAddin = sourceAddIns.Where(i => SameProduct(i, installedAddIn)).OrderByDescending(i => i.Version).FirstOrDefault(); 81 | if (latestSourceAddin != null && latestSourceAddin.Version > installedAddIn.Version) 82 | Install(latestSourceAddin, installedVersionedAddins, false); 83 | } 84 | } 85 | 86 | private static void Install(AddInVersionInfo addin, List installedAddins, bool register) 87 | { 88 | if (addin.IsVersioned) 89 | { 90 | foreach (var i in installedAddins.Where(i => SameProduct(i, addin))) 91 | { 92 | Uninstall(i.Path!); 93 | } 94 | } 95 | 96 | string installedXllPath = Path.Combine(installedDir, Path.GetFileName(addin.Path ?? addin.Uri!.LocalPath)); 97 | if (File.Exists(installedXllPath)) 98 | { 99 | Uninstall(installedXllPath); 100 | } 101 | Storage.CreateDirectoryForFile(installedXllPath); 102 | if (addin.Path != null) 103 | { 104 | File.Copy(addin.Path, installedXllPath, true); 105 | } 106 | else 107 | { 108 | #pragma warning disable SYSLIB0014 109 | using (System.Net.WebClient wc = new()) 110 | wc.DownloadFile(addin.Uri!, installedXllPath); 111 | #pragma warning restore SYSLIB0014 112 | } 113 | 114 | if (register) 115 | Register(installedXllPath); 116 | } 117 | 118 | private static void Uninstall(string xllFileName) 119 | { 120 | string installedXllPath = Path.Combine(installedDir, xllFileName); 121 | Unregister(installedXllPath); 122 | 123 | string delXllPath = installedXllPath + ".del"; 124 | File.Move(installedXllPath, delXllPath, true); 125 | } 126 | 127 | private static List GetInstalledAddins() 128 | { 129 | List addins = new(); 130 | if (Directory.Exists(installedDir)) 131 | { 132 | addins = Directory.GetFiles(installedDir, "*.xll").Select(i => new AddInVersionInfo(i)).Where(i => SameProcessBitness(i.Bitness)).ToList(); 133 | } 134 | 135 | return addins; 136 | } 137 | 138 | private List GetSourceAddins() 139 | { 140 | List addins = new(); 141 | if (generalOptions.sources != null) 142 | { 143 | foreach (var addinSource in generalOptions.sources) 144 | addins.AddRange(GetSourceAddins(addinSource.source).Where(i => SameProcessBitness(i.Bitness))); 145 | } 146 | 147 | return addins; 148 | } 149 | 150 | private static IEnumerable GetSourceAddins(string? source) 151 | { 152 | IEnumerable sourceAddins = new AddInVersionInfo[0]; 153 | if (Uri.IsWellFormedUriString(source, UriKind.Absolute)) 154 | { 155 | if (Uri.TryCreate(source, UriKind.Absolute, out Uri? sourceUri) && Uri.TryCreate(sourceUri, Utils.IndexFileName, out Uri? indexFileUri)) 156 | { 157 | List addinFiles = new(); 158 | try 159 | { 160 | addinFiles = XmlSerializer.XmlDeserialize>(indexFileUri.AbsoluteUri); 161 | } 162 | catch (ApplicationException e) 163 | { 164 | ExceptionHandler.ShowException(e); 165 | } 166 | sourceAddins = addinFiles.Select(i => new AddInVersionInfo(sourceUri, i)); 167 | } 168 | } 169 | else if (Directory.Exists(source)) 170 | { 171 | string indexFile = Path.Combine(source, Utils.IndexFileName); 172 | if (File.Exists(indexFile)) 173 | { 174 | List addinFiles = new(); 175 | try 176 | { 177 | addinFiles = XmlSerializer.XmlDeserialize>(indexFile); 178 | } 179 | catch (ApplicationException e) 180 | { 181 | ExceptionHandler.ShowException(e); 182 | } 183 | sourceAddins = addinFiles.Select(i => new AddInVersionInfo(source, i)); 184 | } 185 | else 186 | { 187 | sourceAddins = Directory.GetFiles(source, "*.xll").Select(i => new AddInVersionInfo(i)); 188 | } 189 | } 190 | 191 | return sourceAddins; 192 | } 193 | 194 | private static void Register(string xllPath) 195 | { 196 | ExcelAsyncUtil.QueueAsMacro(() => 197 | { 198 | ExcelIntegration.RegisterXLL(xllPath); 199 | }); 200 | } 201 | 202 | private static void Unregister(string xllPath) 203 | { 204 | ExcelAsyncUtil.QueueAsMacro(() => 205 | { 206 | ExcelIntegration.UnregisterXLL(xllPath); 207 | }); 208 | } 209 | 210 | private static bool SameProduct(AddInVersionInfo a1, AddInVersionInfo a2) 211 | { 212 | return a1.IsVersioned && a2.IsVersioned && a1.CompanyName == a2.CompanyName && a1.ProductName == a2.ProductName; 213 | } 214 | 215 | private static bool SameProcessBitness(Bitness bitness) 216 | { 217 | if (Environment.Is64BitProcess) 218 | return bitness == Bitness.Bit64; 219 | else 220 | return bitness == Bitness.Bit32; 221 | } 222 | 223 | [MemberNotNull(nameof(generalOptions))] 224 | private void LoadGeneralOptions() 225 | { 226 | try 227 | { 228 | generalOptions = Storage.LoadGeneralOptions() ?? null!; 229 | } 230 | catch (System.ApplicationException e) 231 | { 232 | System.Windows.MessageBox.Show(e.ToString(), "ExcelDna.AddInManager Load general options", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); 233 | } 234 | if (generalOptions == null) 235 | generalOptions = new GeneralOptions(); 236 | } 237 | 238 | private static string installedDir = Storage.GetInstalledAddinsDirectory(); 239 | private GeneralOptions generalOptions; 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/AddInsListView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/AddInsListView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace ExcelDna.AddInManager 4 | { 5 | internal partial class AddInsListView : System.Windows.Controls.UserControl 6 | { 7 | private class ListItem 8 | { 9 | public ListItem(AddInVersionInfo addin) 10 | { 11 | this.Addin = addin; 12 | } 13 | 14 | public string? CompanyName => Addin.CompanyName; 15 | public string? ProductName => Addin.IsVersioned ? Addin.ProductName : Path.GetFileNameWithoutExtension(Addin.Path ?? Addin.Uri?.LocalPath); 16 | public string? Version => Addin.Version?.ToString(); 17 | 18 | public AddInVersionInfo Addin { get; } 19 | } 20 | 21 | public AddInsListView() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | public void Add(List addins) 27 | { 28 | foreach (var i in addins.Select(i => new ListItem(i)).OrderBy(i => i.ProductName)) 29 | addinsListView.Items.Add(i); 30 | } 31 | 32 | public List GetSelectedAddins() 33 | { 34 | return addinsListView.SelectedItems.Cast().Select(i => i.Addin).ToList(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/InstallDialog.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/InstallDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ExcelDna.AddInManager 4 | { 5 | internal partial class InstallDialog : Window 6 | { 7 | public InstallDialog(List addins) 8 | { 9 | InitializeComponent(); 10 | 11 | addinsListView.Add(addins); 12 | } 13 | 14 | public List? GetSelectedAddins() 15 | { 16 | return selectedAddins; 17 | } 18 | 19 | private void OnInstall(object sender, RoutedEventArgs args) 20 | { 21 | try 22 | { 23 | selectedAddins = addinsListView.GetSelectedAddins(); 24 | 25 | DialogResult = true; 26 | } 27 | catch (Exception e) 28 | { 29 | ExceptionHandler.ShowException(e); 30 | } 31 | } 32 | 33 | private List? selectedAddins; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/ManageDialog.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/ManageDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ExcelDna.AddInManager 4 | { 5 | internal partial class ManageDialog : Window 6 | { 7 | public ManageDialog(List addins) 8 | { 9 | InitializeComponent(); 10 | 11 | addinsListView.Add(addins); 12 | } 13 | 14 | public List? GetAddinsForUninstall() 15 | { 16 | return addinsForUninstall; 17 | } 18 | 19 | private void OnUninstall(object sender, RoutedEventArgs args) 20 | { 21 | try 22 | { 23 | addinsForUninstall = addinsListView.GetSelectedAddins(); 24 | 25 | DialogResult = true; 26 | } 27 | catch (Exception e) 28 | { 29 | ExceptionHandler.ShowException(e); 30 | } 31 | } 32 | 33 | private List? addinsForUninstall; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/OptionsDialog.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Dialogs/OptionsDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ExcelDna.AddInManager 4 | { 5 | internal partial class OptionsDialog : Window 6 | { 7 | public OptionsDialog(GeneralOptions options) 8 | { 9 | InitializeComponent(); 10 | 11 | this.options = options; 12 | 13 | autoUpdateAddInsCheckBox.IsChecked = options.autoUpdateAddIns; 14 | if (options.sources != null) 15 | { 16 | string text = ""; 17 | foreach (var i in options.sources) 18 | { 19 | if (text.Length > 0) 20 | text += Environment.NewLine; 21 | text += i.source; 22 | } 23 | sourcesTextBox.Text = text; 24 | } 25 | } 26 | 27 | private void OnSave(object sender, RoutedEventArgs args) 28 | { 29 | try 30 | { 31 | options.autoUpdateAddIns = autoUpdateAddInsCheckBox.IsChecked.GetValueOrDefault(); 32 | List sources = new(); 33 | for (int i = 0; i < sourcesTextBox.LineCount; ++i) 34 | { 35 | AddInsSource source = new AddInsSource(); 36 | source.source = sourcesTextBox.GetLineText(i).Trim(); 37 | if (source.source.Length > 0) 38 | sources.Add(source); 39 | } 40 | options.sources = sources; 41 | 42 | DialogResult = true; 43 | } 44 | catch (System.Exception e) 45 | { 46 | ExceptionHandler.ShowException(e); 47 | } 48 | } 49 | 50 | private GeneralOptions options; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/ExcelDna.AddInManager.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0-windows 5 | enable 6 | enable 7 | true 8 | true 9 | 10 | 11 | 12 | true 13 | ExcelDna.AddInManager.Common.dll 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | True 28 | True 29 | RibbonResources.resx 30 | 31 | 32 | 33 | 34 | 35 | ResXFileCodeGenerator 36 | RibbonResources.Designer.cs 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/ExceptionHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ExcelDna.AddInManager 8 | { 9 | internal class ExceptionHandler 10 | { 11 | public static void ShowException(System.Exception e) 12 | { 13 | System.Windows.MessageBox.Show(e.ToString(), "ExcelDna.AddInManager exception", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/GeneralOptions.cs: -------------------------------------------------------------------------------- 1 | namespace ExcelDna.AddInManager 2 | { 3 | public class GeneralOptions 4 | { 5 | public bool autoUpdateAddIns; 6 | public List? sources; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/MainAddIn.cs: -------------------------------------------------------------------------------- 1 | using ExcelDna.Integration; 2 | 3 | namespace ExcelDna.AddInManager; 4 | 5 | public class MainAddIn : IExcelAddIn 6 | { 7 | public void AutoOpen() 8 | { 9 | controller = new Controller(); 10 | } 11 | 12 | public void AutoClose() 13 | { 14 | } 15 | 16 | internal static Controller? GetController() 17 | { 18 | return controller; 19 | } 20 | 21 | private static Controller? controller; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/Ribbon.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using ExcelDna.Integration.CustomUI; 3 | 4 | namespace ExcelDna.AddInManager; 5 | 6 | [ComVisible(true)] 7 | public class Ribbon : ExcelRibbon 8 | { 9 | public override string GetCustomUI(string RibbonID) 10 | { 11 | return RibbonResources.Ribbon; 12 | } 13 | 14 | public override object? LoadImage(string imageId) 15 | { 16 | // This will return the image resource with the name specified in the image='xxxx' tag 17 | return RibbonResources.ResourceManager.GetObject(imageId); 18 | } 19 | 20 | public void OnButtonInstallPressed(IRibbonControl control) 21 | { 22 | try 23 | { 24 | MainAddIn.GetController()?.OnInstall(); 25 | } 26 | catch (Exception e) 27 | { 28 | ExceptionHandler.ShowException(e); 29 | } 30 | } 31 | 32 | public void OnButtonManagePressed(IRibbonControl control) 33 | { 34 | try 35 | { 36 | MainAddIn.GetController()?.OnManage(); 37 | } 38 | catch (Exception e) 39 | { 40 | ExceptionHandler.ShowException(e); 41 | } 42 | } 43 | 44 | public void OnButtonOptionsPressed(IRibbonControl control) 45 | { 46 | try 47 | { 48 | MainAddIn.GetController()?.OnOptions(); 49 | } 50 | catch (Exception e) 51 | { 52 | ExceptionHandler.ShowException(e); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/RibbonResources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ExcelDna.AddInManager 12 | { 13 | using System; 14 | 15 | 16 | /// 17 | /// A strongly-typed resource class, for looking up localized strings, etc. 18 | /// 19 | // This class was auto-generated by the StronglyTypedResourceBuilder 20 | // class via a tool like ResGen or Visual Studio. 21 | // To add or remove a member, edit your .ResX file then rerun ResGen 22 | // with the /str option, or rebuild your VS project. 23 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 24 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 25 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 26 | internal class RibbonResources 27 | { 28 | 29 | private static global::System.Resources.ResourceManager resourceMan; 30 | 31 | private static global::System.Globalization.CultureInfo resourceCulture; 32 | 33 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 34 | internal RibbonResources() 35 | { 36 | } 37 | 38 | /// 39 | /// Returns the cached ResourceManager instance used by this class. 40 | /// 41 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 42 | internal static global::System.Resources.ResourceManager ResourceManager 43 | { 44 | get 45 | { 46 | if (object.ReferenceEquals(resourceMan, null)) 47 | { 48 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ExcelDna.AddInManager.RibbonResources", typeof(RibbonResources).Assembly); 49 | resourceMan = temp; 50 | } 51 | return resourceMan; 52 | } 53 | } 54 | 55 | /// 56 | /// Overrides the current thread's CurrentUICulture property for all 57 | /// resource lookups using this strongly typed resource class. 58 | /// 59 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 60 | internal static global::System.Globalization.CultureInfo Culture 61 | { 62 | get 63 | { 64 | return resourceCulture; 65 | } 66 | set 67 | { 68 | resourceCulture = value; 69 | } 70 | } 71 | 72 | /// 73 | /// Looks up a localized resource of type System.Drawing.Bitmap. 74 | /// 75 | internal static System.Drawing.Bitmap Image1 76 | { 77 | get 78 | { 79 | object obj = ResourceManager.GetObject("Image1", resourceCulture); 80 | return ((System.Drawing.Bitmap)(obj)); 81 | } 82 | } 83 | 84 | /// 85 | /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> 86 | ///<customUI xmlns='http://schemas.microsoft.com/office/2009/07/customui' loadImage='LoadImage'> 87 | /// <ribbon> 88 | /// <tabs> 89 | /// <tab id='tab1' label='CSfull'> 90 | /// <group id='group1' label='My Group'> 91 | /// <button id='button1' label='My Button' onAction='OnButtonPressed' image='Image1'/> 92 | /// </group> 93 | /// </tab> 94 | /// </tabs> 95 | /// </ribbon> 96 | ///</customUI>. 97 | /// 98 | internal static string Ribbon 99 | { 100 | get 101 | { 102 | return ResourceManager.GetString("Ribbon", resourceCulture); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/RibbonResources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | RibbonResources\Ribbon.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 123 | 124 | 125 | RibbonResources\Image1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/RibbonResources/Image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Excel-DNA/AddInManager/0798fe7ef31dedb59bfeec072dc6827e2f99b67e/Source/ExcelDna.AddInManager/RibbonResources/Image1.png -------------------------------------------------------------------------------- /Source/ExcelDna.AddInManager/RibbonResources/Ribbon.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 |