Page 1 of 1

Help with Write Registry

Posted: Thu Feb 13, 2020 5:57 pm
by mdavtec
Not sure what I'm missing, but following code doesn't work.

Code: Select all

Write Registry Key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.TEST\MSSQLServer\SuperSocketNetLib\Tcp\IPAll\TcpDynamicPorts, 11422 (permanent)
Apply Install

Set Variable SQLTCPDynamicPN to
Read Registry Key HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.TEST\MSSQLServer\SuperSocketNetLib\Tcp\IPAll\TcpDynamicPorts into SQLTCPDynamicPN
MessageBox: SQL Port, TcpDynamicPorts:$SQLTCPDynamicPN$;
Comment: This would still show the old value not 11422.


If I run the installation again, then it would change the value in the registry. Looks like 'Apply Install', when called 2nd time, it works.
I plan to do this for with 'Set x64 bit mode'. And I've tried that but same result.
Any suggestion? Thanks.

Re: Help with Write Registry

Posted: Fri Feb 14, 2020 11:50 am
by FrancescoT
The code looks to be correct. Are you sure Apply Install successfully completes on first time you run the package?

Re: Help with Write Registry

Posted: Tue Mar 10, 2020 4:52 pm
by mdavtec
Sorry for the late reply but it does shows 'COMPLETE'

Re: Help with Write Registry

Posted: Wed Mar 11, 2020 12:29 pm
by FrancescoT
I just tried with invoking "Write Registry" exactly as you did from a test project, and it works fine.
You can try by yourself, test project is attached.

So, if there is a problem ...this has nothing to do with Write Registry.