Skip to content

Instantly share code, notes, and snippets.

View marakew's full-sized avatar

John Doe marakew

View GitHub Profile
@marakew
marakew / portable-msvc.py
Last active May 15, 2026 15:40
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio
#
# original https://gist.github.com/mmozeiko/7f3162ec2988e81e56d5c4e22cde9977
# + append more verbose info
#
#run_show.cmd
#D:\Python38\python.exe portable-msvc.py --insiders --preview --vs=latest --show-versions
#run_download_sdk.cmd
#rem D:\Python38\python.exe portable-msvc.py --insiders --preview --vs=latest --accept-license --sdk-version 18362
#D:\Python38\python.exe portable-msvc.py --insiders --preview --vs=latest --accept-license --sdk-version 26100
#run_download_msvc.cmd
#if defined(_WIN32)
//jrtplib
inline unsigned __int64 CalculateFileTime(unsigned __int64 performancecount, unsigned __int64 performancefrequency)
{
unsigned __int64 f = performancefrequency;
unsigned __int64 a = performancecount;
unsigned __int64 b = a/f;
unsigned __int64 c = a%f; // a = b*f+c => (a*10'000'000)/f = b*10'000'000+(c*10'000'000)/f