-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added information about obsolete nuget clients via
\build
features - …
…#38 We'll support only information about new installer because: * The `\build` feature still does not guarantee of work for all cases. #36 (comment) * We don't have any guaranteed information about uninstall operation for our package because of removed uninstall.ps1 #38
- Loading branch information
Showing
22 changed files
with
541 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2016-2017 Denis Kuzmin < entry.reg@gmail.com > :: github.com/3F | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
using System; | ||
using System.IO; | ||
using net.r_eg.DllExport.Wizard.Extensions; | ||
using net.r_eg.MvsSln.Log; | ||
|
||
namespace net.r_eg.DllExport.Wizard | ||
{ | ||
//TODO: | ||
internal sealed class CfgBatWrapper | ||
{ | ||
private const string DXP_INSTALLER = "DllExport.bat"; | ||
|
||
private IWizardConfig config; | ||
private ISender log; | ||
|
||
public CfgBatWrapper(IWizardConfig config, ISender log) | ||
{ | ||
this.config = config ?? throw new ArgumentNullException(nameof(config)); | ||
this.log = log ?? throw new ArgumentNullException(nameof(log)); | ||
} | ||
|
||
public bool TryPrepare() | ||
{ | ||
try { | ||
CopyFromPkg(DXP_INSTALLER); | ||
return true; | ||
} | ||
catch(Exception ex) { | ||
log.send(this, $"Installer: Copy failed `{ex.Message}`", Message.Level.Warn); | ||
} | ||
return false; | ||
} | ||
|
||
private string CopyFromPkg(string fname) | ||
{ | ||
var dxp = Path.Combine(config.PkgPath, fname); | ||
var dest = Path.Combine(config.SlnDir, fname); | ||
|
||
try | ||
{ | ||
if(!File.Exists(dest)) { | ||
File.Copy(dxp, dest, false); | ||
return dest; | ||
} | ||
|
||
if(dest.SHA1HashFromFile() != dxp.SHA1HashFromFile()) { | ||
dest = $"{dest}_{Project.METALIB_PK_TOKEN}{Path.GetExtension(dest)}"; | ||
} | ||
File.Copy(dxp, dest, true); | ||
return dest; | ||
} | ||
finally | ||
{ | ||
File.WriteAllText( | ||
dest, | ||
File.ReadAllText(dest).Replace("set \"wAction=\"", "set \"wAction=Configure\"") | ||
); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.