- NSIS Discussion
- Problem with pluggins
Archive: Problem with pluggins
RaulFlores
4th April 2006 18:36 UTC
Problem with pluggins
Hello Everybody.
I have a problem with my installer I try to use two pluggins but they use the same variable $1 How can I change this variable?
I need to use this pluggins for my installer
FontName.nsh
FileFunc.nsh
WriteEnvStr.nsh
Afrow UK
4th April 2006 19:26 UTC
In what way are they using $1? Do they use it internally, or by how you are using them?
Some sample code would help us identify the problem and produce a solution.
-Stu
RaulFlores
4th April 2006 21:01 UTC
Hello I send you the code of my installer
RaulFlores
4th April 2006 21:08 UTC
Sorry a forget the file. But I send you.
The file contains my intaller and the pluggins that I used
Afrow UK
4th April 2006 22:21 UTC
I still don't understand what the problem is. You aren't even using $1 in any of your own code and the BgImage plugin doesn't use it.
If you want to use $1 in your script and find that something is changing its value, just use a different variable or perhaps create your own with the Var instruction.
-Stu
RaulFlores
5th April 2006 19:11 UTC
Thanks a lot I sorted out the problem with my installer. but I have another problem, when I try to create a Shortcut with this instruction
CreateShortCut "$DESKTOP\SIG-TC ZMVM.lnk" "$BLA" ""
The variable $BLA contains the value
"C:\Archivos de programa\TransCAD\tcw.exe" -q -a C:\SIG-TC\compilacion\gis-tc -ai SIG-TC -n "SIG-Transporte de carga ZMVM"
But when the installer creates the shortcut on the DESKTOP, it has this value:
"C:\"C:\Archivos de programa\TransCAD\tcw.exe" -q -a C:\SIG-TC\compilacion\gis-tc -ai SIG-TC -n "SIG-Transporte de carga ZMVM" "
How I can clear value "C:\ at the begining of the string and " in the last part?
JasonFriday13
6th April 2006 03:41 UTC
Try using ' around the value.
'"C:\Archivos de programa\TransCAD\tcw.exe" -q -a C:\SIG-TC\compilacion\gis-tc -ai SIG-TC -n "SIG-Transporte de carga ZMVM"'
Afrow UK
6th April 2006 09:09 UTC
CreateShortCut requires the parameters to be separate from the target path:
CreateShortCut
link.lnk target.file [parameters [icon.file [icon_index_number [start_options [keyboard_shortcut [description]]]]]]
Where does your target path come from exactly?
Is it a constant value set at compile time or a path read from somewhere at run time?
-Stu
RaulFlores
6th April 2006 19:02 UTC
Hello
I send you a basic example, it only creates a Shortcut on the desktop.
In the code I read from the registry, this value is the target path that I want in the shortcut, but I don't know why in the shorcut the value appears like this:
"C:\"C:\Archivos de programa\Microsoft Office\OFFICE11\WINWORD.EXE" \n \dde"
And the correct path is:
"C:\Archivos de programa\Microsoft Office\OFFICE11\WINWORD.EXE" \n \dde
Thanks a lot for help me
Afrow UK
6th April 2006 19:20 UTC
Well like I've already said, CreateShortCut must be like the following:
CreateShortCut "icon file.lnk" "target file.exe" "parameters"
Use this function to get the path in the quotes:
http://nsis.sourceforge.net/GetInQuo...between_quotes
If you need the parameters as well, I can probably update the function to return the rest of the string not in quotes (in this case it'd be the parameters).
ReadRegStr $R0 HKLM SOFTWARE\Classes\Applications\WINWORD.EXE\shell\edit\command ""
Push $R0
Call GetInQuotes
Pop $R0
CreateShortCut "$DESKTOP\TEST.lnk" $R0
-Stu
RaulFlores
6th April 2006 21:46 UTC
Hello Again Thaks a lot for help me.
I did all that you said me. but the target path now is:
"C:\Archivos de programa\Microsoft Office\OFFICE11\WINWORD.EXE"
and the correct is
"C:\Archivos de programa\Microsoft Office\OFFICE11\WINWORD.EXE" \n \dde
How can I obtain the rest of the string not in quotes?
I send you again my code
Thanks
RaulFlores
6th April 2006 22:01 UTC
Code of TEST
galil
7th April 2006 02:23 UTC
Assuming that the path part of the string you read from registry is always in quotes...
!include "StrFunc.nsh"
${StrStrAdv}
Name "Test"
OutFile "Test.exe"
Section ""
ReadRegStr $0 HKLM SOFTWARE\Classes\Applications\WINWORD.EXE\shell\edit\command ""
${StrStrAdv} $R0 $0 "$\" " > < 1 0 0 #get path
${StrStrAdv} $R1 $0 "$\" " > > 0 0 0 #get the rest
StrCpy $R0 $R0 -1 #trim ending space character from path
CreateShortCut "$DESKTOP\TEST.lnk" $R0 $R1
SectionEnd
RaulFlores
7th April 2006 04:48 UTC
Thanks for help me. My installer is OK