|
|
#1 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
Call::DLL ???
HI there,
I really need help for this section : PHP Code:
PHP Code:
Thanks! Last edited by Inazad; 21st May 2009 at 17:51. |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
Call DLL ??
Section -BD
Call CreateDatabaseAndBasicData File Crypto.dll System::Call 'Crypto::GeneratePWDSecurityString(v) (v).EncryptionKey' System::Call 'Crypto::EncodePWDEx(t, t) t(.BdUser, .EncryptionKey).BdUser' System::Call 'Crypto::EncodePWDEx(t, t) t(.BdPass, .EncryptionKey).BdPass' SectionEnd There is the declaration of my dll' functions : string GeneratePWDSecurityString(); string EncodePWDEx(string, string); My installers is crashing... Don't know why Do I have the good syntax because my code compiles well...Thanks |
|
|
|
|
|
#3 |
|
Join Date: Sep 2003
Posts: 27,873
|
[moderation]
threads merged due to posting in the translation sub-forum as well. [/moderation] -daz |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You have to quote that BdUser and EncryptionKey strings if they are strings. If those are actually variables, then replace them with one of the regular variables because that's all System supports.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
Do you have an example ??
Because I'm new in this and I want that section works.. I wrote this line of code and my installer crashes : System::Call 'Crypto::EncodePWDEx(t, t) t(.BdUser, .EncryptionKey).BdUser' This line takes my var BdUser and EncryptionKey and encode it. I want the result back into BdUser. There is a way to check if our DLL is correctly builded ? Thanks, Last edited by Inazad; 22nd May 2009 at 12:11. |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Like this:
System::Call 'Crypto::EncodePWDEx(t, t) t("$BdUser", "$EncryptionKey").s' Pop $BdUser But if that's a .NET dll then you have to call it using the CLR plugin. For the System plugin you can't just use .BdUser in there for the input/output - you can only use what is specified in the System plugin readme (like r0, R0 etc). Stu |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
I wrote my dll in delphi with the Crypto' functions to encrypt data.
Maybe its the code or maybe its the dll... how to know ?
Last edited by Inazad; 22nd May 2009 at 14:14. |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I have edited my post above.
Stu |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
I have these lines in my code :
Section -BD Call CreateDatabaseAndBasicData File "Crypto.dll" ;System::Call 'Crypto::GeneratePWDSecutityString() .s' StrCpy $EncryptionKey "oKQ2N0mLjxEX8WT4" ;StrCpy $EncryptionKey "" System::Call 'Crypto::EncodePWDEx(t, t) t("$BdUser", "$EncryptionKey").s' Pop $BdUser ;System::Call 'Crypto::EncodePWDEx(t.BdPass, t.EncryptionKey) .BdPass's ;System::Call 'Crypto::EncodePWDEx(t.BdUser,t.EncryptionKey).r0' WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "Nom_Database" $BdName WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "IP" $BdHost WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "g" $BdUser WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "e" $BdPass WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "f" $EncryptionKey WriteINIStr "$PathIniFile\${IniFile}.INI" "sql" "Type" "15632" SectionEnd Don't know if its the DLL or the code Do you have IM like MSN or Gaim ? THanks |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Where is the dll being extracted to?
Stu |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
it in the same directory of the .nsi file...
THere is a another place to put it ? Thanks |
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
No, I said where are you extracting to on the user's machine? You have no SetOutPath instruction in that code which is why I ask. You may be extracting it to a location that the System plugin doesn't look in.
Stu |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
There ??
Section -Main SetOverwrite try SetShellVarContext all # Pour tous les utilisateurs StrCpy $PathIniFile "$AppData\${Company}\${ProjectGroup}\Instances\$TxtInstanceValue" SetOutPath "$INSTDIR" # Pour copier l'exécutable du service File "Z:\Application\PRD\${IniFile}.exe" SetOutPath "$INSTDIR\..\" # Pour copier l'exécutable de configuration du service File "Z:\Application\PRD\${ConfFile}.exe" SetOutPath $PathIniFile # Pour copier les fichiers ini File "${IniFile}.INI" SetOutPath "$AppData\${Company}\" File /r "..\..\_Commun\Traduction\*.mo" CreateShortCut "$DESKTOP\${AppName}.lnk" "$INSTDIR\..\${ConfFile}.exe" "-s$TxtInstanceValue" SectionEnd Thanks |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
This is the top of my code, maybe you'll find what you're searching for ???
!define AppName "Blf Agent Unistim" !define ProjectGroup "BlfAgent" !define Company "Komutel" !define IniFile "BlfAgent_Unistim" !define ConfFile "BlfAgent_Configuration" !define ServiceName "BlfAgentUnistim" !define ServiceDescription "Busy Lamp Field Service" !define ServiceRegSearch "BlfAgent" # Variables Var StartMenuGroup Var PathIniFile Var InstanceCount # General Symbol Definitions !define REGKEY "SOFTWARE\${AppName}" # MUI Symbol Definitions !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM !define MUI_STARTMENUPAGE_NODISABLE !define MUI_STARTMENUPAGE_REGISTRY_KEY "${REGKEY}" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${AppName}" !define MUI_UNICON "..\Commun\App_Icons\sit-final.ico" !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_LANGDLL_REGISTRY_ROOT HKLM !define MUI_LANGDLL_REGISTRY_KEY "${REGKEY}" !define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage # Included files !include Sections.nsh !include MUI2.nsh !include LogicLib.nsh !include nsDialogs.nsh ;!include ..\Commun\Crypto.nsh !include ..\Commun\ServiceLib.nsh !include ..\Commun\frmInstance.nsh !include ..\Commun\frmUnInstance.nsh !include ..\Commun\frmMsde.nsh !include ..\Commun\frmConfigBd.nsh !include ..\Commun\frmUnistimConfig.nsh !include ..\Commun\SqlServerScriptBd.nsh #________Pages d'installation____________________________________________________________________________________________________ !insertmacro MUI_PAGE_WELCOME Page custom FrmInstanceShow FrmInstanceClose Page Custom frmMsdeShow frmMsdeClose Page Custom frmConfigBdShow frmConfigBdClose !define MUI_PAGE_CUSTOMFUNCTION_PRE JumpThisPage ;Fonction qui me permet de valider si j'exécute la page suivante !insertmacro MUI_PAGE_DIRECTORY !define MUI_PAGE_CUSTOMFUNCTION_PRE JumpThisPage ;Fonction qui me permet de valider si j'exécute la page suivante !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup !insertmacro MUI_PAGE_INSTFILES Page custom frmUnistimConfigServiceShow frmUnistimConfigServiceClose !insertmacro MUI_PAGE_FINISH #___________________________________________________________________________________________________________________________ #________Pages de désinstallation__________________________________________________________________________________________________ !insertmacro MUI_UNPAGE_CONFIRM UninstPage custom un.FrmUnInstanceShow un.FrmUnInstanceClose !insertmacro MUI_UNPAGE_INSTFILES #___________________________________________________________________________________________________________________________ # Macro pour les langues !insertmacro MUI_RESERVEFILE_LANGDLL !insertmacro MUI_LANGUAGE English !insertmacro MUI_LANGUAGE French # Installer attributes Name "${AppName}" OutFile "${AppName} Setup.exe" InstallDir "$PROGRAMFILES\${Company}\${ProjectGroup}\${AppName}\" CRCCheck on XPStyle on ShowInstDetails show InstallDirRegKey HKLM "${REGKEY}" "Path" ShowUninstDetails show RequestExecutionLevel admin PS: Sorry for the post in double.. |
|
|
|
|
|
#15 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Assuming SetOutPath "$AppData\${Company}\" was the last SetOutPath instruction then you're extracting Crypto.dll there too.
Stu |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
So if the Installer Create a Directory into C:\Program Files\ and the company name is Hello, I have to put my dll into :
C:\Program Files\Hello ? Thanks, |
|
|
|
|
|
#17 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Extract to $PLUGINSDIR. That's where the System plugin is so it'll find your dll when it's in the same folder.
Stu |
|
|
|
|
|
#18 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
OK I'll test it Monday, at my office.
Can we specify an absolute path like : File "Z:\Dev\Commun\Crypto.dll" ? Thanks for your support! JS |
|
|
|
|
|
#19 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
I've put the DLL into the $PLUGINSDIR of NSIS.
I don't get error while installing but my DLL do not do his job correctly because I'm getting the string "error" in my INI file .... There is a way to track or debug a NSIS installer ??? Thanks, |
|
|
|
|
|
#20 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
$PLUGINSDIR has nothing to do with the NSIS plugins folder.
Try this: SetOutPath $PLUGINSDIR File Crypto.dll When you use the NSIS plugin call syntax such as System::Call or nsDialogs::Create NSIS actually includes the plugin DLL and extracts it at run-time to $PLUGINSDIR. If you look in your %TEMP% folder you will find a ns*.tmp folder with the DLL files in it. Having said that, for the System plugin to find the DLL you want to call, it either needs to be in PATH (i.e. $SYSDIR) or in the same folder as System.dll ($PLUGINSDIR). Hopefully that makes sense as I don't think you get it! Stu |
|
|
|
|
|
#21 |
|
Junior Member
Join Date: May 2009
Posts: 12
|
I've made an executable in Delphi who do the same as my dll...
Now I just want to call the executable with this following string : $PathIniFile\${IniFile}.INI My executable name is : Cypher.exe Thanks to you. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|