Archive: Storing system info. in an ini file


Storing system info. in an ini file
Hi All,
Can i use the ini files to store some information like MAC address etc. (any info for that matter) in an ini file?
I would like to read this information the next time installer is run, with a new compilation ofcourse.
How else can one ensure that an installer is not being run on multiple machines within an organization?

(ofcourse we need to have a license manager but just curious if i could use the installer meanwhile...)

thanks.


sorry...i mean without a recompilation ofcourse
i need some coffie :)


So you want to write some information to the installer or to a file that comes with the installer to make sure it's not ran on two different computers? I don't think that's a good idea. If you write it to a separate file, the user can simply delete it. If you write it to the installer itself, assuming Windows will allow you to write to the installer, the user can simply download the installer again, or make it read-only by burning it on a CD for example. Both issues can also be caused on purpose or even by mistake.

What I’d do is query the license manager using some basic information from the user. That way you don’t have to write two different protection schemes.


Hi Kichik,
Thanks for your reply.
I know it may not seem elegant but this is just a stop gap effort, if possible.
Since we do not offer downloads of our product, all valid installers are issued by us to the customers. Hence i thought it would be a quick way out before we design and implement licensing mechanism (this may take a while). Our main idea is that the installer exe should know that it has been run once successfully. Similarly on an uninstall, that information should be removed from the installer.

I dont know if this is possible... :(


Well, since the CRC checksum is only done until the logical end of the installer file, you can easily tack some information on the end of it. You can put a unique id there and contact the server while installing to ask if that id is valid. You can also try writing something there while installing.


Sounds interesting...
more so as i am a bit lost ;)
could you elaborate a bit more please?


NSIS uses a CRC checksum to make sure the installer is not corrupted. By default, it only checksums until the end of the installer file. If you append data to the installer file, you won't get an error message saying the installer is corrupted. If you change some data in the middle of the installer, it will.

This means you can append your data to the installer file. Since you distribute the installer yourself, you can easily append different data to each installer. This data can then be read by the installer itself using FileOpen, FileRead, FileSeek and FileClose.

This per-installer data can be a unique id that will be used to communicate with your server. The server, according to the id and its database, will know whether the installer is still valid or not.


Sounds like you have by answer..
"This means you can append your data to the installer file" ..HOW?
Sorry but i am a bit new to the world of installers...


You have a compiled installer, you can change it however you see fit. You can change it with notepad, another text editor, a scripting language or even another NSIS installer.


sounds rough but i guess good enough for short term.
thanks a lot.