Is there a way to use .pas files in Inno Setup? - inno-setup

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?

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".

Related

NSIS Prevent unziping of file to extraction.

I have seen this was asked in the bask back in 2008 and can't find anything newer on the subject so I am bring it up again.
Is there a way to prevent a user from extracting the files from the installer and reading the nsi file.
I read something the opcode needs to be changed in the exe of nsis. Has NSIS come up with a plugin or something so users do not have to modify the exe?
If there an easy way or is it still messing with the exe. and if so can you point me in the right direction on how to do this or if someone has already posted a version
Thank!
NSIS is open source so it is not unsurprising that people are able to write decompilers.
There is no easy way to prevent it and the recommended method is still the same; change the order of the opcodes in \Source\exehead\fileform.h and compile NSIS.
To prevent most people from getting access to your files you can use one of the zip/7z/rar plug-ins from the NSIS Wiki that accepts a password and include a password protected archive in your installer. Keep in mind that a sophisticated user can run the installer in a debugger and find your password when you call the plug-in to extract the files.

How to display release notes before installation in Inno Setup?

I want to be able to display the release notes to the end user before the installation has started (e.g. if there are any code changes they should be aware of before upgrading to a newer version).
I've read the documentation regarding the Pascal code BeforeInstall and AfterInstall Parameters, but my problem is how can I make a reference to my release notes file as it is packed inside the setup executable? I realise the simplest answer would be to simply package the installer with a copy of the text file sitting alongside it so it could reference it in this way, but then if the user only copies the executable for example, this would presumably cause a reference error.
What is the best way to go about implementing this?
You are looking for the InfoBeforeFile directive:
[Setup]
InfoBeforeFile=infobefore.txt

Inno Setup : How to change language file depending on code

I use my own languages files (.isl) instead of using the default languages files of Inno Setup. It permits me to customize some messages. But now, I would like to have two versions of each language files, one in case of first installation and one in case of update, but, is it possible to choose a file from the code? If yes, how to do it?
Maybe there is some better way for changing the messages than change the languages files depending on the type of installation, if yes, I would like to know what to do.
Thanks
Add the alternative texts to [Custom Messages] section:
https://jrsoftware.org/ishelp/index.php?topic=custommessagessection
Then in Pascal script, when upgrading, update the respective GUI element with the alternative translation loaded using CustomMessage('MyAlternativeUpgradeString')
https://jrsoftware.org/ishelp/index.php?topic=isxfunc_custommessage

Inno Setup set Setup.exe create date and modified date the same

By default, when compiling the Setup.exe Inno Setup does not delete the existing file before compiling, meaning that the modified date is likely to be different from the create date unless remembering to manually delete the Setup.exe before compile. What would be the best way to set the date and time the same? I can think of two possible approaches to do this. One would be to use the TouchDate and TouchTime functions in the Code section at the end of the compile, the other would involve using the ISSP section to automatically delete the Setup.exe prior to compile. I'm not entirely sure if the ISSP option is possible, but which way would be simplest and preferable? Does anyone have any advice on which approach I should take, or is there another option I am overlooking?
It's most probably a consequence of so called file tunelling which has nothing to do with Inno Setup. One way out of this is making a batch script that will run compiler and touch the timestamp after compilation (preprocessor cannot do that because it runs before compilation).

Way to construct Innosetup setup script from Executable

I had put little bit effort to create an Inno installer.It had around 2 files.I just missed backuping 1 file.So is there a way to contruct the inno setup script from the compiled installer.

Resources