*** empty log message ***
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@751 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5bec529499
commit
f757d2d832
5 changed files with 482 additions and 0 deletions
309
Examples/Modern UI/Example.nsi
Normal file
309
Examples/Modern UI/Example.nsi
Normal file
|
@ -0,0 +1,309 @@
|
|||
;NSIS Modern Style UI
|
||||
;Example Script version 1.0
|
||||
;Written by Joost Verburg
|
||||
|
||||
!define NAME "Test Software" ;Define your own software name here
|
||||
!define VERSION "1.0" ;Define your own software version here
|
||||
|
||||
!verbose 3
|
||||
!include "${NSISDIR}\Examples\WinMessages.nsh"
|
||||
!verbose 4
|
||||
|
||||
!define CURRENTPAGE $9
|
||||
|
||||
!define TEMP1 $R0
|
||||
!define TEMP2 $R1
|
||||
|
||||
;--------------------------------
|
||||
|
||||
;General
|
||||
Name "${NAME} ${VERSION}"
|
||||
OutFile "Example.exe"
|
||||
SetOverwrite on
|
||||
|
||||
;User interface
|
||||
Icon "${NSISDIR}\Contrib\Icons\adni18-installer-C-no48xp.ico"
|
||||
UninstallIcon "${NSISDIR}\Contrib\Icons\adni18-uninstall-C-no48xp.ico"
|
||||
XPStyle On
|
||||
ChangeUI all "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
SetFont Tahoma 8
|
||||
CheckBitmap "${NSISDIR}\Contrib\Icons\checks4-aa.bmp"
|
||||
|
||||
;License dialog
|
||||
LicenseText "Scroll down to see the rest of the agreement."
|
||||
LicenseData "License.txt"
|
||||
|
||||
;Component-select dialog
|
||||
ComponentText "Check the components you want to install and uncheck the components you don't want to install. Click Next to continue."
|
||||
|
||||
;Folder-select dialog
|
||||
InstallDir "$PROGRAMFILES\${NAME}"
|
||||
DirText "Setup will install ${NAME} in the following folder.$\r$\n$\r$\nTo install in this folder, click Install. To install in a different folder, click Browse and select another folder." " "
|
||||
|
||||
;Install dialog
|
||||
InstallColors /windows ;Default Windows colors for details list
|
||||
InstProgressFlags smooth
|
||||
|
||||
;Uninstaller
|
||||
UninstallText "This will uninstall ${NAME} from your system."
|
||||
|
||||
;--------------------------------
|
||||
;Installer Sections
|
||||
|
||||
Section "Copy modern.exe" SecCopyUI
|
||||
|
||||
;Add your stuff here
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section "Create uninstaller" SecCreateUninst
|
||||
|
||||
;Add your stuff here
|
||||
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
|
||||
SectionEnd
|
||||
|
||||
Section ""
|
||||
|
||||
;Invisible section to display the Finish header
|
||||
|
||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||
Call SetHeader
|
||||
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------
|
||||
;Installer Functions
|
||||
|
||||
Function .onInitDialog
|
||||
|
||||
;Set texts on inner dialogs
|
||||
|
||||
Push ${TEMP1}
|
||||
|
||||
FindWindow ${TEMP1} "#32770" "" $HWNDPARENT
|
||||
|
||||
StrCmp ${CURRENTPAGE} 1 "" +4
|
||||
GetDlgItem ${TEMP1} ${TEMP1} 1040
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "If you accept all the terms of the agreement, choose I Agree to continue. If you choose Cancel, Setup will close. You must accept the agreement to install ${NAME}."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 2 "" +4
|
||||
GetDlgItem ${TEMP1} ${TEMP1} 1042
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Description"
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 3 "" +3
|
||||
GetDlgItem ${TEMP1} ${TEMP1} 1041
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Destination Folder"
|
||||
|
||||
done:
|
||||
|
||||
Pop ${TEMP1}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function .onNextPage
|
||||
|
||||
Push ${TEMP1}
|
||||
Push ${TEMP2}
|
||||
|
||||
;Set backgrounds & fonts for the outer dialog (only once)
|
||||
StrCmp ${CURRENTPAGE} "" "" no_set_outer
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1037
|
||||
CreateFont ${TEMP2} "Tahoma" 16 1000
|
||||
SendMessage ${TEMP1} ${WM_SETFONT} ${TEMP2} 0
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1038
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1034
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1039
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
no_set_outer:
|
||||
|
||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||
|
||||
Call SetHeader
|
||||
|
||||
Pop ${TEMP2}
|
||||
Pop ${TEMP1}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function .onPrevPage
|
||||
|
||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} - 1
|
||||
|
||||
Call SetHeader
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function SetHeader
|
||||
|
||||
;Set the texts on the header (white rectangle)
|
||||
|
||||
Push ${TEMP1}
|
||||
Push ${TEMP2}
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1037
|
||||
GetDlgItem ${TEMP2} $HWNDPARENT 1038
|
||||
|
||||
StrCmp ${CURRENTPAGE} 1 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "License Agreement"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please review the license terms before installing ${NAME}."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 2 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Choose Components"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Choose the components you want to install."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 3 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Choose Install Location"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Choose the folder in which to install ${NAME} in."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 4 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Installing"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please wait while ${NAME} is being installed."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 5 "" +3
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Finished"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Setup was completed successfully."
|
||||
|
||||
done:
|
||||
|
||||
Pop ${TEMP1}
|
||||
Pop ${TEMP2}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function .onMouseOverSection
|
||||
|
||||
;Set text in Description area
|
||||
|
||||
Push ${TEMP1}
|
||||
|
||||
FindWindow ${TEMP1} "#32770" "" $HWNDPARENT
|
||||
GetDlgItem ${TEMP1} ${TEMP1} 1043
|
||||
|
||||
StrCmp $0 ${SecCopyUI} "" +3
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Copy the modern.exe file to the application folder."
|
||||
Goto done
|
||||
|
||||
StrCmp $0 ${SecCreateUninst} "" +2
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Create an uninstaller which can automatically remove ${NAME}."
|
||||
|
||||
done:
|
||||
|
||||
Pop ${TEMP1}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function .onUserAbort
|
||||
|
||||
;Warning when 'Cancel' button is pressed
|
||||
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "Are you sure you want to quit ${NAME} Setup?" IDYES quit
|
||||
Abort
|
||||
quit:
|
||||
|
||||
FunctionEnd
|
||||
|
||||
;--------------------------------
|
||||
;Uninstaller Section
|
||||
|
||||
Section "Uninstall"
|
||||
|
||||
;Add your stuff here
|
||||
|
||||
Delete "$INSTDIR\modern.exe"
|
||||
Delete "$INSTDIR\Uninstall.exe"
|
||||
|
||||
RMDir "$INSTDIR"
|
||||
|
||||
;Display the Finish header
|
||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||
Call un.SetHeader
|
||||
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------
|
||||
;Uninstaller Functions
|
||||
|
||||
Function un.onNextPage
|
||||
|
||||
Push ${TEMP1}
|
||||
Push ${TEMP2}
|
||||
|
||||
;Set backgrounds & fonts for the outer dialog (only once)
|
||||
StrCmp ${CURRENTPAGE} "" "" no_set_outer
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1037
|
||||
CreateFont ${TEMP2} "Tahoma" 16 1000
|
||||
SendMessage ${TEMP1} ${WM_SETFONT} ${TEMP2} 0
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1038
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1034
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1039
|
||||
SetStaticBkColor ${TEMP1} 0x00FFFFFF
|
||||
|
||||
no_set_outer:
|
||||
|
||||
IntOp ${CURRENTPAGE} ${CURRENTPAGE} + 1
|
||||
|
||||
Call un.SetHeader
|
||||
|
||||
Pop ${TEMP2}
|
||||
Pop ${TEMP1}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
Function un.SetHeader
|
||||
|
||||
;Set the texts on the header (white rectangle)
|
||||
|
||||
Push ${TEMP1}
|
||||
Push ${TEMP2}
|
||||
|
||||
GetDlgItem ${TEMP1} $HWNDPARENT 1037
|
||||
GetDlgItem ${TEMP2} $HWNDPARENT 1038
|
||||
|
||||
StrCmp ${CURRENTPAGE} 1 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Uninstall ${NAME}"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Remove ${NAME} from your system."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 2 "" +4
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Uninstalling"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "Please wait while ${NAME} is being uninstalled."
|
||||
Goto done
|
||||
|
||||
StrCmp ${CURRENTPAGE} 3 "" +3
|
||||
SendMessage ${TEMP1} ${WM_SETTEXT} 0 "Finished"
|
||||
SendMessage ${TEMP2} ${WM_SETTEXT} 0 "${NAME} has been removed from your system."
|
||||
|
||||
done:
|
||||
|
||||
Pop ${TEMP2}
|
||||
Pop ${TEMP1}
|
||||
|
||||
FunctionEnd
|
||||
|
||||
;eof
|
9
Examples/Modern UI/License.txt
Normal file
9
Examples/Modern UI/License.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Copyright © 2002 Joost Verburg
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any distribution.
|
164
Examples/Modern UI/Readme.html
Normal file
164
Examples/Modern UI/Readme.html
Normal file
|
@ -0,0 +1,164 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>NSIS Modern Style UI</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body
|
||||
{
|
||||
padding: 10px;
|
||||
background-color: #F0F0F0;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
center
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.maintable
|
||||
{
|
||||
border: 2px solid #53607B;
|
||||
}
|
||||
|
||||
.margin
|
||||
{
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.text
|
||||
{
|
||||
margin: 20px;
|
||||
font-size: 10pt;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
font-size: 14pt;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
color: #7A7272;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.footer
|
||||
{
|
||||
margin: 5px 5px 5px 5px;
|
||||
text-align: right;
|
||||
font-size: 8pt;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
color: #909090;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="center">
|
||||
<table width="750" cellpadding="0" cellspacing="0" class="maintable">
|
||||
<tr><td>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr class="header">
|
||||
<td><img src="Readme.png" width="750" height="80" alt=""></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><div class="margin">
|
||||
<p class="header">Introduction</p>
|
||||
<p class="text">Using KiCHiK's NSIS 2 modifications, it is possible
|
||||
to create new user interfaces for the Nullsoft Installer System.</p>
|
||||
<p class="text"> I made this interface with a modern wizard style,
|
||||
like the wizards of recent Windows versions. This new interface
|
||||
also features new icons (designed by adni18) and a description
|
||||
area on the component select dialog.</p>
|
||||
<p class="text">To use this new UI for for installer, you need
|
||||
to add some code to your NSIS script, which you can see in Example.nsi.</p>
|
||||
<p class="header">Requirements</p>
|
||||
<p class="text"><a href="http://sourceforge.net/projects/nsis2k">KiCHiK's
|
||||
NSIS 2 modifications, version 2.0 alpha 7 (or later)</a><strong>
|
||||
</strong></p>
|
||||
<p class="header">Screenshot</p>
|
||||
<p class="text"><img src="Screenshot.png" width="504" height="391" alt=""></p>
|
||||
<p class="header">How to use</p>
|
||||
<p class="text">Have a look at the example script, Example.nsi.
|
||||
This is an example of how the use this interface for your NSIS
|
||||
installer.</p>
|
||||
<p class="text">To change elements on the dialogs, modify modern.exe
|
||||
in the Contrib\UIs folder using a a resource editor such as
|
||||
<a href="http://www.users.on.net/johnson/resourcehacker/">Resource Hacker</a>.</p>
|
||||
<p class="text">This new interface uses some additional texts
|
||||
which are not included in the standard NSIS language files.
|
||||
If you want to create a multilanguage installer, you need to
|
||||
control this texts by your script.</p>
|
||||
<p class="text">The 'Loading Setup' text on the slash screen
|
||||
which is being displayed when the installer is starting (Verifying
|
||||
installer, Unpacking data when using COMPRESS_WHOLE) cannot
|
||||
be changed by the script, because the installer is not started
|
||||
yet when this dialog is being displayed. If you want to change
|
||||
this text, modify dialog 111 of modern.exe.</p>
|
||||
<p class="text">To 'verifying installer' and 'unpacking data'
|
||||
texts are defined in the language header file of the NSIS exehead
|
||||
(Source\exehead\lang.h). To change them, you need to edit this
|
||||
file and recompile NSIS.</p>
|
||||
<p class="header">Version history</p>
|
||||
<ul>
|
||||
<li class="text">1.0 - August 26th, 2002
|
||||
<ul>
|
||||
<li>Initial release
|
||||
</ul>
|
||||
</ul>
|
||||
<p class="header">Credits</p>
|
||||
<p class="text">Made by Joost Verburg.<br>
|
||||
Icons designed by Nikos Adamamas, aka adni18.<br>
|
||||
Thanks to Amir Szekely, aka KiCHiK for his NSIS modifications
|
||||
to make this possible.</p>
|
||||
<p class="header">Help</p>
|
||||
<p class="text">Please post questions at the <a href="http://forums.winamp.com/forumdisplay.php?forumid=65">NSIS
|
||||
Forum</a>.</p>
|
||||
<p class="header">License</p>
|
||||
<p class="text">Copyright © 2002 Joost Verburg</p>
|
||||
<p class="text"> This software is provided 'as-is', without any
|
||||
express or implied warranty. In no event will the authors be
|
||||
held liable for any damages arising from the use of this software.</p>
|
||||
<p class="text"> Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it
|
||||
and redistribute it freely, subject to the following restrictions:</p>
|
||||
<p class="text"> 1. The origin of this software must not be misrepresented;
|
||||
you must not claim that you wrote the original software. If
|
||||
you use this software in a product, an acknowledgment in the
|
||||
product documentation would be appreciated but is not required.<br>
|
||||
2. Altered versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.<br>
|
||||
3. This notice may not be removed or altered from any distribution.</p>
|
||||
</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="footer">©2002 Joost Verburg</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
Examples/Modern UI/Readme.png
Normal file
BIN
Examples/Modern UI/Readme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
Examples/Modern UI/Screenshot.png
Normal file
BIN
Examples/Modern UI/Screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Loading…
Add table
Add a link
Reference in a new issue