- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to read command line argument in deferred custom action VBA?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi,
I'm new to InstallShield software, and looking for help to read out command prompt arguments in my deferred custom action written in VBA. I'm looking to delete folder based on the command line arguments supplied by user.
I have created property named "RemoveFolder" which has default value as "false" and based on the user input this property value will be changed.
Command line argument: msiexe /i "mysamplemsi.msi" RemoveFolder=true
I'm looking to set the property value in VBA code based on the user input.
Below VBA code snippet I'm trying to use for this operation.
Set oFso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Err.Clear
strRemoveFolder = RemoveFolder --------NOT SURE HOW TO READ COMMAND LINE ARGUMENT OR SET PROPERTY VALUE BASED ON USER INPUT TO READ THE SAME
If oFso.FolderExists(strFolderdelete) Then
Set folder = oFso.GetFolder(strFolderdelete)
If (strRemoveFolder ="1" Or strRemoveFolder ="true") Then
For Each subFolder in folder.SubFolders
subFolder.Delete True
Next
End If
End If
Any help is appreciated.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I've figured out the reason for not getting the property value in deferred custom action. I changed the property declaration from Normal-Casing to CAPTIAL casing i.e. from private property to public property.
Before: RemoveFolder
After: REMOVEFOLDER
By doing this, I'm now able to read command line parameter value through my public property.
Deferred Execution Custom Action Cannot Retrieve a Property Value - Community (flexera.com)
https://learn.microsoft.com/en-us/windows/win32/msi/restrictions-on-property-names
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I've figured out the reason for not getting the property value in deferred custom action. I changed the property declaration from Normal-Casing to CAPTIAL casing i.e. from private property to public property.
Before: RemoveFolder
After: REMOVEFOLDER
By doing this, I'm now able to read command line parameter value through my public property.
Deferred Execution Custom Action Cannot Retrieve a Property Value - Community (flexera.com)
https://learn.microsoft.com/en-us/windows/win32/msi/restrictions-on-property-names