Password SHA-1 hashing - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Password SHA-1 hashing

Is there a way to SHA-1 hash a property that is holding a password, that I can then write to an xml file?
It looks like Advanced Installer does have some built in SHA capabilities, but is there a way to access them?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Password SHA-1 hashing

Hello,

I am afraid Advanced Installer does not offer such capabilities. However you can easily create your own custom action that can do this for you, as there are many free libraries on the internet that offer these capabilities. This page contains such an implementation.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

I've created a dll based on your sample to create a Hash string.
I've hooked into the Installer, but it gets a return value 3 which makes no sense to me, since I only return a 1 or 0.
Would you happen to know what is wrong?

MSI (s) (74:B0) [18:07:08:960]: Executing op: CustomActionSchedule(Action=hashSecret,ActionType=1025,Source=BinaryData,Target=CallStdFcn,CustomActionData=C:\Program Files\company\product\test.dll?D;RS1;S;hashSecretValue;)
MSI (s) (74:64) [18:07:09:022]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI297.tmp, Entrypoint: CallStdFcn
Action ended 18:07:10: InstallExecute. Return value 3.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Password SHA-1 hashing

Hello,

Please use an "Attached Custom Action" to launch your .dll custom action. You can do this by going to "Custom Actions" page, right clicking where you want to place your custom action, and selecting "New Attached Custom Action".

If this does not solve your issue, please send your .aip project file (or a stripped down version that accurately reproduces this behavior) along with your implementation of the custom action to support at advancedinstaller dot com so I can further investigate the issue.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

I changed it to an attached custom action and that works fine on the machine I'm developing on. I copied the install.msi, install.exe and install.ini to another windows machine and ran the install. The installer ends saying it failed due to a premature issue:
Action ended 16:18:22: WelcomeDlg. Return value 1.
MSI (c) (E8:90) [16:18:22:470]: Skipping action: ResumeDlg (condition is false)
MSI (c) (E8:90) [16:18:22:470]: Skipping action: MaintenanceWelcomeDlg (condition is false)
MSI (c) (E8:90) [16:18:22:470]: Skipping action: ServiceConfiguration (condition is false)
MSI (c) (E8:90) [16:18:22:470]: Doing action: hashsecret
Action 16:18:22: hashsecret.
Action start 16:18:22: hashsecret.
MSI (c) (E8:90) [16:18:22:470]: Creating MSIHANDLE (33) of type 790542 for thread 2192
MSI (c) (E8:E0) [16:18:22:470]: Invoking remote custom action. DLL: C:\DOCUME~1\ADMINI~1.IRO\LOCALS~1\Temp\1\MSI5A.tmp, Entrypoint: hashSecretValue
MSI (c) (E8:E0) [16:18:22:485]: Closing MSIHANDLE (33) of type 790542 for thread 2192
Action ended 16:18:22: hashsecret. Return value 3.
MSI (c) (E8:90) [16:18:22:501]: Doing action: FatalError
Action 16:18:22: FatalError.
Action start 16:18:22: FatalError.
DEBUG: Error 2826: Control BottomLine on dialog FatalError extends beyond the boundaries of the dialog to the right by 3 pixels
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2826. The arguments are: FatalError, BottomLine, to the right
Action 16:18:22: FatalError. Dialog created
Action ended 16:18:23: FatalError. Return value 2.
Action ended 16:18:23: INSTALL. Return value 3.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Password SHA-1 hashing

Hello,

It seems like your custom action is crashing for some reason. It might be that it depends on a runtime, or you have a bug that causes it to crash.

Also, please note that your custom action should only return one of the values listed by MSDN. More to the point, it needs to return ERROR_SUCCESS in order for the install to continue.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

I actually develop the custom action dll on a different machine. Copy the dll over to the machine I develop the Advanced installer. Build the installer and run it, works fine.
It's only when I copy the installer to another machine to test on, that I get this error.
I used the sample SerialValidationDLL as my base. So I only return 0 or 1. I don't know where return value 3 is coming from.
Here is the section of logs from the same area, but running on the machine I develop the Adv Installer on.

MSI (c) (1C:50) [18:02:59:256]: Doing action: hashsecret
Action 18:02:59: hashsecret.
Action start 18:02:59: hashsecret.
MSI (c) (1C:50) [18:02:59:287]: Creating MSIHANDLE (33) of type 790542 for thread 3152
MSI (c) (1C:9C) [18:02:59:287]: Invoking remote custom action. DLL: C:\DOCUME~1\wyin\LOCALS~1\Temp\MSI302.tmp, Entrypoint: hashSecretValue
MSI (c) (1C!40) [18:03:03:022]: PROPERTY CHANGE: Modifying SECRETVALUE property. Its current value is 'secret'. Its new value: 'E5E9FA1BA31ECD1AE84F75CAAA474F3A663F05F4'.
MSI (c) (1C:9C) [18:03:03:022]: Closing MSIHANDLE (33) of type 790542 for thread 3152
Action ended 18:03:03: hashsecret. Return value 1.
MSI (c) (1C:50) [18:03:03:131]: Skipping action: PatchWelcomeDlg (condition is false)
MSI (c) (1C:50) [18:03:03:131]: Doing action: ProgressDlg
Action 18:03:03: ProgressDlg.
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

It doesn't seem to get to the call at all. I put a messagebox in the first line of the custom action routine, so it doesn't even execute that. I'm running a trial version of Advanced Installer, is there any code that prevents an installer built with a trial version from running on aonther machine? It pops up the messagebox that says it is for trail purposes only at the beginning. But I'm wondering if it prevents custom actions from running?
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

The pattern I'm seeing is that the custom action is referring to a temporary file like MSI8B.tmp. Where the installer works, I find that file in the specified location in the log. Where it fails, I don't find that file. What would cause the Installer to not create that temporary file that represents the DLL?
wyin
Posts: 9
Joined: Thu Sep 24, 2009 9:05 pm

Re: Password SHA-1 hashing

Found the problem. I had compiled the DLL in debug mode and it was looking for the debug versions of dlls, which didn't exist on the QA machines. So I've rebuilt the dll in release mode and it works fine.

Return to “Common Problems”