Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Install from ISO fails due to hardcoded reliance on Source folder #40

Closed
kilasuit opened this issue Mar 11, 2016 · 7 comments · Fixed by #301
Closed
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. bug The issue is a bug.

Comments

@kilasuit
Copy link

If you mount a SQL Server ISO to the disk of a machine then the SourceFolder is always set as "Source" which in the SQL Server ISO isnt a valid path

@afscrome
Copy link

afscrome commented Jul 4, 2016

You can override this by setting the SourceFolder to the empty string on the resoruce. It does however seem very odd that the 'Sources' directory is automatically appended to the SourcePath parameter - surely it is the responsibility of the SourcePath to include the 'sources' directory if that is the location of the sql sources?

xSqlServerSetup SqlServer {
    SourcePath = "d:\"
    SourceFolder = ''
    # ..
}

@kwirkykat kwirkykat added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Aug 2, 2016
@cwegener
Copy link
Contributor

cwegener commented Sep 6, 2016

I am very interested to hear the logic behind the 'SourceFolder' attribute. I also don't quite understand why this attribute exists and why it is set to 'Source' by default.

@rolflobker
Copy link

I agree. Empty strings should be optional. Not necessary to bypass hardcoded values.

The use of both a Source folder and a Source path sees redundant to me.

@johlju
Copy link
Member

johlju commented Sep 8, 2016

After a quick glance at the code it seems that when using the parameter SourceCredential, then only SourcePath is used to mount the UNC path using net use.
So I think that SourcePath was meant to be the UNC path to the share. And SourceFolder was an optional folder under the share from which to robocopy the setup files to a temporary folder (creating the optional SourceFolder in the temporary folder too) on to the server which is being configured. When the files has be copied, the share is dismounted and SourcePath is switch to the new temporary folder, then setup is run from the joined path of both SourcePath and SourceFolder.

So I think if net use could be used to directly mount a folder under a share, like \\fileserver\share\folder, then we might be able to remove the parameter SourceFolder.

If we leave SourceFolderin, I don't think it should be hardcoded to the string 'Source'. It should be optional.

@rolflobker
Copy link

rolflobker commented Sep 8, 2016

net use can be used to directly mount a folder under a share.
net use * \fileserver\share\folder\otherfolder\whysomany works just fine.

Alternatively, use native powershell:
New-PSDrive -Name "sqlsetup" -PSProvider FileSystem -Root "\server\share\folder"

edit: might need to choose regular driveletter and make persistant to be able to use outside of the powershel session in case of calling executables. But I believe Invoke-item will just launch \server\share\folder\setup.exe.

Is it at all necessary to create a mapping?

@johlju
Copy link
Member

johlju commented Sep 9, 2016

Regarding if it necessary to create the mapping, probably not. It's using net use with the SourceCredential to logon to the UNC path. I believe if we run the resource using a credential in PsDscRunAsCredential then net use wouldn't be needed to logon to the UNC path.
But then we also need to rename SourceCredential parameter to Credential to handle PowerShell 4.0 DSC?

@johlju johlju changed the title Install from ISO fails due to hardcoded reliance on Source folder BREAKING CHANGE: Install from ISO fails due to hardcoded reliance on Source folder Jan 2, 2017
@johlju johlju added the breaking change When used on an issue, the issue has been determined to be a breaking change. label Jan 2, 2017
@johlju
Copy link
Member

johlju commented Jan 9, 2017

I'm working on removing SourceFolder parameter. In my tests it successfully connected to a folder beneath the resource when providing the entire path in SourcePath.

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Jan 9, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 16, 2017
@johlju johlju removed their assignment Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants