Downloader for Pelles C

Started by TimoVJL, May 02, 2025, 11:33:10 AM

Previous topic - Next topic

TimoVJL

For easy download with renamed setup.exe
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <urlmon.h>

#pragma comment(lib, "urlmon.lib")

void __cdecl mainCRTStartup(void)
{
HRESULT hRC = URLDownloadToFile(NULL, "http://www.smorgasbordet.com/pellesc/1300/setup.exe", "pocinst13.exe", BINDF_GETNEWESTVERSION, NULL);
ExitProcess(0);
}
May the source be with you

Vortex

Hi Timo,

Thanks. A small correction in your code :

DownloadPellesC13.c(9): warning #2115: Local 'hRC' is initialized but never used.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <urlmon.h>

#pragma comment(lib, "urlmon.lib")

void __cdecl mainCRTStartup(void)
{
    HRESULT hRC;
    hRC = URLDownloadToFile(NULL, "http://www.smorgasbordet.com/pellesc/1300/setup.exe", "pocinst13.exe", BINDF_GETNEWESTVERSION, NULL);
    ExitProcess(0);
}

Tested with PellesC V12
Code it... That's all...

Quin

Cool stuff. Thanks Timo, it works here! :)
Use the assembly, Luke.