├── .gitignore
├── deployment
├── build.cmd
├── appveyor.yml
├── Modules
│ ├── Utils.psm1
│ ├── Chocolatey.psm1
│ ├── VisualStudio.psm1
│ ├── Utils.psd1
│ ├── VisualStudio.psd1
│ ├── Qt.psd1
│ └── Qt.psm1
├── SVGThumbnailExtension.iss
└── Build.ps1
├── test
├── art
│ └── green-grass-landscape.svgz
└── icons
│ ├── mtc.svg
│ ├── life.svg
│ ├── ytplay.svg
│ └── viber.svg
├── SVGThumbnailExtension
├── ThumbnailProvider.def
├── Logging.h
├── ClassFactory.h
├── SVGThumbnailExtension.pro
├── Registry.h
├── ThumbnailProvider.h
├── Common.h
├── ClassFactory.cpp
├── Registry.cpp
├── Main.cpp
└── ThumbnailProvider.cpp
├── .github
└── workflows
│ └── ccpp.yml
├── .all-contributorsrc
├── README.md
└── LICENSE.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .vs
2 | *.pro.user
3 | *.pro.user.*
4 | build-*
5 | var
--------------------------------------------------------------------------------
/deployment/build.cmd:
--------------------------------------------------------------------------------
1 | pwsh.exe -Command .\Build.ps1 -VSEdition BuildTools -Verbose
2 |
--------------------------------------------------------------------------------
/test/art/green-grass-landscape.svgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tibold/svg-explorer-extension/HEAD/test/art/green-grass-landscape.svgz
--------------------------------------------------------------------------------
/test/icons/mtc.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/ThumbnailProvider.def:
--------------------------------------------------------------------------------
1 | LIBRARY "SVGThumbnailExtension"
2 |
3 | EXPORTS
4 | DllRegisterServer PRIVATE
5 | DllUnregisterServer PRIVATE
6 | DllGetClassObject PRIVATE
7 | DllCanUnloadNow PRIVATE
8 |
--------------------------------------------------------------------------------
/test/icons/life.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/Logging.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #if QT_VERSION < 0x050200
6 | #define debugLog qDebug()
7 | #else
8 | #include
9 | Q_DECLARE_LOGGING_CATEGORY(svgExtension)
10 | #define debugLog qCDebug(svgExtension)
11 | #endif
12 |
--------------------------------------------------------------------------------
/test/icons/ytplay.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/deployment/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.0.{build}
2 | pull_requests:
3 | do_not_increment_build_number: true
4 | image: Visual Studio 2017
5 | platform: x64
6 | build_script:
7 | - pwsh: >-
8 | .\deployment\Build.ps1 -Verbose -Architecture x64 -InnoSetupPath "C:\Program Files (x86)\Inno Setup 5"
9 |
10 | .\deployment\Build.ps1 -Verbose -Architecture x86 -InnoSetupPath "C:\Program Files (x86)\Inno Setup 5"
11 |
12 | artifacts:
13 | - path: var/installer/svg_see_x64.exe
14 | name: installer 64bit
15 | - path: var/installer/svg_see_x86.exe
16 | name: installer 32bit
17 |
--------------------------------------------------------------------------------
/.github/workflows/ccpp.yml:
--------------------------------------------------------------------------------
1 | name: C/C++ CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - actions
7 |
8 | jobs:
9 | build:
10 |
11 | runs-on: windows-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v1
15 | - name: init vs studio
16 | run: call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\tools\\vcvars64.bat"
17 | - name: configure
18 | run: configure
19 | - name: make
20 | run: make
21 | - name: make check
22 | run: make check
23 | - name: make distcheck
24 | run: make distcheck
25 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/ClassFactory.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class CClassFactory : public IClassFactory
4 | {
5 | private:
6 | LONG m_cRef;
7 |
8 | ~CClassFactory();
9 |
10 | public:
11 | CClassFactory();
12 |
13 | // Helper
14 | static HRESULT QueryInterfaceFactory(REFIID, void**);
15 |
16 | // IUnknown methods
17 | STDMETHOD(QueryInterface)(REFIID, void**);
18 | STDMETHOD_(ULONG, AddRef)();
19 | STDMETHOD_(ULONG, Release)();
20 |
21 | // IClassFactory methods
22 | STDMETHOD(CreateInstance)(IUnknown*, REFIID, void**);
23 | STDMETHOD(LockServer)(BOOL);
24 | };
25 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/SVGThumbnailExtension.pro:
--------------------------------------------------------------------------------
1 | #-------------------------------------------------
2 | #
3 | # Project created by QtCreator 2012-03-18T17:01:34
4 | #
5 | #-------------------------------------------------
6 |
7 | QT += svg
8 | QT += winextras
9 |
10 | TARGET = SvgSee
11 | TEMPLATE = lib
12 | CONFIG += c++1z
13 |
14 | CONFIG(release, debug|release):DEFINES += NDEBUG
15 |
16 | win32:LIBS += \
17 | shlwapi.lib \
18 | advapi32.lib
19 |
20 | DEFINES += SVGTHUMBNAILEXTENSION_LIBRARY
21 |
22 | SOURCES += \
23 | Registry.cpp \
24 | ThumbnailProvider.cpp \
25 | Main.cpp \
26 | ClassFactory.cpp
27 |
28 | HEADERS +=\
29 | Logging.h \
30 | Registry.h \
31 | ThumbnailProvider.h \
32 | ClassFactory.h \
33 | Common.h
34 |
35 | DEF_FILE += \
36 | ThumbnailProvider.def
37 |
38 | OTHER_FILES += \
39 | ThumbnailProvider.def
40 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/Registry.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "Common.h"
4 |
5 | typedef struct _REGKEY_SUBKEY
6 | {
7 | HKEY hKey;
8 | LPCWSTR lpszSubKey;
9 | } REGKEY_SUBKEY;
10 |
11 | typedef struct _REGKEY_SUBKEY_AND_VALUE
12 | {
13 | HKEY hKey;
14 | LPCWSTR lpszSubKey;
15 | LPCWSTR lpszValue;
16 | DWORD dwType;
17 | DWORD_PTR dwData;
18 | } REGKEY_SUBKEY_AND_VALUE;
19 |
20 | /**
21 | * @brief Creates or updates registry keys
22 | *
23 | * @param aKeys Registry keys and values to update
24 | * @param cKeys The number of keys in the aKeys array.
25 | */
26 | STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys);
27 |
28 | /**
29 | * @brief Deletes the specified registry keys
30 | *
31 | * @param aKeys Registry keys to delete
32 | * @param cKeys The number of keys in the aKeys array.
33 | */
34 | STDAPI DeleteRegistryKeys(REGKEY_SUBKEY* aKeys, ULONG cKeys);
35 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/ThumbnailProvider.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "Common.h"
4 |
5 |
6 | class CThumbnailProvider : public IThumbnailProvider, IObjectWithSite, IInitializeWithStream
7 | {
8 | private:
9 | LONG m_cRef;
10 | IUnknown* m_pSite;
11 | QSvgRenderer renderer;
12 | bool loaded;
13 |
14 | ~CThumbnailProvider();
15 |
16 | public:
17 | CThumbnailProvider();
18 |
19 | // Helper
20 | static HRESULT QueryInterfaceFactory(REFIID, void**);
21 |
22 | // IUnknown methods
23 | STDMETHOD(QueryInterface)(REFIID, void**);
24 | STDMETHOD_(ULONG, AddRef)();
25 | STDMETHOD_(ULONG, Release)();
26 |
27 | // IInitializeWithSteam methods
28 | STDMETHOD(Initialize)(IStream*, DWORD);
29 |
30 | // IThumbnailProvider methods
31 | STDMETHOD(GetThumbnail)(UINT, HBITMAP*, WTS_ALPHATYPE*);
32 |
33 | // IObjectWithSite methods
34 | STDMETHOD(GetSite)(REFIID, void**);
35 | STDMETHOD(SetSite)(IUnknown*);
36 | };
37 |
--------------------------------------------------------------------------------
/deployment/Modules/Utils.psm1:
--------------------------------------------------------------------------------
1 | function Assert-LastExitCode {
2 | [CmdletBinding()]
3 | param(
4 | [Parameter(Mandatory = $true)]
5 | [string] $Message
6 | )
7 |
8 | if($LASTEXITCODE) {
9 | throw $Message
10 | }
11 | }
12 |
13 | function Invoke-Batch {
14 | [CmdletBinding()]
15 | param(
16 | [Parameter(Mandatory = $true)]
17 | [string] $Command
18 | )
19 |
20 | & cmd.exe /c "$Command"
21 | Assert-LastExitCode "Failed to execute batch command: '$Command'"
22 | }
23 |
24 | function Use-InnoSetup {
25 | [CmdletBinding()]
26 | param(
27 | [Parameter()]
28 | [string] $InstallPath = 'C:\Program Files (x86)\Inno Setup 6'
29 | )
30 |
31 | if(-not (Test-Path $InstallPath)) {
32 | throw "Inno Setup install path is invalid: $InstallPath"
33 | }
34 |
35 | $env:Path = "$InstallPath;$env:Path"
36 | }
37 |
38 | function Use-OpenGPG {
39 | [CmdletBinding()]
40 | param()
41 |
42 | if(-not (Get-Command 'gpg' -ErrorAction 'SilentlyContinue')) {
43 | $gitCommand = Get-Command 'git' -ErrorAction 'Stop'
44 | $usrBinPath = Resolve-Path (Join-Path (Split-Path -Path $gitCommand.Source -Parent) '../usr/bin')
45 |
46 | $env:Path += ";$usrBinPath"
47 | }
48 | }
--------------------------------------------------------------------------------
/SVGThumbnailExtension/Common.h:
--------------------------------------------------------------------------------
1 | #ifndef SVGTHUMBNAILEXTENSION_GLOBAL_H
2 | #define SVGTHUMBNAILEXTENSION_GLOBAL_H
3 |
4 | #include
5 |
6 | #if defined(SVGTHUMBNAILEXTENSION_LIBRARY)
7 | # define SVGTHUMBNAILEXTENSIONSHARED_EXPORT Q_DECL_EXPORT
8 | #else
9 | # define SVGTHUMBNAILEXTENSIONSHARED_EXPORT Q_DECL_IMPORT
10 | #endif
11 |
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | STDAPI_(ULONG) DllAddRef();
19 | STDAPI_(ULONG) DllRelease();
20 | STDAPI_(HINSTANCE) DllInstance();
21 |
22 | // {68BF0019-79AB-4e7f-9500-AA3B5227DFE6}
23 | //#define szCLSID_SampleThumbnailProvider L"{68BF0019-79AB-4e7f-9500-AA3B5227DFE6}"
24 | //DEFINE_GUID(CLSID_SampleThumbnailProvider, 0x68bf0019, 0x79ab, 0x4e7f, 0x95, 0x0, 0xaa, 0x3b, 0x52, 0x27, 0xdf, 0xe6);
25 |
26 | // {4CA20D9A-98AC-4DD6-9C16-7449F29AC08A}
27 | #define szCLSID_SampleThumbnailProvider L"{4CA20D9A-98AC-4DD6-9C16-7449F29AC08A}"
28 | DEFINE_GUID(CLSID_SampleThumbnailProvider,
29 | 0x4ca20d9a, 0x98ac, 0x4dd6, 0x9c, 0x16, 0x74, 0x49, 0xf2, 0x9a, 0xc0, 0x8a);
30 |
31 | #if QT_VERSION < 0x050200
32 | #include
33 | #else
34 | #include
35 | #endif
36 | #include
37 |
38 | #endif // SVGTHUMBNAILEXTENSION_GLOBAL_H
39 |
--------------------------------------------------------------------------------
/test/icons/viber.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | "README.md"
4 | ],
5 | "imageSize": 32,
6 | "commit": false,
7 | "contributors": [
8 | {
9 | "login": "Daniel-Beardsmore",
10 | "name": "Daniel Beardsmore",
11 | "avatar_url": "https://avatars3.githubusercontent.com/u/5874930?v=4",
12 | "profile": "http://telcontar.net/",
13 | "contributions": [
14 | "code"
15 | ]
16 | },
17 | {
18 | "login": "GitMensch",
19 | "name": "Simon Sobisch",
20 | "avatar_url": "https://avatars3.githubusercontent.com/u/6699539?v=4",
21 | "profile": "https://github.com/GitMensch",
22 | "contributions": [
23 | "doc",
24 | "code"
25 | ]
26 | },
27 | {
28 | "login": "voodoo66",
29 | "name": "",
30 | "avatar_url": "https://avatars1.githubusercontent.com/u/14852960?s=400&v=4",
31 | "profile": "https://github.com/voodoo66",
32 | "contributions": [
33 | "code"
34 | ]
35 | },
36 | {
37 | "login": "tibold",
38 | "name": "Tibold Kandrai",
39 | "avatar_url": "https://avatars2.githubusercontent.com/u/1974659?v=4",
40 | "profile": "https://github.com/tibold",
41 | "contributions": [
42 | "test",
43 | "ideas",
44 | "code",
45 | "maintenance",
46 | "doc"
47 | ]
48 | },
49 | {
50 | "login": "maphew",
51 | "name": "matt wilkie",
52 | "avatar_url": "https://avatars3.githubusercontent.com/u/486200?v=4",
53 | "profile": "http://www.maphew.com",
54 | "contributions": [
55 | "maintenance"
56 | ]
57 | }
58 | ],
59 | "contributorsPerLine": 3,
60 | "projectName": "svg-explorer-extension",
61 | "projectOwner": "tibold",
62 | "repoType": "github",
63 | "repoHost": "https://github.com",
64 | "skipCi": true
65 | }
66 |
--------------------------------------------------------------------------------
/deployment/Modules/Chocolatey.psm1:
--------------------------------------------------------------------------------
1 | $ChocolateyInstallEnvirnmentVairableKey = "ChocolateyInstall"
2 |
3 | function Test-ChocolateyCommand {
4 | [CmdletBinding()]
5 | param( )
6 |
7 | $command = Get-Command "choco.exe"
8 | if(-not $command) {
9 | Write-Warning "choco is unavailable on the Path."
10 | return $false
11 | }
12 |
13 | return $true
14 | }
15 |
16 | function Get-ChocolateyInstallPath {
17 | [CmdletBinding()]
18 | param( )
19 |
20 | return [System.Environment]::GetEnvironmentVariable($script:ChocolateyInstallEnvirnmentVairableKey, [System.EnvironmentVariableTarget]::Machine)
21 | }
22 |
23 | function Install-Chocolatey{
24 | [CmdletBinding()]
25 | param( )
26 |
27 | Set-ExecutionPolicy Bypass -Scope Process -Force
28 |
29 | $Installer = (New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')
30 | Invoke-Expression $Installer
31 | }
32 |
33 | function Use-Chocolatey {
34 | [CmdletBinding()]
35 | param(){
36 | [Parameter()]
37 | [switch] $Install
38 | }
39 |
40 | $available = Test-ChocolateyCommand
41 | if(-not $available)
42 | {
43 | $installPath = Get-ChocolateyInstallPath
44 | if(-not $installPath -and $Install){
45 | Install-Chocolatey
46 |
47 | $installPath = Get-ChocolateyInstallPath
48 | }
49 |
50 | if($installPath) {
51 | $env:PATH = "$installPath\bin;$env:PATH"
52 | $available = Test-ChocolateyCommand
53 | }
54 | }
55 |
56 | if(-not $available){
57 | throw "Chocolatey is not available. Tried to install: $Install"
58 | }
59 | }
60 |
61 | function Invoke-ChocoInstall {
62 | [CmdletBinding()]
63 | param(
64 | [Parameter(Mandatory = $true)]
65 | [string] $Package,
66 |
67 | [Parameter()]
68 | [string] $Parameters = ""
69 | )
70 |
71 | &choco install "$Package" --params "$Parameters" | Write-Verbose
72 | }
73 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/ClassFactory.cpp:
--------------------------------------------------------------------------------
1 | #include "Common.h"
2 | #include "ClassFactory.h"
3 | #include "ThumbnailProvider.h"
4 |
5 | CClassFactory::CClassFactory()
6 | {
7 | m_cRef = 1;
8 | DllAddRef();
9 | }
10 |
11 | CClassFactory::~CClassFactory()
12 | {
13 | DllRelease();
14 | }
15 |
16 | HRESULT CClassFactory::QueryInterfaceFactory(REFIID riid,
17 | void** ppvObject)
18 | {
19 | CClassFactory * factory = new CClassFactory();
20 | if (factory == nullptr) {
21 | return E_OUTOFMEMORY;
22 | }
23 |
24 | auto result = factory->QueryInterface(riid, ppvObject);
25 |
26 | factory->Release();
27 |
28 | return result;
29 | }
30 |
31 | STDMETHODIMP CClassFactory::QueryInterface(REFIID riid,
32 | void** ppvObject)
33 | {
34 | static const QITAB qit[] =
35 | {
36 | QITABENT(CClassFactory, IClassFactory),
37 | {0},
38 | };
39 | return QISearch(this, qit, riid, ppvObject);
40 | }
41 |
42 | STDMETHODIMP_(ULONG) CClassFactory::AddRef()
43 | {
44 | LONG cRef = InterlockedIncrement(&m_cRef);
45 | return (ULONG)cRef;
46 | }
47 |
48 | STDMETHODIMP_(ULONG) CClassFactory::Release()
49 | {
50 | LONG cRef = InterlockedDecrement(&m_cRef);
51 | if (0 == cRef)
52 | delete this;
53 | return (ULONG)cRef;
54 | }
55 |
56 | STDMETHODIMP CClassFactory::CreateInstance(IUnknown* punkOuter,
57 | REFIID riid,
58 | void** ppvObject)
59 | {
60 | if (NULL != punkOuter)
61 | return CLASS_E_NOAGGREGATION;
62 |
63 | return CThumbnailProvider::QueryInterfaceFactory(riid, ppvObject);
64 | }
65 |
66 | STDMETHODIMP CClassFactory::LockServer(BOOL fLock)
67 | {
68 | Q_UNUSED(fLock);
69 | return E_NOTIMPL;
70 | }
71 |
72 | STDAPI DllGetClassObject(REFCLSID rclsid,
73 | REFIID riid,
74 | void **ppv)
75 | {
76 | if (NULL == ppv)
77 | return E_INVALIDARG;
78 |
79 | if (!IsEqualCLSID(CLSID_SampleThumbnailProvider, rclsid))
80 | return CLASS_E_CLASSNOTAVAILABLE;
81 |
82 | auto hr = CClassFactory::QueryInterfaceFactory(riid, ppv);
83 | return hr;
84 | }
85 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/Registry.cpp:
--------------------------------------------------------------------------------
1 | #include "Registry.h"
2 | #include "Logging.h"
3 |
4 | STDAPI CreateRegistryKey(REGKEY_SUBKEY_AND_VALUE* pKey)
5 | {
6 | debugLog << "Enter: Create single registry key";
7 | size_t cbData;
8 | LPVOID pvData = NULL;
9 | HRESULT hr = S_OK;
10 |
11 | switch(pKey->dwType)
12 | {
13 | case REG_DWORD:
14 | pvData = (LPVOID)(LPDWORD)&pKey->dwData;
15 | cbData = sizeof(DWORD);
16 | break;
17 |
18 | case REG_SZ:
19 | case REG_EXPAND_SZ:
20 | hr = StringCbLength((LPCWSTR)pKey->dwData, STRSAFE_MAX_CCH, &cbData);
21 | if (SUCCEEDED(hr))
22 | {
23 | pvData = (LPVOID)(LPCWSTR)pKey->dwData;
24 | cbData += sizeof(WCHAR);
25 | }
26 | break;
27 |
28 | default:
29 | hr = E_INVALIDARG;
30 | }
31 |
32 | if (SUCCEEDED(hr))
33 | {
34 | QString keyName = QString::fromWCharArray(pKey->lpszSubKey);
35 | debugLog << "Setting key: " << keyName;
36 | LSTATUS status = SHSetValue(pKey->hKey, pKey->lpszSubKey, pKey->lpszValue, pKey->dwType, pvData, (DWORD)cbData);
37 | if (NOERROR != status)
38 | {
39 | hr = HRESULT_FROM_WIN32(status);
40 | debugLog << "Failed to set registry key.";
41 | }
42 | }
43 |
44 | debugLog << "Leave: Create single registry key";
45 | return hr;
46 | }
47 |
48 | STDAPI CreateRegistryKeys(REGKEY_SUBKEY_AND_VALUE* aKeys, ULONG cKeys)
49 | {
50 | debugLog << "Enter: Create multiple registry key";
51 | HRESULT hr = S_OK;
52 |
53 | for (ULONG iKey = 0; iKey < cKeys; iKey++)
54 | {
55 | HRESULT hrTemp = CreateRegistryKey(&aKeys[iKey]);
56 | if (FAILED(hrTemp))
57 | {
58 | hr = hrTemp;
59 | }
60 | }
61 |
62 | debugLog << "Leave: Create multiple registry key";
63 | return hr;
64 | }
65 |
66 | STDAPI DeleteRegistryKeys(REGKEY_SUBKEY* aKeys, ULONG cKeys)
67 | {
68 | debugLog << "Enter: Delete registry keys";
69 | HRESULT hr = S_OK;
70 | LSTATUS status;
71 |
72 | for (ULONG iKey = 0; iKey < cKeys; iKey++)
73 | {
74 | QString keyName = QString::fromWCharArray(aKeys[iKey].lpszSubKey);
75 | debugLog << "Deleting key: " << keyName;
76 | status = RegDeleteTree(aKeys[iKey].hKey, aKeys[iKey].lpszSubKey);
77 | if (NOERROR != status)
78 | {
79 | hr = HRESULT_FROM_WIN32(status);
80 | debugLog << "Failed to delete registry key";
81 | }
82 | }
83 | debugLog << "Leave: Delete registry keys";
84 | return hr;
85 | }
86 |
--------------------------------------------------------------------------------
/deployment/SVGThumbnailExtension.iss:
--------------------------------------------------------------------------------
1 | #ifndef arch
2 | ; Default to x64 if nothing was defined.
3 | #define arch 'x64'
4 | #endif
5 | [Setup]
6 | ; NOTE: The value of AppId uniquely identifies this application.
7 | ; Do not use the same AppId value in installers for other applications.
8 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
9 | AppId={{4CA20D9A-98AC-4DD6-9C16-7449F29AC08A}
10 | AppMutex=github_tibold_svg_explorer_extension
11 | AppName="SVG See"
12 | AppVersion="1.0.0"
13 | AppVerName="SVG See 1.1.0"
14 | AppPublisher="Tibold Kandrai"
15 | AppPublisherURL=https://tibold.kandrai.rocks/
16 | AppSupportURL=https://github.com/tibold/svg-explorer-extension/issues
17 | AppUpdatesURL=https://github.com/tibold/svg-explorer-extension/releases
18 | DefaultGroupName="SvgSee"
19 | OutputDir=..\var\installer
20 | OutputBaseFilename="svg_see_{#arch}"
21 | Compression=lzma
22 | SolidCompression=yes
23 | ChangesAssociations=yes
24 | ; This is to support both IS 5 and 6
25 | #if arch == 'x64'
26 | #ifdef commonpf64
27 | DefaultDirName="{commonpf64}\SvgSee"
28 | #else
29 | DefaultDirName="{pf64}\SvgSee"
30 | #endif
31 | #else
32 | #ifdef commonpf32
33 | DefaultDirName="{commonpf32}\SvgSee"
34 | #else
35 | DefaultDirName="{pf32}\SvgSee"
36 | #endif
37 | #endif
38 |
39 | #if arch == "x64"
40 | ArchitecturesInstallIn64BitMode=x64
41 | #else
42 | ArchitecturesInstallIn64BitMode=
43 | #endif
44 |
45 | [Languages]
46 | Name: "en"; MessagesFile: "compiler:Default.isl"; LicenseFile: "..\LICENSE.md"
47 |
48 | [Files]
49 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
50 | Source: "..\var\dist\{#arch}\release\*"; DestDir: "{app}"; Flags: recursesubdirs
51 | Source: "..\var\dist\{#arch}\release\SvgSee.dll"; DestDir: "{app}"; Flags: regserver
52 | ; Licenses
53 | ; FIXME: the qt license should not be stored in this repository but be copied from the qt distribution
54 | Source: "..\var\licenses\Qt.txt"; DestDir: "{app}\license\";
55 | Source: "..\LICENSE.md"; DestDir: "{app}\license\";
56 |
57 | [Code]
58 |
59 | // Automatically uninstalls the previously installed version if any
60 | // IMPORTANT NOTE: The AppId is hardcoded below, since ExpandConstant did not want to substitute it!
61 | Procedure CurStepChanged(CurStep: TSetupStep);
62 | Var
63 | ResultCode: Integer;
64 | Uninstaller: String;
65 | Begin
66 | If (CurStep = ssInstall) Then Begin
67 | If RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{4CA20D9A-98AC-4DD6-9C16-7449F29AC08A}_is1', 'UninstallString', Uninstaller) Then Begin
68 | //MsgBox('Your previously installed version will be uninstalled first.', mbInformation, MB_OK);
69 | Exec(RemoveQuotes(Uninstaller), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
70 | End;
71 | ExtractTemporaryFile(ExpandConstant('vc_redist.{#arch}.exe'));
72 | Exec(ExpandConstant('{tmp}\vc_redist.{#arch}.exe'), '/install /passive /norestart', '', SW_SHOWNORMAL, ewWaitUntilTerminated,ResultCode);
73 | End;
74 | End;
75 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/Main.cpp:
--------------------------------------------------------------------------------
1 | #define INITGUID
2 | #include "Logging.h"
3 | #include "Registry.h"
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | HINSTANCE g_hinstDll = NULL;
11 | LONG g_cRef = 0;
12 |
13 | QApplication * app;
14 |
15 | #if QT_VERSION >= 0x050200
16 | Q_LOGGING_CATEGORY(svgExtension, "SvgSee")
17 | #endif
18 |
19 | void Initialize(HMODULE module) {
20 | int c = 0;
21 | WCHAR path[2048];
22 | ZeroMemory(path, sizeof(path));
23 | auto length = GetModuleFileNameW(module, path, 2048);
24 | if (GetLastError() != ERROR_SUCCESS || length <= 0) {
25 | debugLog << "Failed to retrieve module name";
26 | }
27 | auto modulePath = QString::fromWCharArray(path, length);
28 | debugLog << "Module path is: " << modulePath;
29 | QFileInfo dll(modulePath);
30 | QDir libraryPath = dll.dir();
31 | QStringList libraryPaths = (QStringList() << libraryPath.absolutePath());
32 | QApplication::setLibraryPaths(libraryPaths);
33 | app = new QApplication(c, (char **)0, 0);
34 | }
35 |
36 |
37 | BOOL APIENTRY DllMain(HINSTANCE hinstDll,
38 | DWORD dwReason,
39 | LPVOID pvReserved)
40 | {
41 | Q_UNUSED(pvReserved)
42 | switch (dwReason)
43 | {
44 | case DLL_PROCESS_ATTACH:
45 | debugLog << "DLL_PROCESS_ATTACH";
46 | g_hinstDll = hinstDll;
47 | Initialize(hinstDll);
48 | break;
49 | }
50 | return TRUE;
51 | }
52 | STDAPI_(HINSTANCE) DllInstance()
53 | {
54 | return g_hinstDll;
55 | }
56 |
57 | STDAPI DllCanUnloadNow()
58 | {
59 | return g_cRef ? S_FALSE : S_OK;
60 | }
61 |
62 | STDAPI_(ULONG) DllAddRef()
63 | {
64 | LONG cRef = InterlockedIncrement(&g_cRef);
65 | return cRef;
66 | }
67 |
68 | STDAPI_(ULONG) DllRelease()
69 | {
70 | LONG cRef = InterlockedDecrement(&g_cRef);
71 | if (0 > cRef)
72 | cRef = 0;
73 | return cRef;
74 | }
75 |
76 | STDAPI DllRegisterServer()
77 | {
78 | debugLog << "Enter: DLLRegisterServer";
79 | WCHAR szModule[MAX_PATH];
80 |
81 | ZeroMemory(szModule, sizeof(szModule));
82 | GetModuleFileName(g_hinstDll, szModule, ARRAYSIZE(szModule));
83 |
84 | REGKEY_SUBKEY_AND_VALUE keys[] = {
85 | {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider, NULL, REG_SZ, (DWORD_PTR)L"SvgSee"},
86 | {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", NULL, REG_SZ, (DWORD_PTR)szModule},
87 | {HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider L"\\InprocServer32", L"ThreadingModel", REG_SZ, (DWORD_PTR)L"Apartment"},
88 | {HKEY_CLASSES_ROOT, L".SVG\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider},
89 | {HKEY_CLASSES_ROOT, L".SVGZ\\shellex\\{E357FCCD-A995-4576-B01F-234630154E96}", NULL, REG_SZ, (DWORD_PTR)szCLSID_SampleThumbnailProvider}
90 | };
91 |
92 |
93 | auto result = CreateRegistryKeys(keys, ARRAYSIZE(keys));
94 |
95 | debugLog << "Leaving: DLLRegisterServer";
96 |
97 | return result;
98 | }
99 |
100 | STDAPI DllUnregisterServer()
101 | {
102 | debugLog << "Enter: DLLRegisterServer";
103 |
104 | REGKEY_SUBKEY keys[] = {{HKEY_CLASSES_ROOT, L"CLSID\\" szCLSID_SampleThumbnailProvider}};
105 | auto result = DeleteRegistryKeys(keys, ARRAYSIZE(keys));
106 |
107 | debugLog << "Leaving: DLLRegisterServer";
108 | return result;
109 | }
110 |
--------------------------------------------------------------------------------
/deployment/Modules/VisualStudio.psm1:
--------------------------------------------------------------------------------
1 | $VisualStudioVersions = @('2015', '2017', '2019')
2 | $VisualStudioEditions = @('Community', 'Professional', 'Enterprise', 'BuildTools')
3 |
4 | class ValidVisualStudioVersions : System.Management.Automation.IValidateSetValuesGenerator {
5 | [String[]] GetValidValues() {
6 | return $script:VisualStudioVersions
7 | }
8 | }
9 |
10 | class ValidVisualStudioEditions : System.Management.Automation.IValidateSetValuesGenerator {
11 | [String[]] GetValidValues() {
12 | return $script:VisualStudioEditions
13 | }
14 | }
15 |
16 | function Assert-WindowsSdk {
17 | [CmdletBinding()]
18 | param(
19 | [Parameter()]
20 | [string] $Sdk
21 | )
22 |
23 | $sdkBasePath = 'C:\Program Files (x86)\Windows Kits\10\bin'
24 | if(-not (Test-Path (Join-Path $sdkBasePath $Sdk))) {
25 | throw "Invalid SDK version '$Sdk' was specified"
26 | }
27 | }
28 |
29 | function Get-VisualStudioVCVarsAll {
30 | [CmdletBinding()]
31 | param(
32 | [Parameter(Mandatory = $true)]
33 | [ValidateSet([ValidVisualStudioVersions])]
34 | [string] $Version,
35 |
36 | [Parameter(Mandatory = $true)]
37 | [ValidateSet([ValidVisualStudioEditions])]
38 | [string] $Edition
39 | )
40 |
41 | $environmentSetupBatchFile = "C:\Program Files (x86)\Microsoft Visual Studio\$Version\$Edition\VC\Auxiliary\Build\vcvarsall.bat"
42 | return $environmentSetupBatchFile
43 | }
44 |
45 | function Test-VisualStudio {
46 | [CmdletBinding()]
47 | param (
48 | [Parameter(Mandatory = $true)]
49 | [ValidateSet([ValidVisualStudioVersions])]
50 | [string] $Version,
51 |
52 | [Parameter(Mandatory = $true)]
53 | [ValidateSet([ValidVisualStudioEditions])]
54 | [string] $Edition
55 | )
56 |
57 | $environmentSetupBatchFile = Get-VisualStudioVCVarsAll -Version:$Version -Edition:$Edition
58 | return (Test-Path $environmentSetupBatchFile)
59 | }
60 |
61 | function Use-VisualStudio{
62 | [CmdletBinding()]
63 | param(
64 | [Parameter()]
65 | [ValidateSet([ValidVisualStudioVersions])]
66 | [string] $Version = '2019',
67 |
68 | [Parameter()]
69 | [ValidateSet([ValidVisualStudioEditions])]
70 | [string] $Edition = 'Community',
71 |
72 | [Parameter()]
73 | [ValidateSet("x86", "amd64", "x86_amd64", "x86_arm", "x86_arm64", "amd64_x86", "amd64_arm", "amd64_arm64")]
74 | [string] $Architecture = 'amd64',
75 |
76 | [Parameter()]
77 | [string] $Sdk,
78 |
79 | [Parameter()]
80 | [switch] $Spectre
81 | )
82 |
83 | Assert-WindowsSdk -Sdk:$Sdk
84 | $available = Test-VisualStudio -Version:$Version -Edition:$Edition
85 | if(-not $available) {
86 | throw "Requested Visual Studio version $Version or edition $Edition is not installed"
87 | }
88 |
89 | $environmentSetupBatchFile = Get-VisualStudioVCVarsAll -Version:$Version -Edition:$Edition
90 | $command = """$environmentSetupBatchFile"" $Architecture $Sdk"
91 | if($Spectre) {
92 | $command += ' -vcvars_spectre_libs=spectre'
93 | }
94 | $command += ' && set'
95 |
96 | # Invoke vcvarsall.bat and dump all environment variables
97 | $variables = Invoke-Batch -Command:$command
98 | $variables | .{process{
99 | if($_ -match '^\[ERROR:.*\]') {
100 | # Throw when vcvarsall.bat reported an error.
101 | $variables | Write-Verbose
102 | throw "Failed to configure Visual Studio: $_"
103 | }
104 | if ($_ -match '^([^=]+)=(.*)') {
105 | # Set the dumped environment variables for the current environment
106 | Set-Item "env:$($matches[1])" $matches[2]
107 | }
108 | }}
109 |
110 | Write-Verbose "Using Visual Studio $Architecture build tools from $Version $Edition."
111 | }
112 |
113 | function Invoke-NMake {
114 | [CmdletBinding()]
115 | param(
116 | [Parameter()]
117 | [string] $Command,
118 |
119 | [Parameter(Mandatory = $true)]
120 | [string] $Operation
121 | )
122 |
123 | & nmake $Command | Write-Verbose
124 | Assert-LastExitCode -Message "Invoking nmake returned '$LASTEXITCODE' for operation: $Operation"
125 | }
126 |
--------------------------------------------------------------------------------
/deployment/Modules/Utils.psd1:
--------------------------------------------------------------------------------
1 | #
2 | # Module manifest for module 'Utils'
3 | #
4 | # Generated by: Tibold
5 | #
6 | # Generated on: 2020-01-05
7 | #
8 |
9 | @{
10 |
11 | # Script module or binary module file associated with this manifest.
12 | RootModule = '.\Utils.psm1'
13 |
14 | # Version number of this module.
15 | ModuleVersion = '0.0.1'
16 |
17 | # Supported PSEditions
18 | # CompatiblePSEditions = @()
19 |
20 | # ID used to uniquely identify this module
21 | GUID = 'b5f7bdc9-3c5c-45f9-aff1-b53ef04325c6'
22 |
23 | # Author of this module
24 | Author = 'Tibold'
25 |
26 | # Company or vendor of this module
27 | CompanyName = 'Unknown'
28 |
29 | # Copyright statement for this module
30 | Copyright = '(c) Tibold. All rights reserved.'
31 |
32 | # Description of the functionality provided by this module
33 | # Description = ''
34 |
35 | # Minimum version of the PowerShell engine required by this module
36 | # PowerShellVersion = ''
37 |
38 | # Name of the PowerShell host required by this module
39 | # PowerShellHostName = ''
40 |
41 | # Minimum version of the PowerShell host required by this module
42 | # PowerShellHostVersion = ''
43 |
44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45 | # DotNetFrameworkVersion = ''
46 |
47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48 | # CLRVersion = ''
49 |
50 | # Processor architecture (None, X86, Amd64) required by this module
51 | # ProcessorArchitecture = ''
52 |
53 | # Modules that must be imported into the global environment prior to importing this module
54 | # RequiredModules = @()
55 |
56 | # Assemblies that must be loaded prior to importing this module
57 | # RequiredAssemblies = @()
58 |
59 | # Script files (.ps1) that are run in the caller's environment prior to importing this module.
60 | # ScriptsToProcess = @()
61 |
62 | # Type files (.ps1xml) to be loaded when importing this module
63 | # TypesToProcess = @()
64 |
65 | # Format files (.ps1xml) to be loaded when importing this module
66 | # FormatsToProcess = @()
67 |
68 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69 | # NestedModules = @()
70 |
71 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72 | FunctionsToExport = 'Assert-LastExitCode', 'Invoke-Batch', 'Use-InnoSetup'
73 |
74 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
75 | CmdletsToExport = @()
76 |
77 | # Variables to export from this module
78 | VariablesToExport = '*'
79 |
80 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
81 | AliasesToExport = @()
82 |
83 | # DSC resources to export from this module
84 | # DscResourcesToExport = @()
85 |
86 | # List of all modules packaged with this module
87 | # ModuleList = @()
88 |
89 | # List of all files packaged with this module
90 | # FileList = @()
91 |
92 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
93 | PrivateData = @{
94 |
95 | PSData = @{
96 |
97 | # Tags applied to this module. These help with module discovery in online galleries.
98 | # Tags = @()
99 |
100 | # A URL to the license for this module.
101 | # LicenseUri = ''
102 |
103 | # A URL to the main website for this project.
104 | # ProjectUri = ''
105 |
106 | # A URL to an icon representing this module.
107 | # IconUri = ''
108 |
109 | # ReleaseNotes of this module
110 | # ReleaseNotes = ''
111 |
112 | # Prerelease string of this module
113 | # Prerelease = ''
114 |
115 | # Flag to indicate whether the module requires explicit user acceptance for install/update/save
116 | # RequireLicenseAcceptance = $false
117 |
118 | # External dependent modules of this module
119 | # ExternalModuleDependencies = @()
120 |
121 | } # End of PSData hashtable
122 |
123 | } # End of PrivateData hashtable
124 |
125 | # HelpInfo URI of this module
126 | # HelpInfoURI = ''
127 |
128 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
129 | # DefaultCommandPrefix = ''
130 |
131 | }
132 |
133 |
--------------------------------------------------------------------------------
/deployment/Modules/VisualStudio.psd1:
--------------------------------------------------------------------------------
1 | #
2 | # Module manifest for module 'VisualStudio'
3 | #
4 | # Generated by: Tibold
5 | #
6 | # Generated on: 2020-01-05
7 | #
8 |
9 | @{
10 |
11 | # Script module or binary module file associated with this manifest.
12 | RootModule = '.\VisualStudio.psm1'
13 |
14 | # Version number of this module.
15 | ModuleVersion = '0.0.1'
16 |
17 | # Supported PSEditions
18 | # CompatiblePSEditions = @()
19 |
20 | # ID used to uniquely identify this module
21 | GUID = '586f6343-3b9e-45f7-a234-3e15540fa66c'
22 |
23 | # Author of this module
24 | Author = 'Tibold'
25 |
26 | # Company or vendor of this module
27 | CompanyName = 'Unknown'
28 |
29 | # Copyright statement for this module
30 | Copyright = '(c) Tibold. All rights reserved.'
31 |
32 | # Description of the functionality provided by this module
33 | # Description = ''
34 |
35 | # Minimum version of the PowerShell engine required by this module
36 | # PowerShellVersion = ''
37 |
38 | # Name of the PowerShell host required by this module
39 | # PowerShellHostName = ''
40 |
41 | # Minimum version of the PowerShell host required by this module
42 | # PowerShellHostVersion = ''
43 |
44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45 | # DotNetFrameworkVersion = ''
46 |
47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48 | # CLRVersion = ''
49 |
50 | # Processor architecture (None, X86, Amd64) required by this module
51 | # ProcessorArchitecture = ''
52 |
53 | # Modules that must be imported into the global environment prior to importing this module
54 | RequiredModules = @('.\Utils.psm1')
55 |
56 | # Assemblies that must be loaded prior to importing this module
57 | # RequiredAssemblies = @()
58 |
59 | # Script files (.ps1) that are run in the caller's environment prior to importing this module.
60 | # ScriptsToProcess = @()
61 |
62 | # Type files (.ps1xml) to be loaded when importing this module
63 | # TypesToProcess = @()
64 |
65 | # Format files (.ps1xml) to be loaded when importing this module
66 | # FormatsToProcess = @()
67 |
68 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69 | # NestedModules = @()
70 |
71 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72 | FunctionsToExport = 'Get-VisualStudioVCVarsAll', 'Test-VisualStudio',
73 | 'Use-VisualStudio', 'Invoke-NMake'
74 |
75 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
76 | CmdletsToExport = @()
77 |
78 | # Variables to export from this module
79 | VariablesToExport = '*'
80 |
81 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
82 | AliasesToExport = @()
83 |
84 | # DSC resources to export from this module
85 | # DscResourcesToExport = @()
86 |
87 | # List of all modules packaged with this module
88 | # ModuleList = @()
89 |
90 | # List of all files packaged with this module
91 | # FileList = @()
92 |
93 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
94 | PrivateData = @{
95 |
96 | PSData = @{
97 |
98 | # Tags applied to this module. These help with module discovery in online galleries.
99 | # Tags = @()
100 |
101 | # A URL to the license for this module.
102 | # LicenseUri = ''
103 |
104 | # A URL to the main website for this project.
105 | # ProjectUri = ''
106 |
107 | # A URL to an icon representing this module.
108 | # IconUri = ''
109 |
110 | # ReleaseNotes of this module
111 | # ReleaseNotes = ''
112 |
113 | # Prerelease string of this module
114 | # Prerelease = ''
115 |
116 | # Flag to indicate whether the module requires explicit user acceptance for install/update/save
117 | # RequireLicenseAcceptance = $false
118 |
119 | # External dependent modules of this module
120 | # ExternalModuleDependencies = @()
121 |
122 | } # End of PSData hashtable
123 |
124 | } # End of PrivateData hashtable
125 |
126 | # HelpInfo URI of this module
127 | # HelpInfoURI = ''
128 |
129 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
130 | # DefaultCommandPrefix = ''
131 |
132 | }
133 |
134 |
--------------------------------------------------------------------------------
/deployment/Modules/Qt.psd1:
--------------------------------------------------------------------------------
1 | #
2 | # Module manifest for module 'Qt'
3 | #
4 | # Generated by: Tibold
5 | #
6 | # Generated on: 2020-01-05
7 | #
8 |
9 | @{
10 |
11 | # Script module or binary module file associated with this manifest.
12 | RootModule = '.\Qt.psm1'
13 |
14 | # Version number of this module.
15 | ModuleVersion = '0.0.1'
16 |
17 | # Supported PSEditions
18 | # CompatiblePSEditions = @()
19 |
20 | # ID used to uniquely identify this module
21 | GUID = 'af9d8ce6-a334-4cf1-a900-e85b980ef8cd'
22 |
23 | # Author of this module
24 | Author = 'Tibold'
25 |
26 | # Company or vendor of this module
27 | CompanyName = 'Unknown'
28 |
29 | # Copyright statement for this module
30 | Copyright = '(c) Tibold. All rights reserved.'
31 |
32 | # Description of the functionality provided by this module
33 | # Description = ''
34 |
35 | # Minimum version of the PowerShell engine required by this module
36 | # PowerShellVersion = ''
37 |
38 | # Name of the PowerShell host required by this module
39 | # PowerShellHostName = ''
40 |
41 | # Minimum version of the PowerShell host required by this module
42 | # PowerShellHostVersion = ''
43 |
44 | # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45 | # DotNetFrameworkVersion = ''
46 |
47 | # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48 | # CLRVersion = ''
49 |
50 | # Processor architecture (None, X86, Amd64) required by this module
51 | # ProcessorArchitecture = ''
52 |
53 | # Modules that must be imported into the global environment prior to importing this module
54 | RequiredModules = @('.\Utils.psm1')
55 |
56 | # Assemblies that must be loaded prior to importing this module
57 | # RequiredAssemblies = @()
58 |
59 | # Script files (.ps1) that are run in the caller's environment prior to importing this module.
60 | # ScriptsToProcess = @()
61 |
62 | # Type files (.ps1xml) to be loaded when importing this module
63 | # TypesToProcess = @()
64 |
65 | # Format files (.ps1xml) to be loaded when importing this module
66 | # FormatsToProcess = @()
67 |
68 | # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69 | # NestedModules = @()
70 |
71 | # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72 | FunctionsToExport = 'Get-InstalledQtSdkVersions', 'Get-QtSdkPath', 'Test-QtSdk',
73 | 'Use-QtSdk', 'Invoke-QMake', 'Invoke-QtWinDeploy', 'Get-QtMinGWPath'
74 |
75 | # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
76 | CmdletsToExport = @()
77 |
78 | # Variables to export from this module
79 | VariablesToExport = '*'
80 |
81 | # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
82 | AliasesToExport = @()
83 |
84 | # DSC resources to export from this module
85 | # DscResourcesToExport = @()
86 |
87 | # List of all modules packaged with this module
88 | # ModuleList = @()
89 |
90 | # List of all files packaged with this module
91 | # FileList = @()
92 |
93 | # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
94 | PrivateData = @{
95 |
96 | PSData = @{
97 |
98 | # Tags applied to this module. These help with module discovery in online galleries.
99 | # Tags = @()
100 |
101 | # A URL to the license for this module.
102 | # LicenseUri = ''
103 |
104 | # A URL to the main website for this project.
105 | # ProjectUri = ''
106 |
107 | # A URL to an icon representing this module.
108 | # IconUri = ''
109 |
110 | # ReleaseNotes of this module
111 | # ReleaseNotes = ''
112 |
113 | # Prerelease string of this module
114 | # Prerelease = ''
115 |
116 | # Flag to indicate whether the module requires explicit user acceptance for install/update/save
117 | # RequireLicenseAcceptance = $false
118 |
119 | # External dependent modules of this module
120 | # ExternalModuleDependencies = @()
121 |
122 | } # End of PSData hashtable
123 |
124 | } # End of PrivateData hashtable
125 |
126 | # HelpInfo URI of this module
127 | # HelpInfoURI = ''
128 |
129 | # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
130 | # DefaultCommandPrefix = ''
131 |
132 | }
133 |
134 |
--------------------------------------------------------------------------------
/deployment/Modules/Qt.psm1:
--------------------------------------------------------------------------------
1 | $QtDefaultInstallPath = 'C:\Qt\'
2 | $QtDefaultVersion = '*' # Latest
3 |
4 | function Get-InstalledQtSdkVersions {
5 | [CmdletBinding()]
6 | param(
7 | [Parameter()]
8 | [ValidateScript( { Test-Path $_ }, ErrorMessage = "Qt install path is not found.")]
9 | [string] $QtInstallPath = $script:QtDefaultInstallPath
10 | )
11 |
12 | $installedVersions = Get-ChildItem -Path $QtInstallPath -Directory |`
13 | Select-Object -ExpandProperty Name |`
14 | Where-Object { $_.StartsWith('5.') -or $_.StartsWith('4.') } |`
15 | Sort-Object -Descending
16 |
17 | if (-not $installedVersions) {
18 | Write-Warning "No Qt Sdk version found in the installation path: $QtInstallPath"
19 | }
20 |
21 | return $installedVersions
22 | }
23 |
24 | function Get-QtSdkPath {
25 | param (
26 | [Parameter()]
27 | [string] $QtInstallPath = $script:QtDefaultInstallPath,
28 |
29 | [Parameter()]
30 | [string] $Version = $script:QtDefaultVersion,
31 |
32 | [Parameter(Mandatory = $true)]
33 | [string] $Platform
34 | )
35 |
36 | $installedVersions = Get-InstalledQtSdkVersions -QtInstallPath:$QtInstallPath
37 |
38 | $selectedVersion = @($installedVersions) -match $Version | Select-Object -First 1
39 | if (-not $selectedVersion) {
40 | throw "Qt version '$Version' is not installed. Installed versions: $installedVersions"
41 | }
42 | $qtPath = Join-Path $QtInstallPath $selectedVersion
43 |
44 | $installedPlatforms = Get-ChildItem -Path $qtPath -Directory `
45 | | Select-Object -ExpandProperty Name `
46 | | Sort-Object -Descending
47 | $selectedPlatform = @($installedPlatforms) -like $Platform | Select-Object -First 1
48 | if (-not $selectedPlatform) {
49 | throw "Platform '$Platform' for Qt version '$Version' is not installed. Installed platforms are $installedPlatforms"
50 | }
51 | $qtPath = Join-Path $qtPath $selectedPlatform
52 |
53 | return $qtPath
54 | }
55 |
56 | function Get-QtMinGWPath {
57 | [CmdletBinding()]
58 | param(
59 | [Parameter()]
60 | [ValidateScript( { Test-Path $_ }, ErrorMessage = "Qt install path is not found.")]
61 | [string] $QtInstallPath = $script:QtDefaultInstallPath,
62 |
63 | [Parameter(Mandatory)]
64 | [string] $Version,
65 |
66 | [Parameter(Mandatory)]
67 | [ValidateSet('32', '64')]
68 | [string] $Architecture
69 | )
70 |
71 | $Version = $Version.Replace(".", "")
72 |
73 | $toolsPath = Resolve-Path (Join-Path $QtInstallPath "Tools")
74 |
75 | $mingwPath = Get-ChildItem -Path $toolsPath -Directory -Filter "mingw*_$Architecture" `
76 | | Where-Object { $_.Name -like "$Version" } `
77 | | Sort-Object -Descending `
78 | | Select-Object -First 1
79 |
80 | if(-not $mingwPath) {
81 | throw "Failed to find Qt's MinGW path for version $Version $Architecture bit"
82 | }
83 |
84 | return $mingwPath
85 | }
86 |
87 | function Test-QtSdk {
88 | [CmdletBinding()]
89 | param( )
90 |
91 | $qmake = Get-Command 'qmake'
92 | if (-not $qmake) {
93 | Write-Warning "Qt qmake is not available on Path"
94 | return $false
95 | }
96 |
97 | return $true
98 | }
99 |
100 | function Use-QtSdk {
101 | [CmdletBinding()]
102 | param (
103 | [Parameter()]
104 | [string] $QtInstallPath = $script:QtDefaultInstallPath,
105 |
106 | [Parameter()]
107 | [string] $Version = $script:QtDefaultVersion,
108 |
109 | [Parameter(Mandatory = $true)]
110 | [string] $Platform
111 | )
112 |
113 | $qtPath = Get-QtSdkPath -QtInstallPath:$QtInstallPath -Version:$Version -Platform:$Platform
114 | $binPath = Join-Path $qtPath 'bin'
115 | $env:Path = "$binPath;$toolsBinPath;$env:Path"
116 | Write-Verbose "Using Qt version '$Version' for '$Platform' at '$qtPath'"
117 | }
118 |
119 | function Invoke-QMake {
120 | [CmdletBinding()]
121 | param (
122 | # Parameter help description
123 | [Parameter(Mandatory)]
124 | [string] $ProjectFile,
125 |
126 | # Parameter help description
127 | [Parameter()]
128 | [string] $Configuration,
129 |
130 | # Parameter help description
131 | [Parameter()]
132 | [string] $DllDestDir
133 | )
134 |
135 | $arguments = @()
136 | if ($Configuration) {
137 | $arguments += '"CONFIG+={0}"' -f $Configuration
138 | }
139 |
140 | if ($DllDestDir) {
141 | $arguments += '"DLLDESTDIR+={0}"' -f $DllDestDir
142 | }
143 |
144 | & qmake @arguments "$ProjectFile" | Write-Verbose
145 | Assert-LastExitCode -Message "Failed to execute qmake to generate Makefiles"
146 | }
147 |
148 | function Invoke-QtWinDeploy {
149 | [CmdletBinding()]
150 | param (
151 | # Parameter help description
152 | [Parameter(Mandatory)]
153 | [ValidateScript( { Test-Path $_ })]
154 | [string] $Binary,
155 |
156 | [Parameter()]
157 | [string[]] $Enable,
158 |
159 | [Parameter()]
160 | [string[]] $Disable
161 | )
162 |
163 | $arguments = @()
164 |
165 | if ($Enable) {
166 | foreach ($item in $Enable) {
167 | $arguments += "--$item"
168 | }
169 | }
170 |
171 | if ($Disable) {
172 | foreach ($item in $Disable) {
173 | $arguments += "--no-$item"
174 | }
175 | }
176 |
177 | & windeployqt.exe @arguments $Binary | Write-Verbose
178 |
179 | Assert-LastExitCode "Failed to deploy Qt dependencies for the built binary."
180 | }
--------------------------------------------------------------------------------
/deployment/Build.ps1:
--------------------------------------------------------------------------------
1 | [CmdletBinding()]
2 | Param(
3 | [Parameter()]
4 | [string] $ProjectName = 'SVGThumbnailExtension',
5 |
6 | [Parameter()]
7 | [ValidateSet('release', 'debug')]
8 | [string] $Configuration = 'release',
9 |
10 | [Parameter()]
11 | [ValidateSet('x86', 'x64')]
12 | [string] $Architecture = 'x64',
13 |
14 | [Parameter()]
15 | [ValidateSet('2015', '2017', '2019')]
16 | [string] $VSVersion = '2017',
17 |
18 | [Parameter()]
19 | [ValidateSet('Community', 'Professional', 'Enterprise', 'BuildTools')]
20 | [string] $VSEdition = 'Community',
21 |
22 | [Parameter()]
23 | [string] $WinSdk = '10.0.17763.0',
24 |
25 | [Parameter()]
26 | [string] $QtVersion,
27 |
28 | [Parameter()]
29 | [string] $QtInstallPath = 'C:\Qt\',
30 |
31 | # Parameter help description
32 | [Parameter()]
33 | [switch] $BuildInstaller = [switch]::Present,
34 |
35 | # Parameter help description
36 | [Parameter()]
37 | [switch] $SignInstaller,
38 |
39 | [Parameter()]
40 | [string] $InnoSetupPath = 'C:\Program Files (x86)\Inno Setup 6'
41 | )
42 |
43 | $ErrorActionPreference = 'stop'
44 |
45 | if(-not $QtVersion){
46 | switch ($VSVersion) {
47 | '2019' { $QtVersion = '5.15.*' }
48 | Default { $QtVersion = '5.12.*'}
49 | }
50 | }
51 |
52 | Import-Module (Join-Path $PSScriptRoot 'Modules/Qt.psd1')
53 | Import-Module (Join-Path $PSScriptRoot 'Modules/VisualStudio.psd1')
54 |
55 | Write-Verbose "Setting up development environment."
56 |
57 | $rootFolder = Resolve-Path (Join-Path $PSScriptRoot '..')
58 |
59 | $distDir = Join-Path $rootFolder "var/dist/$Architecture/$Configuration"
60 | $binary = Join-Path $distDir "SvgSee.dll"
61 | $buildDir = Join-Path $rootFolder "var/build/$Architecture"
62 | $projectFile = Resolve-Path (Join-Path $rootFolder "$ProjectName/$ProjectName.pro")
63 | $licenseDir = Join-Path $rootFolder 'var/licenses'
64 | $installerDir = Join-Path $rootFolder 'var/installer'
65 | $installerPath = Join-Path $installerDir "svg_see_$Architecture.exe"
66 |
67 | function Initialize-Environment {
68 |
69 | $vsArchitectureMap = @{
70 | 'x86' = 'x86';
71 | 'x64' = 'amd64';
72 | }
73 |
74 | Use-VisualStudio `
75 | -Version $VSVersion `
76 | -Edition $VSEdition `
77 | -Architecture $vsArchitectureMap[$Architecture] `
78 | -Sdk $WinSdk `
79 | -Spectre `
80 | -Verbose
81 |
82 | # NOTE: I know it's not right. We'll fix it later.
83 | $qtArchitectureMap = @{
84 | 'x86' = "msvc$VSVersion";
85 | 'x64' = "msvc${VSVersion}_64";
86 | }
87 |
88 | $qtParams = @{ }
89 | if ($QtInstallPath) {
90 | $qtParams["QtInstallPath"] = $QtInstallPath
91 | }
92 |
93 | Use-QtSdk `
94 | -Version $QtVersion `
95 | -Platform $qtArchitectureMap[$Architecture] `
96 | @qtParams `
97 | -Verbose
98 |
99 | if ($BuildInstaller) {
100 | # Setup "Inno Setup" build environment
101 | Use-InnoSetup -InstallPath $InnoSetupPath
102 |
103 | if($SignInstaller) {
104 | Use-OpenGPG
105 | }
106 | }
107 | }
108 |
109 | function Build-Application {
110 |
111 | Write-Verbose "Building application."
112 |
113 | New-Item -Path $distDir -ItemType Directory -Force
114 | New-Item -Path $buildDir -ItemType Directory -Force
115 |
116 | Push-Location $buildDir
117 |
118 | try {
119 | Invoke-QMake -ProjectFile:$projectFile -Configuration:$Configuration -DllDestDir:$distDir
120 | Invoke-NMake -Command 'clean' -Operation 'clean project'
121 | Invoke-NMake -Operation 'build project'
122 | }
123 | finally {
124 | Pop-Location
125 | }
126 | }
127 |
128 | function Publish-Application {
129 |
130 | Write-Verbose "Deploying Qt dependencies for the application."
131 |
132 | Invoke-QtWinDeploy -Binary:$binary -Disable translations, quick-import, system-d3d-compiler, angle, opengl-sw
133 |
134 | Write-Verbose "Cleaning up unused Qt plugins."
135 | $unusedPlugins = @(
136 | 'iconengines',
137 | 'imageformats'
138 | )
139 | foreach ($plugin in $unusedPlugins) {
140 | Remove-Item (Join-Path $distDir $plugin) -Recurse -Force
141 | }
142 |
143 | Write-Verbose "Gathering licenses"
144 |
145 | New-Item -Path $licenseDir -ItemType Directory -Force
146 | Copy-Item -Path (Join-Path $QtInstallPath 'Licenses\LICENSE') -Destination (Join-Path $licenseDir "Qt.txt") -Force
147 | }
148 |
149 | function Build-Installer {
150 |
151 | Write-Verbose "Building installer"
152 |
153 | Push-Location $rootFolder
154 | try {
155 | $issFile = Join-Path $rootFolder "deployment/${ProjectName}.iss";
156 | iscc "/darch=$Architecture" "$issFile" | Write-Verbose
157 | Assert-LastExitCode "Failed to build installer"
158 | }
159 | finally {
160 | Pop-Location
161 | }
162 | }
163 |
164 | function Protect-Installer {
165 |
166 | Write-Verbose "Signing installer"
167 |
168 | # Sign the installer
169 | gpg --detach-sign --armor --yes -o "$installerPath.sig" "$installerPath" | Write-Verbose
170 | Assert-LastExitCode "Failed to sign installer."
171 |
172 | # Verify the signature
173 | gpg --verify "$installerPath.sig" "$installerPath" | Write-Verbose
174 | Assert-LastExitCode "Failed to verify signed installer."
175 |
176 | Write-Verbose "Installer signed successfully"
177 | }
178 |
179 | Initialize-Environment
180 | Build-Application
181 | Publish-Application
182 | if ($BuildInstaller) {
183 | Build-Installer
184 | if($SignInstaller) {
185 | Protect-Installer
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/SVGThumbnailExtension/ThumbnailProvider.cpp:
--------------------------------------------------------------------------------
1 | #include "Common.h"
2 | #include "ThumbnailProvider.h"
3 |
4 | #include
5 | #include
6 |
7 | #include
8 | #ifndef NDEBUG
9 | #include
10 | #include
11 | #include
12 | #endif
13 | #include
14 | #include
15 | #include
16 | #if QT_VERSION >= 0x050200
17 | #include
18 | #endif
19 |
20 | using namespace Gdiplus;
21 |
22 | CThumbnailProvider::CThumbnailProvider()
23 | {
24 | DllAddRef();
25 | m_cRef = 1;
26 | m_pSite = NULL;
27 | loaded = false;
28 | }
29 |
30 | CThumbnailProvider::~CThumbnailProvider()
31 | {
32 | if (m_pSite)
33 | {
34 | m_pSite->Release();
35 | m_pSite = NULL;
36 | }
37 | DllRelease();
38 | }
39 |
40 | /*
41 | * ===============
42 | * IUnkown methods
43 | * ===============
44 | */
45 | HRESULT CThumbnailProvider::QueryInterfaceFactory(REFIID riid, void** ppvObject)
46 | {
47 | *ppvObject = NULL;
48 |
49 | CThumbnailProvider * provider = new CThumbnailProvider();
50 | if (provider == nullptr)
51 | {
52 | return E_OUTOFMEMORY;
53 | }
54 |
55 | auto result = provider->QueryInterface(riid, ppvObject);
56 |
57 | provider->Release();
58 |
59 | return result;
60 | }
61 |
62 | STDMETHODIMP CThumbnailProvider::QueryInterface(REFIID riid,
63 | void** ppvObject)
64 | {
65 | static const QITAB qit[] =
66 | {
67 | QITABENT(CThumbnailProvider, IInitializeWithStream),
68 | QITABENT(CThumbnailProvider, IThumbnailProvider),
69 | QITABENT(CThumbnailProvider, IObjectWithSite),
70 | {0},
71 | };
72 | return QISearch(this, qit, riid, ppvObject);
73 | }
74 |
75 | STDMETHODIMP_(ULONG) CThumbnailProvider::AddRef()
76 | {
77 | LONG cRef = InterlockedIncrement(&m_cRef);
78 | return (ULONG)cRef;
79 | }
80 |
81 | STDMETHODIMP_(ULONG) CThumbnailProvider::Release()
82 | {
83 | LONG cRef = InterlockedDecrement(&m_cRef);
84 | if (0 == cRef)
85 | delete this;
86 | return (ULONG)cRef;
87 | }
88 |
89 | /*
90 | * ===============
91 | * End IUnkown methods
92 | * ===============
93 | */
94 |
95 | /*
96 | * ============================
97 | * IInitializeWithSteam methods
98 | * ============================
99 | */
100 |
101 | STDMETHODIMP CThumbnailProvider::Initialize(IStream *pstm,
102 | DWORD grfMode)
103 | {
104 | ULONG len;
105 | STATSTG stat;
106 | Q_UNUSED(grfMode)
107 |
108 | if(loaded) {
109 | return HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED);
110 | }
111 |
112 | if(pstm->Stat(&stat, STATFLAG_DEFAULT) != S_OK){
113 | return S_FALSE;
114 | }
115 |
116 | char * data = new char[stat.cbSize.QuadPart];
117 |
118 | if(pstm->Read(data, stat.cbSize.QuadPart, &len) != S_OK){
119 | return S_FALSE;
120 | }
121 |
122 | QByteArray bytes = QByteArray(data, stat.cbSize.QuadPart);
123 |
124 | loaded = renderer.load(bytes);
125 |
126 | return S_OK;
127 | }
128 |
129 | /*
130 | * ============================
131 | * End IInitializeWithSteam methods
132 | * ============================
133 | */
134 |
135 | /*
136 | * ============================
137 | * IThumbnailProvider methods
138 | * ============================
139 | */
140 |
141 | STDMETHODIMP CThumbnailProvider::GetThumbnail(UINT cx,
142 | HBITMAP *phbmp,
143 | WTS_ALPHATYPE *pdwAlpha)
144 | {
145 | *phbmp = NULL;
146 | *pdwAlpha = WTSAT_ARGB;
147 |
148 | #ifdef NDEBUG
149 | if(!loaded) {
150 | return S_FALSE;
151 | }
152 | #endif
153 |
154 | // Fit the render into a (cx * cx) square while maintaining the aspect ratio.
155 | QSize size = renderer.defaultSize();
156 | size.scale(cx, cx, Qt::AspectRatioMode::KeepAspectRatio);
157 |
158 | #ifndef NDEBUG
159 | QDir debugDir("C:\\dev");
160 | if(debugDir.exists()) {
161 | QFile f("C:\\dev\\svg.log");
162 | f.open(QFile::Append);
163 | // f->write(QString("Size: %1 \n.").arg(cx).toAscii());
164 | f.write(QString("Size: %1 \n").arg(cx).toUtf8());
165 | f.flush();
166 | f.close();
167 | }
168 | #endif
169 |
170 | QImage * device = new QImage(size, QImage::Format_ARGB32);
171 | device->fill(Qt::transparent);
172 | QPainter painter(device);
173 |
174 | painter.setRenderHints(QPainter::Antialiasing |
175 | QPainter::SmoothPixmapTransform |
176 | QPainter::TextAntialiasing);
177 |
178 | assert(device->paintingActive() && painter.isActive());
179 | if(loaded){
180 | renderer.render(&painter);
181 | } else {
182 | QFont font;
183 | QColor color_font = QColor(255, 0, 0);
184 | int font_size = cx / 10;
185 |
186 | font.setStyleHint(QFont::Monospace);
187 | font.setPixelSize(font_size);
188 |
189 | painter.setPen(color_font);
190 | painter.setFont(font);
191 | painter.drawText(font_size, (cx - font_size) / 2, "Invalid SVG file.");
192 | }
193 | painter.end();
194 |
195 | assert(!device->isNull());
196 | #ifndef NDEBUG
197 | device->save(QString("C:\\dev\\%1.png").arg(QDateTime::currentMSecsSinceEpoch()), "PNG");
198 | #endif
199 |
200 | // Issue #19, https://github.com/tibold/svg-explorer-extension/issues/19
201 | // Old syntax: HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format = NoAlpha) const
202 | // New syntax: HBITMAP QtWin::toHBITMAP(const QPixmap &p, QtWin::HBitmapFormat format = HBitmapNoAlpha)
203 | #if QT_VERSION < 0x050200
204 | *phbmp = QPixmap::fromImage(*device).toWinHBITMAP(QPixmap::Alpha);
205 | #else
206 | *phbmp = QtWin::toHBITMAP(QPixmap::fromImage(*device), QtWin::HBitmapAlpha);
207 | #endif
208 | assert(*phbmp != NULL);
209 |
210 | delete device;
211 |
212 | if( *phbmp != NULL )
213 | return S_OK;
214 | return S_FALSE;
215 | }
216 |
217 | /*
218 | * ============================
219 | * End IThumbnailProvider methods
220 | * ============================
221 | */
222 |
223 | /*
224 | * ============================
225 | * IObjectWithSite methods
226 | * ============================
227 | */
228 |
229 | STDMETHODIMP CThumbnailProvider::GetSite(REFIID riid,
230 | void** ppvSite)
231 | {
232 | if (m_pSite)
233 | {
234 | return m_pSite->QueryInterface(riid, ppvSite);
235 | }
236 | return E_NOINTERFACE;
237 | }
238 |
239 | STDMETHODIMP CThumbnailProvider::SetSite(IUnknown* pUnkSite)
240 | {
241 | if (m_pSite)
242 | {
243 | m_pSite->Release();
244 | m_pSite = NULL;
245 | }
246 |
247 | m_pSite = pUnkSite;
248 | if (m_pSite)
249 | {
250 | m_pSite->AddRef();
251 | }
252 | return S_OK;
253 | }
254 |
255 | /*
256 | * ============================
257 | * End IObjectWithSite methods
258 | * ============================
259 | */
260 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SVG Viewer Extension for Windows Explorer
2 |
3 | Extension module for Windows Explorer to render SVG thumbnails, so that you can have an overview of your SVG files.
4 |
5 | ## Installation
6 | From _[Releases](https://github.com/tibold/svg-explorer-extension/releases)_ download and run appropriate binary for your system. There are no further actions required after installations.
7 |
8 | > Make sure you download the right architecture (the 32 bit installer will run on a 64 bit system, but the extension will not function).
9 |
10 | ## Troubleshooting
11 |
12 | ----
13 | > Thumbnails do no show after installation
14 |
15 | ### Method 1:
16 |
17 | This may happen if the thumbnail's are disabled in the system. To verify that it is indeed turned on:
18 |
19 | * Open the start menu
20 | * Search for `File Explorer Options` and open it
21 | * Under the `View` tab make sure that the `Always show icons, never thumbnails` is __unchecked__
22 |
23 | ### Method 2:
24 |
25 | This may happen if the system already contains cached thumbnails for the SVGs you are trying to view. This can be fixed by clearing the system's thumbnail cache.
26 |
27 | * Open the start menu
28 | * Search for "Disk cleanup" and open it
29 | * In the dialog there is a list of items that can be cleaned. Select `Thumbnails` at the end of the list. You may unselect the rest or leave the default selection.
30 | * Click `OK`
31 |
32 | ### Method 3:
33 |
34 | Kill `explorer.exe` and delete the icon cache manually
35 | ([ref](https://superuser.com/questions/342052/how-to-get-svg-thumbnails-in-windows-explorer)):
36 |
37 | TASKKILL /IM explorer* /F
38 | DEL "%localappdata%\IconCache.db" /A
39 | explorer.exe
40 |
41 | If neither of the above helped please open an issue on our github page.
42 |
43 | ----
44 | > An error is thrown during the installation.
45 |
46 | Please open an issue on our github page, and include a screen shot and the exact error message.
47 |
48 | ### Automatic builds
49 | Development install exe's are created from every commit through the continual-integration system.
50 |
51 | - From https://ci.appveyor.com/project/tibold/svg-explorer-extension/history
52 | - Select a recent build showing green, then click **Artifacts**.
53 |
54 | Being dev releases, they might not work. Current status: [](https://ci.appveyor.com/project/tibold/svg-explorer-extension)
55 |
56 | ## Developer Build Environment c.2019
57 | Warning: it's about 10 GB.
58 |
59 | - QtCreator
60 | - Qt SDK - _MSVC 2017 64-bit_ using Qt Maintenance Tool installed with QtCreator. Might be problems if install MSVC 32 bit at same time. (Qt Creator & SDK: 7.2 GB)
61 | - MS Visual Studio - build tools only else many more GB. Reboots necessary, [read the notes](https://chocolatey.org/packages/visualstudio2017buildtools) (2.5 GB)
62 | - Windows SDK
63 | - Inno Setup v6
64 |
65 | [Chocolatey](https://chocolatey.org/) installation:
66 |
67 | choco install qtcreator, windows-sdk-10.-0, innosetup
68 | choco install visualstudio2017buildtools
69 | choco install visualstudio2017-workload-vctools ^
70 | --params "--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre"
71 |
72 | **Quick start** after developer env is set:
73 |
74 | git clone https://github.com/tibold/svg-explorer-extension.git
75 | cd svg-explorer-extension\deployment
76 | .\build.cmd
77 |
78 | ## History
79 | Tibold Kandrai started the project in 2012, first on Google Code, Codeplex. Life happened and Tibold didn't have time to work on it any more, though the extension continued to work more than it didn't so people kept using it.
80 |
81 | In 2017 Codeplex shut down and turned into a read-only warehouse. Matt Wilkie imported the project to GitHub and continued to maintain the project as best as a python-not-c++ guy could. The extension continued to work more than not, though the problems started to add up as Windows continued to evolve and change underfoot.
82 |
83 | In late 2019 a lucky confluence of stubborn brute force learning on Matt's part and newly active and knowledgeable contributors (Daniel, Simon, Voodoo) revived the feared soon-to-be-comatose project. Bugs were fixed and automatic binary builds came into being. Life rebounded. Right on the heels of this, Tibold regained attention time for side-projects and again assumed the project owner mantle.
84 |
85 | On 1st of January, 2020 version v1.0.0 was released including all bug fixes and up to date dependencies. Let's see where the rest of the year takes us. :-)
86 |
87 | ## Contributors ✨
88 |
89 | Thank you's for helping make this a better project _([emoji key](https://allcontributors.org/docs/en/emoji-key))_:
90 |
91 | * [Qt](https://www.qt.io/) - dev platform and libraries
92 | * [Jeremy@urk](https://www.codemonkeycodes.com/2010/01/11/ithumbnailprovider-re-visited/) - initial example
93 | * [Tibold Kandrai](https://github.com/tibold) - Project creator and primary developer
94 |
95 |
96 |
97 |
98 |
109 |
110 |
111 |
112 |
113 |
114 | [](#contributors)
115 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of all kinds welcome (code, docs, user support, ...).
116 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | ### GNU LESSER GENERAL PUBLIC LICENSE
2 |
3 | Version 3, 29 June 2007
4 |
5 | Copyright (C) 2007 Free Software Foundation, Inc.
6 |
7 |
8 | Everyone is permitted to copy and distribute verbatim copies of this
9 | license document, but changing it is not allowed.
10 |
11 | This version of the GNU Lesser General Public License incorporates the
12 | terms and conditions of version 3 of the GNU General Public License,
13 | supplemented by the additional permissions listed below.
14 |
15 | #### 0. Additional Definitions.
16 |
17 | As used herein, "this License" refers to version 3 of the GNU Lesser
18 | General Public License, and the "GNU GPL" refers to version 3 of the
19 | GNU General Public License.
20 |
21 | "The Library" refers to a covered work governed by this License, other
22 | than an Application or a Combined Work as defined below.
23 |
24 | An "Application" is any work that makes use of an interface provided
25 | by the Library, but which is not otherwise based on the Library.
26 | Defining a subclass of a class defined by the Library is deemed a mode
27 | of using an interface provided by the Library.
28 |
29 | A "Combined Work" is a work produced by combining or linking an
30 | Application with the Library. The particular version of the Library
31 | with which the Combined Work was made is also called the "Linked
32 | Version".
33 |
34 | The "Minimal Corresponding Source" for a Combined Work means the
35 | Corresponding Source for the Combined Work, excluding any source code
36 | for portions of the Combined Work that, considered in isolation, are
37 | based on the Application, and not on the Linked Version.
38 |
39 | The "Corresponding Application Code" for a Combined Work means the
40 | object code and/or source code for the Application, including any data
41 | and utility programs needed for reproducing the Combined Work from the
42 | Application, but excluding the System Libraries of the Combined Work.
43 |
44 | #### 1. Exception to Section 3 of the GNU GPL.
45 |
46 | You may convey a covered work under sections 3 and 4 of this License
47 | without being bound by section 3 of the GNU GPL.
48 |
49 | #### 2. Conveying Modified Versions.
50 |
51 | If you modify a copy of the Library, and, in your modifications, a
52 | facility refers to a function or data to be supplied by an Application
53 | that uses the facility (other than as an argument passed when the
54 | facility is invoked), then you may convey a copy of the modified
55 | version:
56 |
57 | - a) under this License, provided that you make a good faith effort
58 | to ensure that, in the event an Application does not supply the
59 | function or data, the facility still operates, and performs
60 | whatever part of its purpose remains meaningful, or
61 | - b) under the GNU GPL, with none of the additional permissions of
62 | this License applicable to that copy.
63 |
64 | #### 3. Object Code Incorporating Material from Library Header Files.
65 |
66 | The object code form of an Application may incorporate material from a
67 | header file that is part of the Library. You may convey such object
68 | code under terms of your choice, provided that, if the incorporated
69 | material is not limited to numerical parameters, data structure
70 | layouts and accessors, or small macros, inline functions and templates
71 | (ten or fewer lines in length), you do both of the following:
72 |
73 | - a) Give prominent notice with each copy of the object code that
74 | the Library is used in it and that the Library and its use are
75 | covered by this License.
76 | - b) Accompany the object code with a copy of the GNU GPL and this
77 | license document.
78 |
79 | #### 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that, taken
82 | together, effectively do not restrict modification of the portions of
83 | the Library contained in the Combined Work and reverse engineering for
84 | debugging such modifications, if you also do each of the following:
85 |
86 | - a) Give prominent notice with each copy of the Combined Work that
87 | the Library is used in it and that the Library and its use are
88 | covered by this License.
89 | - b) Accompany the Combined Work with a copy of the GNU GPL and this
90 | license document.
91 | - c) For a Combined Work that displays copyright notices during
92 | execution, include the copyright notice for the Library among
93 | these notices, as well as a reference directing the user to the
94 | copies of the GNU GPL and this license document.
95 | - d) Do one of the following:
96 | - 0) Convey the Minimal Corresponding Source under the terms of
97 | this License, and the Corresponding Application Code in a form
98 | suitable for, and under terms that permit, the user to
99 | recombine or relink the Application with a modified version of
100 | the Linked Version to produce a modified Combined Work, in the
101 | manner specified by section 6 of the GNU GPL for conveying
102 | Corresponding Source.
103 | - 1) Use a suitable shared library mechanism for linking with
104 | the Library. A suitable mechanism is one that (a) uses at run
105 | time a copy of the Library already present on the user's
106 | computer system, and (b) will operate properly with a modified
107 | version of the Library that is interface-compatible with the
108 | Linked Version.
109 | - e) Provide Installation Information, but only if you would
110 | otherwise be required to provide such information under section 6
111 | of the GNU GPL, and only to the extent that such information is
112 | necessary to install and execute a modified version of the
113 | Combined Work produced by recombining or relinking the Application
114 | with a modified version of the Linked Version. (If you use option
115 | 4d0, the Installation Information must accompany the Minimal
116 | Corresponding Source and Corresponding Application Code. If you
117 | use option 4d1, you must provide the Installation Information in
118 | the manner specified by section 6 of the GNU GPL for conveying
119 | Corresponding Source.)
120 |
121 | #### 5. Combined Libraries.
122 |
123 | You may place library facilities that are a work based on the Library
124 | side by side in a single library together with other library
125 | facilities that are not Applications and are not covered by this
126 | License, and convey such a combined library under terms of your
127 | choice, if you do both of the following:
128 |
129 | - a) Accompany the combined library with a copy of the same work
130 | based on the Library, uncombined with any other library
131 | facilities, conveyed under the terms of this License.
132 | - b) Give prominent notice with the combined library that part of it
133 | is a work based on the Library, and explaining where to find the
134 | accompanying uncombined form of the same work.
135 |
136 | #### 6. Revised Versions of the GNU Lesser General Public License.
137 |
138 | The Free Software Foundation may publish revised and/or new versions
139 | of the GNU Lesser General Public License from time to time. Such new
140 | versions will be similar in spirit to the present version, but may
141 | differ in detail to address new problems or concerns.
142 |
143 | Each version is given a distinguishing version number. If the Library
144 | as you received it specifies that a certain numbered version of the
145 | GNU Lesser General Public License "or any later version" applies to
146 | it, you have the option of following the terms and conditions either
147 | of that published version or of any later version published by the
148 | Free Software Foundation. If the Library as you received it does not
149 | specify a version number of the GNU Lesser General Public License, you
150 | may choose any version of the GNU Lesser General Public License ever
151 | published by the Free Software Foundation.
152 |
153 | If the Library as you received it specifies that a proxy can decide
154 | whether future versions of the GNU Lesser General Public License shall
155 | apply, that proxy's public statement of acceptance of any version is
156 | permanent authorization for you to choose that version for the
157 | Library.
158 |
--------------------------------------------------------------------------------