How to limit installation path in MSI INstaller (VS2005 Setup project)


I am creating MSI installer using VS2005 Setup project,

please suggest how to limit length of installation path (for example 170) and display an appropriate message.

Thank You

0 Comments   [ + ] Show comments

Answers (2)

Posted by: EdT 5 years ago
Red Belt
Create a custom action that checks the length of the installation path property and exits using a Type 17 custom action with an appropriate error message. Sequence it in the UI sequence after the dialog which gets the information from the user.  You should also consider a similar check in the Execute sequence, to run only if the UI sequence does not run (ie use the UILevel property as a condition) so that the installation can also be terminated if the MSI is run silently.

  • Thank you very much for your response.

    To check the length of installation path, I have added C++ dll in custom action under Install but custom action displays message after "Installation confirmation" screen at the time of installation.
    and I have returned error code ERROR_INSTALL_USEREXIT, by this installation terminated.
    And in case returning ERROR_SUCCESS installation continues.
    I need to achieve the following:
    1. Displays the message to user just after it clicks the next button on "Select Installation Folder" screen.
    2. By pressing the OK button from the message box, again the "Select Installation Folder" screen will displays and Installation will not be terminated or resumed, installation processing will be done after the user changes the installation path and press the next button. - programmer1983 5 years ago
Posted by: EdT 5 years ago
Red Belt
As a programmer, does the solution not leap out at you?
Replace the user dialog in the MSI that asks for path length and replace it with your own custom action. Your code can then loop around as much as necessary until the user enters a valid string and then set a PUBLIC property with the path. If the user quits, exit with a value in your public property that a terminate installation custom action can use as a condition to terminate the install with an appropriate message.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ