Validate domain user/password in Installshield setup - authentication

I have domain,username,password as inputs. Any idea on how i can validate that the username exists and the password is valid via custom action in a Installshield setup. I am using a Basic MSI setup. I could not find any resources in the web regarding this.

You can do this with custom actions installshield includes in ISNetAPI.dll.
You're a better man than me if you can find any documentation on this.
Add it to your binary table from <ISProductFolder>\redist\language independent\i386\ISNetAPI.dll
I collect the domain, username and password and set properties to names that make sense to me. Then when the 'next' button is clicked, it sets the properties the action expects. If the username or domain is empty, it spawns a dialog telling the user. If all is well, we go to the next dialog.

Could write an Installscript or C++ CA and call the API function LogOnUser
http://msdn.microsoft.com/en-us/library/windows/desktop/aa378184(v=vs.85).aspx

Related

How to handle data encryption in Ranorex?

I want to get encrypted-password from database for login in Android and iOS App.
I've made Username and password as data binding and by setting password-variable to the textField, I want the password to be converted/decrypted, to set password correctly, otherwise testcase will be always failed.
is there any built-in method/function in Ranorex for doing data encryption? If not, how to do it?
(I'm new in Ranorex and test automation.)
There is no built-in method to encrypt/decrypt. You will need to do this yourself in a code module file or recording module's user code action. You can use any third-party library to help with this if needed.

WiX ManagedBootstrapper SetDownloadSource confusion

I am a bit confused by the method Engine.SetDownloadSource(). What I am trying to do is change the download URL for the bundled packages from an external website to an internal one. (If there is an easier way to do this, I am open to other suggestions).
Now for the problem. When calling this method it is asking for a user and password. I am not sure where I should get this info from.
string downloadSource = Path.Combine(WebSitePath(), "WebSetup/WebSetupData/", Path.GetFileName(args.DownloadSource));
Engine.SetDownloadSource(args.PackageOrContainerId, args.PayloadId, downloadSource, user, password);
WebSitePath() simply returns the base URL for the website. I can't find any hint about what username and password the MBA would use if I didn't change the link, and likewise I am not sure how to tell it to use the current windows user to download from the new link. Any help would be greatly appreciated.
Username and password are optional to support basic or digest HTTP authorization. Set them to null if you don't want to provide a user/password combination.

How to check existing user account is under administrator group or not?

I'm using a wix installer to install a windows service using an existing user account(logon user account for the window service). I have a customUI dialog which will get the username and password, once the credentials are given while clicking the next button the installer should validate whether the given user is part of builtin administrator group. Should i use custom action or is there anyother way?
This has to be a custom action. WiXUtilExtension gives you an option to add new or existing users to the groups (see User/Group/GroupRef elements), but this is probably not what you want - it can be quite dangerous.
BTW, you can take advantage of MSI Extensions project - take a look at this, it seems to be exactly what you need.

How to encrypt a password as part of a Wix installation

I'm creating a Wix installer for a windows service which needs to have provided, at installation time, the username and password for an email account to inspect. Currently the password is stored in clear text in the config file which at the least needs to be encrypted.
Is this the best approach to take as I realise that storing an encrypted password is not good practice in itself?
If there is no better way then I was going to perform the encryption as part of a custom action but I can't figure out if there's a way to pass the encrypted value back to the installer so that the installed config file can be amended. Is there a way to do this as otherwise I'm guessing the custom action will have to perform this task to.
The best option I found for now is using custom actions and data protection API:
when you get a data to encrypt from the user (or elsewhere), pass it to immediate CA which runs on install and encrypts the data
store this encrypted value in the system registry
on uninstall (or maintenance) read the encrypted value from registry and pass it to the immediate CA which decrypts the data (this all should happen before you use this value, of course)
Furthermore, all this can be wrapped into a WiX extension, but it's a kind of advanced...
This all concerns the case when you need the password during the install/uninstall/maintenance. Otherwise (if it is the application which needs it for functioning), it's up to the application architecture to choose the right way to store and use the value...

API for username password keychain dialog in Mac

Is there an API that we can use that displays the usual username field, password field, and remember checkbox? This dialog can be usually seen when connecting to a server via Finder or when Safari requests for proxy information.
I am currently implementing this via CFUserNotification API to save myself from creating a window, etc. but I have to specify the fields and checkbox and retrieve them. What would really save time is an API that will abstract developers from having to worry about it. Does such API exist?
I don't think so. Actually I don't have an idea why apple should deploy an api for such a small task.
That's only a NSSecureTextField and a NSTextField. There are plenty of classes that help you add a password properly to the keychain.