Skip to content

Commit d809253

Browse files
authored
Merge pull request #128 from navferty/improve-documentation
Improve documentation
2 parents a24f34c + 45efc6c commit d809253

15 files changed

+318
-28
lines changed

NavfertyExcelAddIn.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<File Path="Directory.Packages.props" />
1111
<File Path="LICENSE" />
1212
<File Path="README.md" />
13+
<File Path="README_Cert.md" />
1314
<File Path="README_RU.md" />
1415
</Folder>
1516
<Project Path="Navferty.Common/Navferty.Common.csproj" Id="f14665a1-a035-4c8e-845e-f00029c8181a" />

NavfertyExcelAddIn/NavfertyExcelAddIn.csproj

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,32 @@
185185
<AppDesigner Include="Properties\" />
186186
</ItemGroup>
187187

188+
<!-- SQLite native DLL package location (needed early for Content items) -->
189+
<PropertyGroup>
190+
<SQLiteStubPackageDir Condition="'$(SQLiteStubPackageDir)' == '' AND '$(NuGetPackageRoot)' != ''">$(NuGetPackageRoot)stub.system.data.sqlite.core.netframework\1.0.119\</SQLiteStubPackageDir>
191+
<SQLiteStubPackageDir Condition="'$(SQLiteStubPackageDir)' == ''">$(UserProfile)\.nuget\packages\stub.system.data.sqlite.core.netframework\1.0.119\</SQLiteStubPackageDir>
192+
</PropertyGroup>
193+
194+
<!-- Include SQLite native DLLs in ClickOnce deployment -->
195+
<ItemGroup>
196+
<Content Include="$(SQLiteStubPackageDir)build\net46\x86\SQLite.Interop.dll" Condition="Exists('$(SQLiteStubPackageDir)build\net46\x86\SQLite.Interop.dll')">
197+
<Link>x86\SQLite.Interop.dll</Link>
198+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
199+
<PublishState>Include</PublishState>
200+
<IncludeHash>true</IncludeHash>
201+
<FileType>File</FileType>
202+
<Visible>false</Visible>
203+
</Content>
204+
<Content Include="$(SQLiteStubPackageDir)build\net46\x64\SQLite.Interop.dll" Condition="Exists('$(SQLiteStubPackageDir)build\net46\x64\SQLite.Interop.dll')">
205+
<Link>x64\SQLite.Interop.dll</Link>
206+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
207+
<PublishState>Include</PublishState>
208+
<IncludeHash>true</IncludeHash>
209+
<FileType>File</FileType>
210+
<Visible>false</Visible>
211+
</Content>
212+
</ItemGroup>
213+
188214
<ItemGroup>
189215
<EmbeddedResource Include="NavfertyRibbon.xml" />
190216
</ItemGroup>
@@ -218,6 +244,62 @@
218244
<ManifestKeyFile>Navferty.pfx</ManifestKeyFile>
219245
</PropertyGroup>
220246

247+
<!-- Custom target to ensure SQLite native DLLs are copied to output directory -->
248+
<Target Name="CopySQLiteNativeDlls" AfterTargets="Build;_CopyFilesToPublishFolder;ComputeFilesToPublish">
249+
<PropertyGroup>
250+
<!-- SQLite native DLLs are in the stub package, not the main package -->
251+
<SQLiteStubPackageDir>$(NuGetPackageRoot)stub.system.data.sqlite.core.netframework\1.0.119\</SQLiteStubPackageDir>
252+
<!-- Fallback if NuGetPackageRoot is not set -->
253+
<SQLiteStubPackageDir Condition="'$(NuGetPackageRoot)' == ''">$(UserProfile)\.nuget\packages\stub.system.data.sqlite.core.netframework\1.0.119\</SQLiteStubPackageDir>
254+
</PropertyGroup>
255+
256+
<!-- Log diagnostic information -->
257+
<Message Text="=== SQLite Native DLL Copy Target ===" Importance="high" />
258+
<Message Text="SQLite Stub Package Directory: $(SQLiteStubPackageDir)" Importance="high" />
259+
<Message Text="Output Directory: $(OutDir)" Importance="high" />
260+
<Message Text="Publish Directory: $(PublishDir)" Importance="high" />
261+
262+
<ItemGroup>
263+
<!-- Get SQLite native DLLs from the stub package -->
264+
<SQLiteNativeFiles Include="$(SQLiteStubPackageDir)build\net46\x86\SQLite.Interop.dll" Condition="Exists('$(SQLiteStubPackageDir)build\net46\x86\SQLite.Interop.dll')">
265+
<DestinationFolder>$(OutDir)x86\</DestinationFolder>
266+
<PublishDestinationFolder>$(PublishDir)Application Files\$(AssemblyName)_$(ApplicationVersion)\x86\</PublishDestinationFolder>
267+
<Arch>x86</Arch>
268+
</SQLiteNativeFiles>
269+
<SQLiteNativeFiles Include="$(SQLiteStubPackageDir)build\net46\x64\SQLite.Interop.dll" Condition="Exists('$(SQLiteStubPackageDir)build\net46\x64\SQLite.Interop.dll')">
270+
<DestinationFolder>$(OutDir)x64\</DestinationFolder>
271+
<PublishDestinationFolder>$(PublishDir)Application Files\$(AssemblyName)_$(ApplicationVersion)\x64\</PublishDestinationFolder>
272+
<Arch>x64</Arch>
273+
</SQLiteNativeFiles>
274+
</ItemGroup>
275+
276+
<!-- Log what we found -->
277+
<Message Text="Found @(SQLiteNativeFiles->Count()) SQLite native DLL(s)" Importance="high" />
278+
<Message Text=" - %(SQLiteNativeFiles.Identity) [%(SQLiteNativeFiles.Arch)]" Importance="high" Condition="'@(SQLiteNativeFiles)' != ''" />
279+
<Warning Text="No SQLite native DLLs found in $(SQLiteStubPackageDir)" Condition="'@(SQLiteNativeFiles)' == ''" />
280+
281+
<!-- Copy to build output directory -->
282+
<Copy SourceFiles="@(SQLiteNativeFiles)"
283+
DestinationFolder="%(SQLiteNativeFiles.DestinationFolder)"
284+
SkipUnchangedFiles="true"
285+
Condition="'@(SQLiteNativeFiles)' != ''" />
286+
287+
<!-- Copy to publish directory if publishing (for ClickOnce) -->
288+
<Copy SourceFiles="@(SQLiteNativeFiles)"
289+
DestinationFolder="%(SQLiteNativeFiles.PublishDestinationFolder)"
290+
SkipUnchangedFiles="true"
291+
Condition="'$(PublishDir)' != '' AND '@(SQLiteNativeFiles)' != ''" />
292+
293+
<!-- Also copy to root publish directory as fallback -->
294+
<Copy SourceFiles="@(SQLiteNativeFiles)"
295+
DestinationFolder="$(PublishDir)%(SQLiteNativeFiles.Arch)\"
296+
SkipUnchangedFiles="true"
297+
Condition="'$(PublishDir)' != '' AND '@(SQLiteNativeFiles)' != ''" />
298+
299+
<Message Text="✓ Copied SQLite native DLLs to: $(OutDir)" Importance="high" Condition="'@(SQLiteNativeFiles)' != ''" />
300+
<Message Text="✓ Copied SQLite native DLLs to: $(PublishDir)" Importance="high" Condition="'$(PublishDir)' != '' AND '@(SQLiteNativeFiles)' != ''" />
301+
</Target>
302+
221303
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
222304

223305
<Import Project="$(VSToolsPath)\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets" Condition="Exists('$(VSToolsPath)\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets')" />

New Text Document.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

OSSRequestForm-v4.xlsx

-20 KB
Binary file not shown.

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [Find Formula Errors in the selected range](#find-all-cells-containing-errors)
1919
- [Copy as Markdown](#copy-as-markdown)
2020
- [Validate Values](#validate-values)
21+
- [Export to SQLite](#export-to-sqlite)
2122
- [Create Sample XML based on XSD](#create-sample-xml-based-on-xsd)
2223
- [Validate XML with XSD](#validate-xml-with-xsd)
2324

@@ -182,7 +183,7 @@
182183

183184
|||
184185
|:-:|---|
185-
|![](images/icons/parseNumerics.png)|Contents of selected cells will be copied to clipboard in markdown format.|
186+
|![](images/icons/markdown.png)|Contents of selected cells will be copied to clipboard in markdown format.|
186187

187188
<details>
188189
<summary>View a screenshot</summary>
@@ -206,6 +207,23 @@
206207

207208
---
208209

210+
## Export to SQLite
211+
212+
|||
213+
|:-:|---|
214+
||Export the entire workbook to a SQLite database file. Each worksheet is converted to a separate table with automatic column type detection. Options include using the first row as column headers and skipping initial rows.|
215+
216+
<details>
217+
<summary>View screenshots</summary>
218+
219+
![Export to SQLite in MS Excel](images/ExportToSqlite1.png)
220+
![SQLite Database Result](images/ExportToSqlite2.png)
221+
</details>
222+
223+
[Up](#navfertys-excel-add-in)
224+
225+
---
226+
209227
## Create Sample XML based on XSD
210228

211229
|||
@@ -324,19 +342,19 @@ Sample error report
324342
### Online Install
325343

326344
You can install the add-in from the official website of the project:
327-
[navferty.ru](https://www.navferty.ru). Just download and run the setup.exe.
345+
[navferty.ru](https://www.navferty.ru). Just download and run setup.exe.
328346

329347
You may need to manually import the self-signed certificate before the installation process can be finished.
330348

331-
The installation process also requires internet connection to load latest version.
349+
The installation process also requires an internet connection to load the latest version.
332350

333351
### Offline Install
334352

335-
The solution is built in Azure, you can download the full archive with installation files from there:
353+
The solution is built in Azure. You can download the full archive with installation files from there:
336354

337355
* Visit https://navferty.visualstudio.com/NavfertyExcelAddIn/_build?definitionId=3
338356

339-
* Select latest build of 'NavfertyExcelAddIn - Publish' pipeline:
357+
* Select the latest build of 'NavfertyExcelAddIn - Publish' pipeline:
340358

341359
![Navferty's Tools Ribbon Tab in MS Excel](images/Install1.png)
342360

@@ -346,13 +364,13 @@ The solution is built in Azure, you can download the full archive with installat
346364

347365
* Extract files to a folder and run '.vsto' file:
348366

349-
> Using desktop folder is highly recommended - installing updates
367+
> Using the desktop folder is highly recommended - installing updates
350368
> is permitted only from the same folder where it was installed
351369
> for the first time!
352370
353371
![Navferty's Tools Ribbon Tab in MS Excel](images/Install3.png)
354372

355-
After the installation process is completed, run (or restart) Excel application, and you will see new tab:
373+
After the installation process is completed, run (or restart) the Excel application, and you will see a new tab:
356374

357375
![Navferty's Tools Ribbon Tab in MS Excel](images/Install4.png)
358376

README_Cert.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Generate self-signed code signing certificate
2+
3+
Use certreq so that the certificate has no EKU (Enhanced Key Usage) restrictions, matching the Visual Studio generated certificate.
4+
5+
Fill the password in the script before running.
6+
7+
Do not forget to update the .csproj file with the new thumbprint after generating the certificate.
8+
9+
```powershell
10+
# Clean up and start fresh
11+
Remove-Item navferty.* -Force -ErrorAction SilentlyContinue
12+
13+
# Create certificate request INF file
14+
$infContent = @"
15+
[Version]
16+
Signature = "`$Windows NT$"
17+
18+
[NewRequest]
19+
Subject = "CN=Navferty"
20+
KeySpec = 1
21+
KeyLength = 2048
22+
Exportable = TRUE
23+
MachineKeySet = FALSE
24+
ProviderName = "Microsoft Enhanced RSA and AES Cryptographic Provider"
25+
ProviderType = 24
26+
RequestType = Cert
27+
HashAlgorithm = SHA256
28+
ValidityPeriod = Years
29+
ValidityPeriodUnits = 5
30+
31+
[Extensions]
32+
; Intentionally empty - no EKU
33+
"@
34+
35+
# Save INF file
36+
$infPath = "C:\Temp\cert-test\navferty.inf"
37+
$cerPath = "C:\Temp\cert-test\navferty.cer"
38+
Set-Content -Path $infPath -Value $infContent
39+
40+
Write-Host "Creating certificate with certreq..."
41+
certreq -new -f $infPath $cerPath
42+
43+
if (Test-Path $cerPath) {
44+
Write-Host "✓ Certificate created: $cerPath"
45+
46+
# Import to certificate store
47+
$cert = Import-Certificate -FilePath $cerPath -CertStoreLocation Cert:\CurrentUser\My
48+
49+
Write-Host "✓ Certificate imported to store"
50+
Write-Host " Thumbprint: $($cert.Thumbprint)"
51+
Write-Host " Subject: $($cert.Subject)"
52+
53+
# Check EKU
54+
Write-Host "`nEnhanced Key Usage:"
55+
if ($cert.EnhancedKeyUsageList.Count -eq 0) {
56+
Write-Host " ✓ NONE (unrestricted - matches VS certificate)"
57+
$ekuStatus = "SUCCESS"
58+
} else {
59+
Write-Host " ✗ HAS EKU:"
60+
$cert.EnhancedKeyUsageList | Format-Table FriendlyName, ObjectId
61+
$ekuStatus = "FAILED"
62+
}
63+
64+
# Export as PFX
65+
$password = ConvertTo-SecureString -String "password-here" -Force -AsPlainText
66+
$pfxPath = "C:\repos\NavfertyExcelAddIn\NavfertyExcelAddIn\Navferty.pfx"
67+
68+
Export-PfxCertificate -Cert $cert -FilePath $pfxPath -Password $password
69+
70+
Write-Host "`n=== RESULT ==="
71+
Write-Host "Status: $ekuStatus"
72+
Write-Host "PFX Location: $pfxPath"
73+
Write-Host "Thumbprint: $($cert.Thumbprint)"
74+
Write-Host "`nNext steps:"
75+
Write-Host "1. Update .csproj: <ManifestCertificateThumbprint>$($cert.Thumbprint)</ManifestCertificateThumbprint>"
76+
Write-Host "2. Update Azure Pipeline password secret variable"
77+
Write-Host "3. Commit the new Navferty.pfx"
78+
79+
# Cleanup temp files
80+
Remove-Item $infPath, $cerPath -Force
81+
} else {
82+
Write-Host "✗ Certificate creation failed"
83+
Write-Host "certreq output should appear above"
84+
}
85+
```

README_RU.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [Найти все ошибки в выделенном диапазоне](#найти-все-ошибки-в-выделенном-диапазоне)
1818
- [Копировать в Markdown](#копировать-в-markdown)
1919
- [Валидация значений](#валидация-значений)
20+
- [Экспорт в SQLite](#экспорт-в-sqlite)
2021
- [Создать образец XML (по XSD)](#создать-образец-xml-по-xsd)
2122
- [Валидация XML по XSD](#валидация-xml-по-xsd)
2223
- [Отменить последнее действие](#отменить-последнее-действие)
@@ -106,7 +107,7 @@
106107

107108
|||
108109
|:-:|---|
109-
|![](images/icons/trimSpaces.png)|Очистить текстовое содержимое выделенных ячеек от лишних пробелов. Удаляет повторные пробелы и переносы строк, а также начальные и конечных пробелы в ячейках, имеющих текстовый формат.|
110+
|![](images/icons/trimSpaces.png)|Очистить текстовое содержимое выделенных ячеек от лишних пробелов. Удаляет повторные пробелы и переносы строк, а также начальные и конечные пробелы в ячейках, имеющих текстовый формат.|
110111

111112
<details>
112113
<summary>Посмотреть скриншоты</summary>
@@ -147,7 +148,7 @@
147148

148149
|||
149150
|:-:|---|
150-
|![](images/icons/unmergeCells.png)|Отменяет объединение ячеек, с одновременным заполнением разъединенных ячеек исходым значением.|
151+
|![](images/icons/unmergeCells.png)|Отменяет объединение ячеек, с одновременным заполнением разъединенных ячеек исходным значением.|
151152

152153
<details>
153154
<summary>Посмотреть скриншоты</summary>
@@ -172,7 +173,7 @@
172173

173174
|||
174175
|:-:|---|
175-
|![](images/icons/parseNumerics.png)|Копировать в буфер обмена выделенный фрагмент как таблица Markdown.|
176+
|![](images/icons/markdown.png)|Копировать в буфер обмена выделенный фрагмент как таблица Markdown.|
176177

177178
<details>
178179
<summary>Посмотреть скриншот</summary>
@@ -196,6 +197,23 @@
196197

197198
---
198199

200+
## Экспорт в SQLite
201+
202+
|||
203+
|:-:|---|
204+
||Экспортировать всю книгу в файл базы данных SQLite. Каждый лист преобразуется в отдельную таблицу с автоматическим определением типов столбцов. Доступны опции использования первой строки в качестве заголовков столбцов и пропуска начальных строк.|
205+
206+
<details>
207+
<summary>Посмотреть скриншоты</summary>
208+
209+
![Экспорт в SQLite в MS Excel](images/ExportToSqlite1.png)
210+
![Результат в базе данных SQLite](images/ExportToSqlite2.png)
211+
</details>
212+
213+
[Наверх](#excel-надстройка-navfertys-tools)
214+
215+
---
216+
199217
## Создать образец XML (по XSD)
200218

201219
|||

0 commit comments

Comments
 (0)