2023年8月1日 星期二

How to build the QT static version on the Windows platform?

1. Download the QT source code from the QT office website.

Download link: https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
NOTE: This example will use the version QT 5.15.2.

2. Unzip the source code to the local disk.

Example: "D:\qt-everywhere-src-5.15.2"

3. Install the depend tools and library.

The QT was depend some tools or library. By the QT 5.15.2, it was depend below list: 

Perl version 5.12 or later [http://www.activestate.com/activeperl/]

Python version 2.7 or later [http://www.activestate.com/activepython/]

Ruby version 1.9.3 or later [http://rubyinstaller.org/]

4. Open the VS2019 console.

NOTE: This example must need the VS2019 to build the QT source code. Please make sure your PC has installed the VS2019.

Launch the VS2016 console tool: "x64 Native Tools Command Prompt for VS 2019"

It will show some message like below:

 

 

 

5. Change the work folder to "D:\qt-everywhere-src-5.15.2".


$cd D:\qt-everywhere-src-5.15.2

6. Modify the source code: "qtbase\mkspecs\common\msvc-desktop.conf"

QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MD

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MD

QMAKE_CFLAGS_DEBUG = -Zi -MDd

to

QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT

QMAKE_CFLAGS_DEBUG = -Zi -MTd

7. Use the configuration tool to initialize QT code base.


$configure.bat -static -prefix "D:\Qt_static" -confirm-license -opensource -debug-and-release -platform win32-msvc -nomake examples -nomake tests  -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -qt-harfbuzz -opengl desktop -mp

NOTE: This example will set the final install path is "D:\Qt_static".

8. Download the build tool: "jom".

Download link: http://download.qt.io/official_releases/jom/jom.zip

This tool supports the multiple-core to build the source code on Windows Platform.

We assume your JOM unzip path is "D:/jom_1_1_3/jom.exe".

9. Build the QT source code.

NOTE: Please remember to change the work folder to the QT source code folder, like the "step 5".

Run the JOM in the console.

$D:/jom_1_1_3/jom.exe

10. Install the QT SDK to the local.


$nmake install

In the "step 7", we set the install path is "D:\Qt_static". After this command, it will help to install QT to this folder.

Reference: https://blog.csdn.net/zhangpeterx/article/details/105099003

2023年2月3日 星期五

Windows 10 - System Built-in MD5 Tool

certutil -hashfile <filename> <hash-mode>

certutil -?

Verbs:
 -dump          -- Dump configuration information or files
 -asn           -- Parse ASN.1 file
 -decodehex     -- Decode hexadecimal-encoded file
 -decode        -- Decode Base64-encoded file
 -encode        -- Encode file to Base64
 -deny          -- Deny pending request
 -resubmit      -- Resubmit pending request
 -setattributes -- Set attributes for pending request
 -setextension  -- Set extension for pending request
 -revoke        -- Revoke Certificate
 -isvalid       -- Display current certificate disposition
 -getconfig     -- Get default configuration string
 -ping          -- Ping Active Directory Certificate Services Request interface
 -pingadmin     -- Ping Active Directory Certificate Services Admin interface
 -CAInfo        -- Display CA Information
 -ca.cert       -- Retrieve the CA's certificate
 -ca.chain      -- Retrieve the CA's certificate chain
 -GetCRL        -- Get CRL
 -CRL           -- Publish new CRLs [or delta CRLs only]
 -shutdown      -- Shutdown Active Directory Certificate Services
 -installCert   -- Install Certification Authority certificate
 -renewCert     -- Renew Certification Authority certificate
 -schema        -- Dump Certificate Schema
 -view          -- Dump Certificate View
 -db            -- Dump Raw Database
 -deleterow     -- Delete server database row
 -backup        -- Backup Active Directory Certificate Services
 -backupDB      -- Backup Active Directory Certificate Services database
 -backupKey     -- Backup Active Directory Certificate Services certificate
                   and private key
 -restore       -- Restore Active Directory Certificate Services
 -restoreDB     -- Restore Active Directory Certificate Services database
 -restoreKey    -- Restore Active Directory Certificate Services certificate
                   and private key
 -importPFX     -- Import certificate and private key
 -dynamicfilelist -- Display dynamic file List
 -databaselocations -- Display database locations
 -hashfile      -- Generate and display cryptographic hash over a file
 -store         -- Dump certificate store
 -addstore      -- Add certificate to store
 -delstore      -- Delete certificate from store
 -verifystore   -- Verify certificate in store
 -repairstore   -- Repair key association or update certificate properties or
                   key security descriptor
 -viewstore     -- Dump certificate store
 -viewdelstore  -- Delete certificate from store
 -dsPublish     -- Publish certificate or CRL to Active Directory
 -ADTemplate    -- Display AD templates
 -Template      -- Display Enrollment Policy templates
 -TemplateCAs   -- Display CAs for template
 -CATemplates   -- Display templates for CA
 -enrollmentServerURL -- Display, add or delete enrollment server URLs associated
                   with a CA
 -ADCA          -- Display AD CAs
 -CA            -- Display Enrollment Policy CAs
 -Policy        -- Display Enrollment Policy
 -PolicyCache   -- Display or delete Enrollment Policy Cache entries
 -CredStore     -- Display, add or delete Credential Store entries
 -InstallDefaultTemplates -- Install default certificate templates
 -URLCache      -- Display or delete URL cache entries
 -pulse         -- Pulse autoenrollment events
 -MachineInfo   -- Display Active Directory machine object information
 -DCInfo        -- Display domain controller information
 -EntInfo       -- Display enterprise information
 -TCAInfo       -- Display CA information
 -SCInfo        -- Display smart card information
 -SCRoots       -- Manage smart card root certificates
 -verifykeys    -- Verify public/private key set
 -verify        -- Verify certificate, CRL or chain
 -sign          -- Re-sign CRL or certificate
 -vroot         -- Create/delete web virtual roots and file shares
 -vocsproot     -- Create/delete web virtual roots for OCSP web proxy
 -addEnrollmentServer -- Add an Enrollment Server application
 -deleteEnrollmentServer -- Delete an Enrollment Server application
 -oid           -- Display ObjectId or set display name
 -error         -- Display error code message text
 -getreg        -- Display registry value
 -setreg        -- Set registry value
 -delreg        -- Delete registry value
 -ImportKMS     -- Import user keys and certificates into server database for key
                   archival
 -ImportCert    -- Import a certificate file into the database
 -GetKey        -- Retrieve archived private key recovery blob
 -RecoverKey    -- Recover archived private key
 -MergePFX      -- Merge PFX files
 -ConvertEPF    -- Convert PFX files to EPF file
 -?             -- Display this usage message

CertUtil -?          -- Display a verb list (command list)
CertUtil -dump -?    -- Display help text for the "dump" verb
CertUtil -v -?       -- Display all help text for all verbs

CertUtil: -? command completed successfully.