[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nsis-commits
Subject:    [NSIS-commits] SF.net SVN: nsis:[6452] NSIS/trunk
From:       anders_k () users ! sourceforge ! net
Date:       2014-03-28 16:17:08
Message-ID: E1WTZSy-00069H-BG () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 6452
          http://sourceforge.net/p/nsis/code/6452
Author:   anders_k
Date:     2014-03-28 16:17:07 +0000 (Fri, 28 Mar 2014)
Log Message:
-----------
Added CreateShortcut /NoWorkingDir optional parameter

Modified Paths:
--------------
    NSIS/trunk/Docs/src/generalpurpose.but
    NSIS/trunk/Docs/src/history.but
    NSIS/trunk/Source/exehead/exec.c
    NSIS/trunk/Source/script.cpp
    NSIS/trunk/Source/tokens.cpp

Modified: NSIS/trunk/Docs/src/generalpurpose.but
===================================================================
--- NSIS/trunk/Docs/src/generalpurpose.but	2014-03-10 00:06:42 UTC (rev 6451)
+++ NSIS/trunk/Docs/src/generalpurpose.but	2014-03-28 16:17:07 UTC (rev 6452)
@@ -35,12 +35,12 @@
 
 \S2{createshortcut} CreateShortCut
 
-\c link.lnk target.file [parameters [icon.file [icon_index_number [start_options \
[keyboard_shortcut [description]]]]]] +\c [/NoWorkingDir] link.lnk target.file \
[parameters [icon.file [icon_index_number [start_options [keyboard_shortcut \
[description]]]]]]  
 Creates a shortcut 'link.lnk' that links to 'target.file', with optional parameters \
'parameters'.  The icon used for the shortcut is 'icon.file,icon_index_number'; for \
default icon settings use empty strings for both icon.file and icon_index_number.  \
start_options should be one of: \e{SW_SHOWNORMAL}, \e{SW_SHOWMAXIMIZED}, \
                \e{SW_SHOWMINIMIZED}, or an empty string.
-keyboard_shortcut should be in the form of 'flag|c' where flag can be a combination \
(using |) of: \e{ALT}, \e{CONTROL}, \e{EXT}, or \e{SHIFT}. c is the character to use \
(a-z, A-Z, 0-9, F1-F24, etc). Note that no spaces are allowed in this string. A good \
example is "ALT|CONTROL|F8". $OUTDIR is used for the working directory. You can \
change it by using \R{setoutpath}{SetOutPath} before creating the Shortcut. \
+keyboard_shortcut should be in the form of 'flag|c' where flag can be a combination \
(using |) of: \e{ALT}, \e{CONTROL}, \e{EXT}, or \e{SHIFT}. c is the character to use \
(a-z, A-Z, 0-9, F1-F24, etc). Note that no spaces are allowed in this string. A good \
example is "ALT|CONTROL|F8". $OUTDIR is used for the working directory. You can \
change it by using \R{setoutpath}{SetOutPath} before creating the Shortcut or use \
/NoWorkingDir if you don't need to set the working directory.  description should be \
the description of the shortcut, or comment as it is called under XP.  The error flag \
is set if the shortcut cannot be created (i.e. either of the paths (link or target) \
does not exist, or some other error).  

Modified: NSIS/trunk/Docs/src/history.but
===================================================================
--- NSIS/trunk/Docs/src/history.but	2014-03-10 00:06:42 UTC (rev 6451)
+++ NSIS/trunk/Docs/src/history.but	2014-03-28 16:17:07 UTC (rev 6452)
@@ -14,6 +14,8 @@
 
 \S2{} Minor Changes
 
+\b Added CreateShortcut /NoWorkingDir parameter
+
 \b Added Int<32|64|Ptr><Op|Cmp[U]> helper macros to Util.nsh
 
 \b Added P<, P<=, P=, P<>, P>= and P> LogicLib ptrdiff_t tests

Modified: NSIS/trunk/Source/exehead/exec.c
===================================================================
--- NSIS/trunk/Source/exehead/exec.c	2014-03-10 00:06:42 UTC (rev 6451)
+++ NSIS/trunk/Source/exehead/exec.c	2014-03-28 16:17:07 UTC (rev 6452)
@@ -1069,8 +1069,8 @@
         if (SUCCEEDED(hres))
         {
           hres = psl->lpVtbl->SetPath(psl,buf2);
-          psl->lpVtbl->SetWorkingDirectory(psl,state_output_directory);
-          if ((parm4&0xff00)>>8) psl->lpVtbl->SetShowCmd(psl,(parm4&0xff00)>>8);
+          if (!(parm4&0x8000)) \
psl->lpVtbl->SetWorkingDirectory(psl,state_output_directory); +          if \
((parm4&0x7f00)>>8) psl->lpVtbl->SetShowCmd(psl,(parm4&0x7f00)>>8);  \
psl->lpVtbl->SetHotkey(psl,(unsigned short)(parm4>>16));  if (buf3[0]) \
psl->lpVtbl->SetIconLocation(psl,buf3,parm4&0xff);  \
psl->lpVtbl->SetArguments(psl,buf0);

Modified: NSIS/trunk/Source/script.cpp
===================================================================
--- NSIS/trunk/Source/script.cpp	2014-03-10 00:06:42 UTC (rev 6451)
+++ NSIS/trunk/Source/script.cpp	2014-03-28 16:17:07 UTC (rev 6452)
@@ -4381,13 +4381,15 @@
 #endif//!NSIS_SUPPORT_MESSAGEBOX
     case TOK_CREATESHORTCUT:
 #ifdef NSIS_SUPPORT_CREATESHORTCUT
+    {
       ent.which=EW_CREATESHORTCUT;
+      int noLnkWorkDir=0, s;
+      if (!_tcsicmp(line.gettoken_str(1),_T("/NoWorkingDir"))) line.eattoken(), \
noLnkWorkDir++;  ent.offsets[0]=add_string(line.gettoken_str(1));
       ent.offsets[1]=add_string(line.gettoken_str(2));
       ent.offsets[2]=add_string(line.gettoken_str(3));
       ent.offsets[3]=add_string(line.gettoken_str(4));
       ent.offsets[5]=add_string(line.gettoken_str(8));
-      int s;
       ent.offsets[4]=line.gettoken_int(5,&s)&0xff;
       if (!s)
       {
@@ -4398,6 +4400,7 @@
         }
         ent.offsets[4]=0;
       }
+      if (noLnkWorkDir) ent.offsets[4] |= 0x8000;
       if (line.getnumtokens() > 6 && *line.gettoken_str(6))
       {
         int tab[3]={SW_SHOWNORMAL,SW_SHOWMAXIMIZED,SW_SHOWMINNOACTIVE/*SW_SHOWMINIMIZED \
doesn't work*/}; @@ -4407,7 +4410,7 @@
           ERROR_MSG(_T("CreateShortCut: unknown show mode \"%") NPRIs \
_T("\"\n"),line.gettoken_str(6));  PRINTHELP()
         }
-        ent.offsets[4]|=tab[a]<<8;
+        ent.offsets[4] |= tab[a]<<8;
       }
       if (line.getnumtokens() > 7)
       {
@@ -4453,6 +4456,7 @@
 
       DefineInnerLangString(NLF_CREATE_SHORTCUT);
       DefineInnerLangString(NLF_ERR_CREATING_SHORTCUT);
+    }
     return add_entry(&ent);
 #else//!NSIS_SUPPORT_CREATESHORTCUT
       ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_CREATESHORTCUT not \
defined.\n"),  line.gettoken_str(0));

Modified: NSIS/trunk/Source/tokens.cpp
===================================================================
--- NSIS/trunk/Source/tokens.cpp	2014-03-10 00:06:42 UTC (rev 6451)
+++ NSIS/trunk/Source/tokens.cpp	2014-03-28 16:17:07 UTC (rev 6452)
@@ -58,7 +58,7 @@
 {TOK_CRCCHECK,_T("CRCCheck"),1,0,_T("(on|force|off)"),TP_GLOBAL},
 {TOK_CREATEDIR,_T("CreateDirectory"),1,0,_T("directory_name"),TP_CODE},
 {TOK_CREATEFONT,_T("CreateFont"),2,5,_T("$(user_var: handle output) face_name \
                [height weight /ITALIC /UNDERLINE /STRIKE]"),TP_CODE},
-{TOK_CREATESHORTCUT,_T("CreateShortCut"),2,6,_T("shortcut_name.lnk shortcut_target \
[parameters [icon_file [icon index [showmode [hotkey [comment]]]]]]\n    \
showmode=(SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED)\n    \
hotkey=(ALT|CONTROL|EXT|SHIFT)|(F1-F24|A-Z)"),TP_CODE}, \
+{TOK_CREATESHORTCUT,_T("CreateShortCut"),2,6,_T("[/NoWorkingDir] shortcut_name.lnk \
shortcut_target [parameters [icon_file [icon index [showmode [hotkey [comment]]]]]]\n \
showmode=(SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED)\n    \
hotkey=(ALT|CONTROL|EXT|SHIFT)|(F1-F24|A-Z)"),TP_CODE},  \
{TOK_DBOPTIMIZE,_T("SetDatablockOptimize"),1,0,_T("(off|on)"),TP_ALL},  \
{TOK_DELETEINISEC,_T("DeleteINISec"),2,0,_T("ini_file section_name"),TP_CODE},  \
{TOK_DELETEINISTR,_T("DeleteINIStr"),3,0,_T("ini_file section_name \
entry_name"),TP_CODE},

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
NSIS-commits mailing list
NSIS-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nsis-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic