Added /LAUNCH compiler switch
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7292 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
67f14f9b0b
commit
0be4164270
5 changed files with 22 additions and 2 deletions
|
@ -14,6 +14,8 @@ Released on ???? ??th, 20??
|
|||
|
||||
\b Disallow start maximized mode
|
||||
|
||||
\b Added /LAUNCH compiler switch
|
||||
|
||||
\H{v3.07} 3.07
|
||||
|
||||
Released on July 24th, 2021
|
||||
|
|
|
@ -19,6 +19,8 @@ If you want to use MakeNSIS on the command line, the syntax of makensis is:
|
|||
|
||||
\b The /O switch followed by a filename tells the compiler to print its log to that file (instead of the screen)
|
||||
|
||||
\b /LAUNCH executes the generated installer.
|
||||
|
||||
\b /PAUSE makes makensis pause before quitting, which is useful when executing directly from Windows.
|
||||
|
||||
\b /NOCONFIG disables inclusion of nsisconf.nsh. Without this parameter, installer defaults are set from nsisconf.nsh.
|
||||
|
|
|
@ -57,6 +57,7 @@ libs = Split("""
|
|||
iconv
|
||||
shlwapi
|
||||
oleaut32
|
||||
shell32
|
||||
""")
|
||||
|
||||
Import('env AddAvailableLibs AddZLib')
|
||||
|
|
|
@ -253,6 +253,7 @@ class CEXEBuild {
|
|||
unsigned int get_header_size() const { return (unsigned int)sizeof(header) + (is_target_64bit() ? (4 * BLOCKS_NUM) : 0); }
|
||||
|
||||
void set_default_output_filename(const tstring& filename);
|
||||
const TCHAR* get_output_filename() const { return build_output_filename; }
|
||||
|
||||
// process a script (you can process as many scripts as you want,
|
||||
// it is as if they are concatenated)
|
||||
|
|
|
@ -181,6 +181,7 @@ static void print_usage()
|
|||
_T(" ") OPT_STR _T("Vx verbosity where x is 4=all,3=no script,2=no info,1=no warnings,0=none\n")
|
||||
_T(" ") OPT_STR _T("WX treat warnings as errors\n")
|
||||
_T(" ") OPT_STR _T("Ofile specifies a text file to log compiler output (default is stdout)\n")
|
||||
_T(" ") OPT_STR _T("LAUNCH executes the generated installer\n")
|
||||
_T(" ") OPT_STR _T("PAUSE pauses after execution\n")
|
||||
_T(" ") OPT_STR _T("NOCONFIG disables inclusion of <path to makensis.exe>") PLATFORM_PATH_SEPARATOR_STR _T("nsisconf.nsh\n")
|
||||
_T(" ") OPT_STR _T("NOCD disables the current directory change to that of the .nsi file\n")
|
||||
|
@ -309,7 +310,7 @@ static inline int makensismain(int argc, TCHAR **argv)
|
|||
const TCHAR*stdoutredirname=0;
|
||||
NStreamEncoding inputenc, &outputenc = g_outputenc;
|
||||
int argpos=0;
|
||||
bool do_cd=true, noconfig=false;
|
||||
unsigned char do_cd=true, noconfig=false, do_exec=false;
|
||||
bool no_logo=true, warnaserror=false;
|
||||
bool initialparsefail=false, in_files=false;
|
||||
bool oneoutputstream=false;
|
||||
|
@ -467,8 +468,9 @@ static inline int makensismain(int argc, TCHAR **argv)
|
|||
if (!_tcsicmp(swname,_T("PPO")) || !_tcsicmp(swname,_T("SafePPO"))) {} // Already parsed
|
||||
else if (!_tcsicmp(swname,_T("WX"))) {} // Already parsed
|
||||
else if (!_tcsicmp(swname,_T("NOCD"))) do_cd=false;
|
||||
else if (!_tcsicmp(swname,_T("NOCONFIG"))) noconfig=true;
|
||||
else if (!_tcsicmp(swname,_T("NOCONFIG"))) noconfig++;
|
||||
else if (!_tcsicmp(swname,_T("PAUSE"))) g_dopause=true;
|
||||
else if (!_tcsicmp(swname,_T("LAUNCH"))) do_exec++;
|
||||
else if (!_tcsicmp(swname,_T("HELP")))
|
||||
{
|
||||
print_usage();
|
||||
|
@ -670,6 +672,18 @@ static inline int makensismain(int argc, TCHAR **argv)
|
|||
build.ERROR_MSG(_T("Error - aborting creation process\n"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (do_exec)
|
||||
{
|
||||
const TCHAR *app = build.get_output_filename();
|
||||
#ifdef _WIN32
|
||||
ShellExecute(0, 0, app, 0, 0, SW_SHOW);
|
||||
#else
|
||||
const TCHAR *cmd = _tgetenv(_T("NSISLAUNCHCOMMAND"));
|
||||
sane_system(replace_all(cmd ? cmd : _T("wine start '%1'"), _T("%1"), app).c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue