Hiding Cancel button in MSI using Visual Studio
Hi I am trying to add the following custom action in Visual Studio to hide the CANCEL button.
Function HideCancelButton()
Dim Record
Set Record = Installer.CreateRecord(2)
Record.IntegerData(1) = 2
Record.IntegerData(2) = 0
Session.Message msiMessageTypeCommonData, Record
' return success
HideCancelButton = 1
Exit Function
End Function
I've added the vbs into the project and vbs showed up under Install, Commit, Rollback, and Uninstall. When I run the MSI package, the Hiding doesn't happen until the very end of installation, meaning that during the initial setup it is still showing and the user can click on Cancel and abort installation.
I think i need to update the actual MSI in order change the order of the events that are executed, I tried that in the InstallExecuteSequence, I've made the Install action as the #1 sequence, yet it is still not the first thing that is executed. Can anyone help?
Thanks
Function HideCancelButton()
Dim Record
Set Record = Installer.CreateRecord(2)
Record.IntegerData(1) = 2
Record.IntegerData(2) = 0
Session.Message msiMessageTypeCommonData, Record
' return success
HideCancelButton = 1
Exit Function
End Function
I've added the vbs into the project and vbs showed up under Install, Commit, Rollback, and Uninstall. When I run the MSI package, the Hiding doesn't happen until the very end of installation, meaning that during the initial setup it is still showing and the user can click on Cancel and abort installation.
I think i need to update the actual MSI in order change the order of the events that are executed, I tried that in the InstallExecuteSequence, I've made the Install action as the #1 sequence, yet it is still not the first thing that is executed. Can anyone help?
Thanks
0 Comments
[ + ] Show comments
Answers (18)
Please log in to answer
Posted by:
emmy12
16 years ago
Using this you may try to hide the 'cancel' button
PS: I havent tried the effectiveness of 2nd and 3rd method, so you may try it and post the result
Cheers
Emmy
Posted by:
aleks1429
16 years ago
I have deleted all dialog windows. The only dialog window that comes up is the Windows Installer window with one button the CANCEL button.
I know that there has to be a way to do this, I am able to get this functionality working with trial version of InstallShield. But client specifically wants VS.
Any thoughts?
I know that there has to be a way to do this, I am able to get this functionality working with trial version of InstallShield. But client specifically wants VS.
Any thoughts?
Posted by:
anonymous_9363
16 years ago
Wouldn't it be much simpler to change the UILevel property's value?
http://msdn.microsoft.com/en-us/library/aa369487.aspx
If you're running the MSI from a command line (as in "MSIExec /i [MSI_Name]...") you can use the '!' switch modifier.
http://msdn.microsoft.com/en-us/library/aa369487.aspx
If you're running the MSI from a command line (as in "MSIExec /i [MSI_Name]...") you can use the '!' switch modifier.
Posted by:
aleks1429
16 years ago
I am not having problems running from the command line. Actually the code line below gives me exactly what I need. However, this package has to be double clicked, it is not an enterprise domain deployment where I could have used a batch script.
msiexec.exe /i packagename.msi /qb!
How can I use the Installer.UILevel Property? Is it something I need to modify with an editor?
Thanks
msiexec.exe /i packagename.msi /qb!
How can I use the Installer.UILevel Property? Is it something I need to modify with an editor?
Thanks
Posted by:
anonymous_9363
16 years ago
Posted by:
aleks1429
16 years ago
Posted by:
anonymous_9363
16 years ago
No, create a property named 'UILevel'. The 'msi' prefixed variables would be used if you were using the WindowsInstaller object interface.
Set the IULevel property's value to 3 (msiUILevelBasic) + 32 (msiUILevelHideCancel), therefore 35. Setting it to 34 (2 + 32) would mean you would see nothing, not even the progress dialog.
Set the IULevel property's value to 3 (msiUILevelBasic) + 32 (msiUILevelHideCancel), therefore 35. Setting it to 34 (2 + 32) would mean you would see nothing, not even the progress dialog.
Posted by:
aleks1429
16 years ago
Posted by:
aleks1429
16 years ago
Posted by:
AngelD
16 years ago
Posted by:
aleks1429
16 years ago
Posted by:
anonymous_9363
16 years ago
Posted by:
AngelD
16 years ago
Posted by:
aleks1429
16 years ago
Thank you guys. I actually got it to work.
I manually uploaded the script and created the correct entries in with Orca. VS for some reason wasn't good at storing script as a binary file during drag and drop, instead during deployment it was dropping it on the file system
I made the action of Type 6 and made the InstallExecuteSequence the first one. It worked for me.
Thank you guys!!!
I manually uploaded the script and created the correct entries in with Orca. VS for some reason wasn't good at storing script as a binary file during drag and drop, instead during deployment it was dropping it on the file system
I made the action of Type 6 and made the InstallExecuteSequence the first one. It worked for me.
Thank you guys!!!
Posted by:
anonymous_9363
16 years ago
Posted by:
Jamie B
16 years ago
Posted by:
anonymous_9363
16 years ago
Posted by:
AngelD
16 years ago
For anyone else reading this the msiMessageTypeCommonData constant is missing in the first post.
The function should look like:
The function should look like:
Function HideCancelButton()
Const msiDoActionStatusSuccess = 1
Const msiMessageTypeCommonData = &H0B000000
Dim Record : Set Record = Installer.CreateRecord(2)
Record.IntegerData(1) = 2
Record.IntegerData(2) = 0
Call Session.Message(msiMessageTypeCommonData, Record)
HideCancelButton = msiDoActionStatusSuccess
End Function
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.