|
|
#1 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
how to use library WinSCard with NSIS
hello,
I try to use this function: lReturn = SCardEstablishContext(SCARD_SCOPE_USER, NULL, NULL, phSC); with NSIS! i try: !define SCardListReaders "Advapi32::SCardListReaders(l,t,*t,*l) i" System::Call "${SCardEstablishContext}(${SCARD_SCOPE_USER},0, 0, .r0) .r1" It's not work! CAn you help me, please?? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
|
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Also * isn't used for pointers. Just use i or l.
Stu |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
MSDN says these functions are in Winscard, not Advapi32.
You also can't just use random windows constants/defines, you need to !define them because nsis does not mirror the entire windows sdk! Maybe something like: code: Note: I have never used the Winscard API and I'm coding this in the forum reply box without testing so there are probably bugs! Afrow:* are for pointers, but t is a pointer already on the "winapi side" of system.dll IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
thanks for your answer!
I'm going to test this code! |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
IT'S WORK!
I love you! Thanks YOU |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Thanks Anders. I'm a little confused with p now. Is that for handles (HANDLE, PVOID etc)? For example, in the System readme under Copy -> Usage example, p has been used for returning a pointer to the allocated buffer "allocate a buffer and put 'test string' and an int in it". I think that's a typo? Shouldn't it be i? p certainly doesn't work when I try it...
Stu |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Afrow: p is only a valid type in "2.47" (eg SVN only at this point) (Why the online docs are the svn version and not just the latest stable version, I don't know) And yes, they are for pointers like handle/void* etc
As far as * goes, if you had a C function like: void foo(HANDLE p1,HANDLE*p2) the system syntax would be System::Call foodll::foo(p [???],*p [???|.][???]) Ex: System::Call foodll::foo(p $somehandlevalue,*p.r2) ... (p2 input: function foo gets a pointer to a pointer-sized memory location with undefined contents. p2 output: lets say foo() did: *p2=p1->somevalue;, after the call returns, $2 contains the same value as p1->somevalue) IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Ah that explains all. Thanks again.
Stu |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
Hey guys,,
I have 2 questions: Firstly, I want to cut a string, for example : "C:\Mes documents\hahaha.txt" => "hahaha.txt" Secondly, I don't want to have a lot of directory with my NSIS.exe! I want to have one file only . With my exe, i have 2 directory. for example, in one directory , i have the exe of java! It's possible to do that????? |
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
1. http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.16
2. Have you had a look at the examples? http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5 Stu |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
Hey,
I have a new question! I have a .ini file! I want to configure the .ini after execute my setup but he have to do a new compilation. Is it possible to modify the .ini file after the compilation??????? |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: May 2010
Posts: 6
|
Sorry, i have the answer.
I don't give the true path |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|