AquaComm
Posts: 67
Joined: Wed May 06, 2020 3:25 am

SQL Server installation username and password

Hi,
I am trying to figure out how to pass the username and password to the command line.
I assume I can add a dialog asking the end user for their username and password as well as confirm a suggested password for the sa user however how do I get that info into the command line.
The Command Line editor only allows Folder/Environment Variable/Registry value so having my dialog save the data to PROPERTIES is not going to work.
Presumably I can save the properties into the registry and copy them from there to the Command Line but I would then need to implement creating encrypted values.
How do you do it?
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: SQL Server installation username and password

Hello,

I am not quite sure I fully understand the scenario here, so could you please give me some more details?

If you refer to the parameters described here:

Install and configure SQL Server on Windows from the command prompt

then I think you could use properties.

For instance, something like this:

Code: Select all

/SQLSVCACCOUNT=[USERNAME_PROP]
where USERNAME_PROP is a property that holds the value you desire.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 67
Joined: Wed May 06, 2020 3:25 am

Re: SQL Server installation username and password

I have a dialog that requests the information we need:
2024-08-29_08-43-47.png
2024-08-29_08-43-47.png (58.96 KiB) Viewed 14253 times
However, when I open your dialog to edit the command line there is no provision for inserting that property:
2024-08-29_08-45-26.png
2024-08-29_08-45-26.png (20.27 KiB) Viewed 14253 times
Perhaps I should make a suggestion that "Insert References To" should have provision to select from a "Properties" dropdown :D or have I missed something!
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL Server installation username and password

Hello,

To be able to select a property reference you should just right click on "Command Line" field and select the "Property..." context menu option.
screen1.png
screen1.png (60.77 KiB) Viewed 13479 times
For any further questions or doubts feel free to write us back.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 67
Joined: Wed May 06, 2020 3:25 am

Re: SQL Server installation username and password

Right click gives me ....
2024-09-05_14-59-13.png
2024-09-05_14-59-13.png (59.15 KiB) Viewed 13086 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL Server installation username and password

Hi,

To be able to use property references your prerequisite item should not be marked as framework and it should be installed during main package.

This is because framework prerequisites are installed before main package and during this stage the installer properties are not available.

Thus you need to uncheck the framework option and configure your prerequisite to be installed during main package.
screen1.png
screen1.png (91.73 KiB) Viewed 12146 times

Let me know how this works now.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AquaComm
Posts: 67
Joined: Wed May 06, 2020 3:25 am

Re: SQL Server installation username and password

Thanks for this information however I was following your tutorials on how to install SQL Server as a prerequisite. I removed the installation of .Net Framework and then un-ticked the Framework selection and the option to add a property from the drop-down menu appeared as in your screen capture.
However, the end-user must have at least .Net Framework 4.7 installed to be able to install SQL Server so removing that as a prerequisite seems foolhardy.
You seem to be proposing a Catch-22 solution in that you can't install both as prerequisites.
That's OK by me, I'll just create a separate installer that doesn't install both prerequisites.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL Server installation username and password

Hi,

Please note that you should be able to have .Net Framework 4.7 and SQL Server as prerequisites in the same project.

All you need to do is to make sure .Net Framework 4.7 is installed before main package and marked as framework
screen1.png
screen1.png (64.07 KiB) Viewed 10764 times

and SQL Server is installed during main package and not marked as framework.
screen2.png
screen2.png (67.38 KiB) Viewed 10764 times

Let me know if this does not work for you.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”