This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@625 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9b3b220a13
commit
3e9e73ec59
177 changed files with 37677 additions and 0 deletions
137
Contrib/Splash/splash.c
Normal file
137
Contrib/Splash/splash.c
Normal file
|
@ -0,0 +1,137 @@
|
|||
#include <windows.h>
|
||||
|
||||
HBITMAP g_hbm;
|
||||
int sleep_val;
|
||||
int g_rv;
|
||||
|
||||
static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (uMsg == WM_CREATE)
|
||||
{
|
||||
BITMAP bm;
|
||||
RECT vp;
|
||||
GetObject(g_hbm, sizeof(bm), (LPSTR)&bm);
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &vp, 0);
|
||||
SetWindowLong(hwnd,GWL_STYLE,0);
|
||||
SetWindowPos(hwnd,NULL,
|
||||
vp.left+(vp.right-vp.left-bm.bmWidth)/2,
|
||||
vp.top+(vp.bottom-vp.top-bm.bmHeight)/2,
|
||||
bm.bmWidth,bm.bmHeight,
|
||||
SWP_NOZORDER);
|
||||
ShowWindow(hwnd,SW_SHOW);
|
||||
SetTimer(hwnd,1,sleep_val,NULL);
|
||||
return 0;
|
||||
}
|
||||
if (uMsg == WM_PAINT)
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
RECT r;
|
||||
HDC curdc=BeginPaint(hwnd,&ps);
|
||||
HDC hdc=CreateCompatibleDC(curdc);
|
||||
HBITMAP oldbm;
|
||||
GetClientRect(hwnd,&r);
|
||||
oldbm=(HBITMAP)SelectObject(hdc,g_hbm);
|
||||
BitBlt(curdc,r.left,r.top,r.right-r.left,r.bottom-r.top,hdc,0,0,SRCCOPY);
|
||||
SelectObject(hdc,oldbm);
|
||||
DeleteDC(hdc);
|
||||
EndPaint(hwnd,&ps);
|
||||
return 0;
|
||||
}
|
||||
if (uMsg == WM_CLOSE) return 0;
|
||||
if (uMsg == WM_DESTROY)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
if (uMsg == WM_TIMER || uMsg == WM_LBUTTONDOWN)
|
||||
{
|
||||
g_rv=(uMsg == WM_LBUTTONDOWN);
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
return DefWindowProc(hwnd,uMsg,wParam,lParam);
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow)
|
||||
{
|
||||
char fn[MAX_PATH];
|
||||
int hwndParent;
|
||||
char *o=fn;
|
||||
|
||||
hInstance=GetModuleHandle(NULL);
|
||||
lpszCmdParam=GetCommandLine();
|
||||
if (*lpszCmdParam == '\"')
|
||||
{
|
||||
do
|
||||
{
|
||||
lpszCmdParam++;
|
||||
} while (*lpszCmdParam != '\"' && *lpszCmdParam);
|
||||
if (*lpszCmdParam) lpszCmdParam++;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
lpszCmdParam++;
|
||||
} while (*lpszCmdParam != ' ' && *lpszCmdParam);
|
||||
}
|
||||
while (*lpszCmdParam == ' ') lpszCmdParam++;
|
||||
sleep_val=0;
|
||||
while (*lpszCmdParam >= '0' && *lpszCmdParam <= '9')
|
||||
{
|
||||
sleep_val*=10;
|
||||
sleep_val += *lpszCmdParam++-'0';
|
||||
}
|
||||
|
||||
while (*lpszCmdParam == ' ') lpszCmdParam++;
|
||||
hwndParent=0;
|
||||
while (*lpszCmdParam >= '0' && *lpszCmdParam <= '9')
|
||||
{
|
||||
hwndParent*=10;
|
||||
hwndParent += *lpszCmdParam++-'0';
|
||||
}
|
||||
|
||||
while (*lpszCmdParam == ' ') lpszCmdParam++;
|
||||
while (*lpszCmdParam)
|
||||
{
|
||||
*o++=*lpszCmdParam++;
|
||||
}
|
||||
*o=0;
|
||||
|
||||
if (fn[0] && sleep_val>0)
|
||||
{
|
||||
MSG msg;
|
||||
char classname[4]="_sp";
|
||||
static WNDCLASS wc;
|
||||
wc.lpfnWndProc = WndProc;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hCursor = LoadCursor(NULL,IDC_ARROW);
|
||||
wc.lpszClassName = classname;
|
||||
if (RegisterClass(&wc))
|
||||
{
|
||||
char fn2[MAX_PATH];
|
||||
lstrcpy(fn2,fn);
|
||||
lstrcat(fn,".bmp");
|
||||
lstrcat(fn2,".wav");
|
||||
g_hbm=LoadImage(NULL,fn,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION|LR_LOADFROMFILE);
|
||||
if (g_hbm)
|
||||
{
|
||||
BOOL s=0;
|
||||
HANDLE f=CreateFile(fn2,0,0,NULL,OPEN_EXISTING,0,NULL);
|
||||
if (f != INVALID_HANDLE_VALUE) { CloseHandle(f); s=PlaySound(fn2,NULL,SND_ASYNC|SND_FILENAME); }
|
||||
|
||||
CreateWindowEx(WS_EX_TOOLWINDOW,classname,classname,
|
||||
0,0,0,0,0,(HWND)hwndParent,NULL,hInstance,NULL);
|
||||
|
||||
while (GetMessage(&msg,NULL,0,0))
|
||||
{
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
if (s) PlaySound(NULL,0,0);
|
||||
|
||||
DeleteObject(g_hbm);
|
||||
}
|
||||
}
|
||||
}
|
||||
ExitProcess(g_rv);
|
||||
}
|
108
Contrib/Splash/splash.dsp
Normal file
108
Contrib/Splash/splash.dsp
Normal file
|
@ -0,0 +1,108 @@
|
|||
# Microsoft Developer Studio Project File - Name="splash" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=splash - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "splash.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "splash.mak" CFG="splash - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "splash - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "splash - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "splash - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /Og /Os /Oy /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
|
||||
# SUBTRACT CPP /Ox /Ow /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /entry:"WinMain" /subsystem:windows /machine:I386 /nodefaultlib /out:"../../splash.exe" /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "splash - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "splash - Win32 Release"
|
||||
# Name "splash - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\splash.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
29
Contrib/Splash/splash.dsw
Normal file
29
Contrib/Splash/splash.dsw
Normal file
|
@ -0,0 +1,29 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "splash"=.\splash.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
38
Contrib/Splash/splash.txt
Normal file
38
Contrib/Splash/splash.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
Splash.exe - small (3.5k), simple (one file) program that lets you throw
|
||||
up a splash screen in NSIS installers.
|
||||
|
||||
--- UPDATED in 1.50 - will break old scripts ---
|
||||
|
||||
To use:
|
||||
|
||||
Create a .BMP file of your splash screen.
|
||||
(optional) Create a .WAV file to play while your splash screen shows.
|
||||
|
||||
Add the following lines to your .NSI file:
|
||||
|
||||
Function .onInit
|
||||
SetOutPath $TEMP
|
||||
File /oname=spltmp.bmp "my_splash.bmp"
|
||||
|
||||
; optional
|
||||
; File /oname=spltmp.wav "my_splashshit.wav"
|
||||
|
||||
File /oname=spltmp.exe "C:\program files\nsis\splash.exe"
|
||||
ExecWait '"$TEMP\spltmp.exe" 1000 $HWNDPARENT $TEMP\spltmp'
|
||||
Delete $TEMP\spltmp.exe
|
||||
Delete $TEMP\spltmp.bmp
|
||||
; Delete $TEMP\spltmp.wav
|
||||
FunctionEnd
|
||||
|
||||
Note that the first parameter to splash.exe is the length to show the
|
||||
screen for (in milliseconds), the second is the parent window (in decimal),
|
||||
and the last is the splash bitmap filename (without the .bmp). The BMP file
|
||||
used will be this parameter.bmp, and the wave file used (if present) will be
|
||||
this parameter.wav.
|
||||
|
||||
(If you already have an .onInit function, put that in it)
|
||||
|
||||
Note: the return value of splash.exe is 1 if the user closed the splash
|
||||
screen early (you can check it using ClearErrors/IfErrors)
|
||||
|
||||
-Justin
|
Loading…
Add table
Add a link
Reference in a new issue