Code: Select all
Session.Property("MY_PROP") = value
Dear Dan,Dan wrote:Hello,
In order to retrieve the BIOS Information you can create your own custom action. If you want to use the VBS approach, you can take a look on the Retreving BIOS Information article which may be useful to you.
Please note that you can create your custom action as a custom action written in C# or a custom action written in C++, instead of VBScript and you can see some reasons why not to use VBScript.
Within this custom action, you can also set properties with the related values which you want to write in the registry. Since you are using the VBScipt approach, in order to set a property with a value, you can use the the following statement:In order to launch your custom action, you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.Code: Select all
Session.Property("MY_PROP") = value
Please note that you don't have to write these values into registry within your custom action, as you can use our support for Add registry keys and values to your package. If you need to write the related registry values within your custom action, please take a look on the Creating a Registry Key article which may be useful to you.
If you have other questions, please let us know.
Best regards,
Dan
First of all, you should define a public property in the Install Parameters page. (in my example is MY_REG_PROP). In order to set the MY_REG_PROP public property, you should use something like that:With my vbscript: I finished 95% but i don't know use:
strValue = ???
i try:
strValue = ("Serial Number: " & objBIOS.SerialNumber)
but it isn't working.
Code: Select all
Session.Property("MY_REG_PROP")=objBIOS.SerialNumberCode: Select all
Function LaunchVBS_Sample( )
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For each objBIOS in colBIOS
x=msgbox("Serial Number: " & objBIOS.SerialNumber)
Session.Property("MY_REG_PROP")=objBIOS.SerialNumber
Next
End Function
Since the bios serial number cannot be retrieved using the above custom action, you can search in your .EXE if a specific registry entry can be found on the target machine. This registry entry can be made using our Add registry keys and values to your package support.Althought, it is a simple software, but i want use Advanced Installer for setup wizard because i like Advanced Installer very much. But everyone can copy it after setup complete at: [ProgramFilesFolder][Manufacturer]\[ProductName] and copy and share...blah blah...
I want everyone must use setup wizard: How to create?
Dear Dan,Dan wrote:Hello,
First of all, you should define a public property in the Install Parameters page. (in my example is MY_REG_PROP). In order to set the MY_REG_PROP public property, you should use something like that:With my vbscript: I finished 95% but i don't know use:
strValue = ???
i try:
strValue = ("Serial Number: " & objBIOS.SerialNumber)
but it isn't working.So, your custom action code can look something like that:Code: Select all
Session.Property("MY_REG_PROP")=objBIOS.SerialNumberIn order to launch your custom action, you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence after the Searches stage from the Install Execution Stage.Code: Select all
Function LaunchVBS_Sample( ) strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colBIOS = objWMIService.ExecQuery _ ("Select * from Win32_BIOS") For each objBIOS in colBIOS x=msgbox("Serial Number: " & objBIOS.SerialNumber) Session.Property("MY_REG_PROP")=objBIOS.SerialNumber Next End Function
So, the MY_REG_PROP property contains the Bios Serial Number. In order to write this value into the registry, you can take a look on the Add registry keys and values to your package article with related information for hints and guidance.
I've attached an .AIP(advanced installer project) which implements this scenario.
Observation !
During my tests, I've noticed that the VBS custom action cannot retrieve the Bios Serial Number all time. Not sure why. That's why I've attached the following custom actions:
- CA.vbs - if the message box does not contains your bios serial number then you can be sure that it will not work either in the installer; ( you can run this custom action as a test)
- CA_AI.vbs - this custom action is used in the .AIP
Since the bios serial number cannot be retrieved using the above custom action, you can search in your .EXE if a specific registry entry can be found on the target machine. This registry entry can be made using our Add registry keys and values to your package support.Althought, it is a simple software, but i want use Advanced Installer for setup wizard because i like Advanced Installer very much. But everyone can copy it after setup complete at: [ProgramFilesFolder][Manufacturer]\[ProductName] and copy and share...blah blah...
I want everyone must use setup wizard: How to create?
Since the related registry entry is made by the installation package, if the specific registry entry cannot be found on the target machine, then you can exit your application. Basically you can search in the registry, every time your run your application and see if that registry entry exist.
Please note that there is a better way to protect your application and this can be done using our Licensing support. Please take a look on the Advanced Installer - Licensing How To's in order to see how this feature can be used.
If you have other questions, please let us know.
Best regards,
Dan
Thank you so much to Dan,Dan wrote:You're welcome,
Take your time, the learning curve is steep at first but once you get the hang of Advanced Installer you'll be set authoring packages with any requirements.
Our user guide has the exact steps but if you encounter any specific blockers, we're here to help.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging