PDA

View Full Version : Encryptor for SB



NewsArchive
09-23-2008, 02:06 AM
Before re-inventing the wheel - has anyone got an encryptor dll add-on for
SetupBuilder?

I'm thinking, something like

ReturnValue = EncryptString(StringIn,EncCode,EncMethod)

Otherwise I'll knock up a dll...

Talking about knocking up a dll - I'm doing something dumb. I've got a dll -
#include it into the sb6 file, load it, call the dll function - but nothing
is returned and the stop that I'm calling in the function isn't being
displayed. Hmmm. Do I need the DLL to be in a special place (like in the lib
directory)? The sb script compiles OK - and I can see if finds the dll - but
runtime?

Friedrich - can you give me some troubleshooting pointers on this one?

Thanks

--
Geoff (Capesoft)

www.capesoft.com

NewsArchive
09-23-2008, 02:07 AM
Hi Geoff,

> Talking about knocking up a dll - I'm doing something dumb. I've got a
> dll - #include it into the sb6 file, load it, call the dll function - but
> nothing is returned and the stop that I'm calling in the function isn't
> being displayed. Hmmm. Do I need the DLL to be in a special place (like in
> the lib directory)? The sb script compiles OK - and I can see if finds the
> dll - but runtime?
>
> Friedrich - can you give me some troubleshooting pointers on this one?

There are three or four interesting DLL example source codes in the Example
Projects Package:
http://www.lindersoft.com/downloads_licensed.htm

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-23-2008, 02:09 AM
I knocked up a DLL once... and it got fatter and fatter... ;-)

--

Ben E. Brady
Want MASSIVELY OUTRAGEOUS web disk space and bandwidth?
500 GB disk space and 5000 GB transfer per month,
http://www.servage.net/?coupon=CUST13495

www.clariondeveloper.com
www.singularvisionsoftware.com

The information contained in the message above, as expressed by the author,
is copyright 2008 by Ben E. Brady, All rights strictly reserved worldwide.
The information contained in the message above may not be posted on any
other information forum or web site without the express written permission
of the author. All opinions expressed in the message are those of the author
and are not necessarily shared by other members of the newsgroup and may or
may not be in agreement with SoftVelocity, the host of this newsgroup.

NewsArchive
09-23-2008, 02:09 AM
> I knocked up a DLL once... and it got fatter and fatter... ;-)

;-)

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.setupcast.com - "A revolutionary new publishing system for software
developers - enhanced for SetupBuilder users!"
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.clarionproseries.com - "Serious imaging tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
09-23-2008, 02:10 AM
>Talking about knocking up a dll - I'm doing something dumb. I've got a dll -
>#include it into the sb6 file, load it, call the dll function - but nothing
>is returned and the stop that I'm calling in the function isn't being
>displayed. Hmmm. Do I need the DLL to be in a special place (like in the lib
>directory)? The sb script compiles OK - and I can see if finds the dll - but
>runtime?

Geoff,

Don't know if this will help, but I'm calling into Clarion and C DLLs with no
problem. Here's an example of a call into a Clarion DLL.

Given a prototype of:

GetLicenseStatus( *cstring szExePath, |
*cstring szDataPath, |
*cstring szProgVersion, |
*cstring szLicensee, |
*cstring szSupportExpires, |
long lProductCode, |
*long lUpdateOk, |
*long lLicenseType, |
*long lLicenseOptions |
), long, pascal

The SB call looks like... Well, have a look at the image.

May also be useful to note the DLL path of %TMPDIR%\utilfunc_install.dll

HTH

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?

NewsArchive
09-23-2008, 02:12 AM
>displayed. Hmmm. Do I need the DLL to be in a special place (like in the lib
>directory)?

Geoff,

One other bit I forgot to mention. Add your DLL in Support Files in Setup
Requirements of the Visualizer. You can also do this directly in the script
editor using "#include support file".

At runtime (and testing) SB writes support files to the OS temp directory and
deletes it/them automatically. Thus the %TMPDIR%\utilfunc_install.dll
reference in that screen shot of mine.

HTH.

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?

NewsArchive
09-25-2008, 01:47 AM
OK - got the DLL bit working - but can't seem to find a way of returning a
string. Ideally would like something like:

ENCRYPTFUNCTION FUNCTION(*CSTRING pInString,*CSTRING pHashCode)
code
!Encode stuff
return EncodedString

Seems like %_SB_RETURN% is a long and %_SB_RETURNEX% isn't set. So how do I
get a string back?

I tried modifying and returning pInString direct - but it seems like the
handle isn't passed - there's a handle declared at runtime and the contents
of pInString (in the install) - is passed to the internal/runtime var.

--
Geoff (Capesoft)

www.capesoft.com

NewsArchive
09-25-2008, 01:47 AM
Geoff,

> OK - got the DLL bit working - but can't seem to find a way of returning a
> string. Ideally would like something like:
>
> ENCRYPTFUNCTION FUNCTION(*CSTRING pInString,*CSTRING pHashCode)
> code
> !Encode stuff
> return EncodedString
>
> Seems like %_SB_RETURN% is a long and %_SB_RETURNEX% isn't set. So how do
> I get a string back?
>
> I tried modifying and returning pInString direct - but it seems like the
> handle isn't passed - there's a handle declared at runtime and the
> contents of pInString (in the install) - is passed to the internal/runtime
> var.

Did you check the "Call Dll.sb6" source code example project? In this demo
there is in line 51:

Call DLL "%TMPDIR%\sbdll.dll" -- Function "CALLTHISFUNCTION2" (*cstring)
(%LPBUFFER%)

The Clarion DLL sbdll.dll returns a CSTRING value to the installer.

Or in line 65:

Call DLL "kernel32.dll" -- Function "GetComputerName" (*string, *long)
(%LPBUFFER%,%NSIZE%)

The Windows API returns a STRING value to the installer.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner