Developing Windows Installer using Visual Studio

Help Please....
Working on my first Windows Installer.
In Visual Studio 2005, have added Textboxes (A) to the User Interface and want to populate property "Edit1Value" dynamically.
Can this be done?
Can I call a function from the Edit1Value property that will return a dynamic string value to this textbox?

When runnig Setup.exe for any basic Windows Installer, do you know how it displays a dialog box with the default path for installing an application? I am trying to duplicate this dialog box within my Installer. My Installer not only installs an app, but a database as well. I want to prompt the user to select a path for installing the database.

So can I dynamically set the path in the Edit1Value or is there a better way to do this?
Who is Participating?
jake072Connect With a Mentor Commented:

I have tried and tried, but I don't think that you can do anything at runtime in the setup project.  You may want to create your own project that emulates a setup project.

Or, use an open source installer creation software.

This seems to be seriously lacking in the Setup Projects for .NET.

(I use Inno Setup)



If I understand correctly, you are developing your own Installer as an Application, correct?  I.e., this is NOT a setup project?

It's useless to continue without that knowledge, but as far as dynamically setting up properties, you can absolutely do that.

See the attached code.

Let me know,

Public Property Edit1Value As String
      ' Here you can run any code you want, or even call a procedure.
      return [member]
   End Get
   Set (ByVal Value as String)
      ' Here you can run any code you want, or even call a procedure.
      [member] = value
   End Set
End Property

Open in new window

brian_appliedcpuAuthor Commented:
Thanks for your reply.

My VS2005 project contains the main application, plus 2 other projects; a setup project and an Installer class library project.

It is within the Setup project where I have added one of the predefined dialog box provided by VS2005; the "Textboxes (A)" dialog box. In the Properties window, the "Textboxes (A)" dialog box has, as one of its properties, an Edit1Value property. Whatever is literally assigned to the Edit1Value property during design-time becomes the default value that appears in the 1st textbox of the dialog box during run-time.

Rather than assign a literal value to the Edit1Value at design-time, I am trying to assign a value to this property at runtime. What I don't understand is how to execute *any* code to fill this property before the dialog box appears during Setup. Whether the code is Property Get, Property Set, or any other code, I just can't figure out how to execute the code before the dialog box appears. Any GUIs added to the Setup project seem to always execute before any subroutines, functions, or custom action can be executed.

Hope I've not confused you further.
- Steven
All Courses

From novice to tech pro — start learning today.