Get the new PortableApps.com Platform 10.0: Gorgeous themes, a full portable app store and advanced functionality
Announcing the World's Best Flash Drive: The PortableApps.com Companion | Did you see a malware warning on Friday?

ReadINIStr and WriteINIStr

GOD1's picture
GOD1 (Homepage) - September 6, 2010 - 10:11pm

Guys again I'm here for some help.

I'm wondering how to make my installer get the volume serial number and store it in a .INI file. Then the launcher gets the drives serial number and compare it to the serial number that the installer stored in the .INI file.

How would you make the launcher compare two serial number or what is that command that would compare two serial number?

Please help me with this riddle. I'd really wanted

to know.


( categories: )

You have to use the installer

You have to use the installer custom-code called 'PortableApps.comInstallerCustom.nsh'

And use the following Volume serial macro: http://nsis.sourceforge.net/Get_Disk_Volume_Serial_Number

Then write the ini string to the ini file you'd want Smiling

Formerly Gringoloco
Windows XP Pro sp3 x32

Thank you for your reply Sir.

Thank you for your reply Sir. I was able to write the ini string but I still don't get how to make the launcher compare the volume serial number to another volume serial number.

For example; the first installation writes the Volume serial number in ini string and saves the ini file in $EXEDIR\DefaultData directory. Then if you copy the whole installation directory in another usb or volume, the launcher will then get the current volume serial number and compare it to the serial number which the installer saves in the $EXEDIR\DefaultData directory.

If the two serial number didn't match then the launcher gives a message saying "portableapp has been copied to another drive." then the launcher exits, thus copying the whole portable app install directory makes it unusable.

The thing is wanted to know how to prevent the copying of my portableapps to other drive.

This is part of the code that I use:

Function GetDiskVolumeSerialNumber
${GetRoot} `INSTDIR` $R0 <-(I used this to specify that the volume was a removable drive and not a system drive.)

!define GetVolumeInformation "Kernel32::GetVolumeInformation(t,t,i,*i,*i,*i,t,i) i"
System::Call '${GetVolumeInformation}("$R0",,${NSIS_MAX_STRLEN},.r0,,,,${NSIS_MAX_STRLEN})'
FunctionEnd

Please correct me if you found some errors with the codes that I use.

Thank you Sir.

No matter how gifted you are, you alone can not change the world.