1
votes

I need to do encryption and decryption of a string in Inno Setup through Rijndael algorithm. I've found out that people are using DCPcrypt library to do what I need in Pascal, but they are using files with .pas extension. And I don't know if there is a way to use those files, and methods from those files in Inno Setup script? I've used .dll files and methods from those files before to do some operations in Inno Setup script, so I'm wondering if there is a way to do the same with .pas files?

1
You are comparing apples and oranges. An EXE is an executable file (created by compiling and linking source code files). A *.pas file is a Pascal/Delphi source code file. You probably need to make an EXE using the *.pas file library and run that one. (Although Inno Setup supports Pascal scripting, I doubt that it will run this library. It is probably too complex.)Andreas Rejbrand
Maybe I made a mistake in explanation. I used some .dll files and methods in them to do some operations in inno setup script, so I meant is there a way to do the same or similar with .pas files.Petar
Actually, a DLL is like an EXE in the sense that it contains executable code (created by compiling and linking source code files). So if you want to use the source code in the *.pas file, you need to compile it into either an EXE or a DLL (unless, as indicated above, Inno Setup's Pascal scripting engine actually can run the Pascal code itself).Andreas Rejbrand
So is there a way to make a dll file out of those .pas files?Petar

1 Answers

0
votes

Inno Setup Pascal Script and Pascal language have much similarity. But the Pascal Script is a way more limited and not really compatible. So there is a very little chance that you can use any more-than-trivial Pascal code in Inno Setup.

You can of course build a DLL from that Pascal code and use it in Inno Setup. This may help: https://delphi.fandom.com/wiki/Creating_DLLs

As Rijandel is also implemented in .NET, you can also consider creating a DLL in .NET/C#:
Calling .NET DLL in Inno Setup


Though, make sure you really want Rijandel and not AES.

Also this really looks like an XY problem. You should rather ask, "How to implement Rijandel (or AES) encryption in Inno Setup".