From 0257d4fbc50f4aecfcc496021c37a0574b7616bc Mon Sep 17 00:00:00 2001 From: rainwater Date: Tue, 1 Oct 2002 23:03:34 +0000 Subject: [PATCH] Renamed nsisconf.nsi to nsisconf.nsh since it is really a include file. The NSIS installer will rename the nsisconf.nsi file to nsh if present to prevent upgrade issues. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1259 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/script.but | 2 +- Docs/src/usage.but | 2 +- Examples/makensis.nsi | 6 ++++-- Source/makenssi.cpp | 4 ++-- nsisconf.nsh | 21 +++++++++++++++++++++ 5 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 nsisconf.nsh diff --git a/Docs/src/script.but b/Docs/src/script.but index 0f185ee8..13f6cec9 100644 --- a/Docs/src/script.but +++ b/Docs/src/script.but @@ -32,4 +32,4 @@ A NSIS Script File (.nsi) is just a text file with a series of commands. \c you created that you want to keep, click No)" \ \c IDNO NoRemoveLabel -\b If a file named "nsisconf.nsi" in the same directory as makensis.exe exists, it will be included by default before any scripts (unless the /NOCONFIG command line parameter is used. \ No newline at end of file +\b If a file named "nsisconf.nsh" in the same directory as makensis.exe exists, it will be included by default before any scripts (unless the /NOCONFIG command line parameter is used. \ No newline at end of file diff --git a/Docs/src/usage.but b/Docs/src/usage.but index 755d793e..03068600 100644 --- a/Docs/src/usage.but +++ b/Docs/src/usage.but @@ -13,7 +13,7 @@ NSIS installers are generated by using the 'MakeNSIS' program to compile a NSIS \b /PAUSE makes Makensis pause before quitting, which is useful when executing directly from Windows (the auto-installed shell extensions use it). -\b /NOCONFIG disables inclusion of [path to makensis.exe]\\nsisconf.nsi . Without this parameter, installer defaults are set from nsisconf.nsi. See NSIS Configuration File. +\b /NOCONFIG disables inclusion of [path to makensis.exe]\\nsisconf.nsh . Without this parameter, installer defaults are set from nsisconf.nsi. See NSIS Configuration File. \b /CMDHELP prints basic usage information for command (if specified), or all commands (if command is not specified). diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi index 672f26e0..9b9bcfa2 100644 --- a/Examples/makensis.nsi +++ b/Examples/makensis.nsi @@ -47,8 +47,10 @@ Section "NSIS Development System (required)" SecCore File ..\makensisw.exe File ..\makensis.htm File ..\license.txt + IfFileExists $INSTDIR\nsisconf.nsi "" +2 + Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh SetOverwrite off - File ..\nsisconf.nsi + File ..\nsisconf.nsh SetOverwrite try SetOutPath $INSTDIR\Docs @@ -62,7 +64,6 @@ SectionEnd Section "NSIS Examples (recommended)" SecExample SectionIn 1 2 3 SetOutPath $INSTDIR\Examples - Delete $INSTDIR\*.nsh Delete $INSTDIR\viewhtml.nsi Delete $INSTDIR\waplugin.nsi Delete $INSTDIR\example*.nsi @@ -657,6 +658,7 @@ Section Uninstall Delete $INSTDIR\license.txt Delete $INSTDIR\uninst-nsis.exe Delete $INSTDIR\nsisconf.nsi + Delete $INSTDIR\nsisconf.nsh Delete $INSTDIR\Examples\makensis.nsi Delete $INSTDIR\Examples\example1.nsi Delete $INSTDIR\Examples\example2.nsi diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp index 071d8806..0f6204e8 100644 --- a/Source/makenssi.cpp +++ b/Source/makenssi.cpp @@ -247,7 +247,7 @@ int main(int argc, char **argv) while (*p) p++; while (p > exepath && *p != '\\') p=CharPrev(exepath,p); if (p>exepath) p++; - strcpy(p,"nsisconf.nsi"); + strcpy(p,"nsisconf.nsh"); FILE *cfg=fopen(exepath,"rt"); if (cfg) { @@ -370,7 +370,7 @@ int main(int argc, char **argv) " /Vx verbosity where x is 4=all,3=no script,2=no info,1=no warnings,0=none\n" " /Ofile specifies a text file to log compiler output (default is stdout)\n" " /PAUSE pauses after execution\n" - " /NOCONFIG disables inclusion of \\nsisconf.nsi\n" + " /NOCONFIG disables inclusion of \\nsisconf.nsh\n" " /CD makes makensis change the current directory to that of the .nsi file\n" " /Ddefine[=value] defines the symbol \"define\" for the script [to value]\n" " /Xscriptcmd executes scriptcmd in script (i.e. \"/XOutFile poop.exe\")\n" diff --git a/nsisconf.nsh b/nsisconf.nsh new file mode 100644 index 00000000..3cb657e4 --- /dev/null +++ b/nsisconf.nsh @@ -0,0 +1,21 @@ +; this file sets the defaults that will be used +; this file is treated as if it is in the directory +; that you are building from. i.e. the command +; File whatever.dat +; would need whatever.dat to be in your build directory +; (not necessarily the same directory as this file) + +; if you want to change the default icon or bitmaps, you can do it here. +;Icon "${NSISDIR}\Contrib\Icons\setup.ico" +;CheckBitmap "${NSISDIR}\Contrib\Icons\checks4.bmp" + +; if you want to define symbols, whatever, you can do that to. +;!define poo + +;use one of these if you have upx or petite installed +;note that your exe packer should not pack the first icon :) +;and paths should ideally be absolute (since you could be +;building your installer anywhere) + +;!packhdr tmp.dat "C:\program files\upx\upx -9 -q tmp.dat" +;!packhdr tmp.dat "C:\program files\petite\petite -9 -b0 -r** -p0 -y tmp.dat"