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

Chocolatey depend on dotnetfx and add skipdotnet to installer #615

Merged
merged 3 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions chocolatey/synctrayzor.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Features include:
<dependencies>
<!-- Chocolatey 0.9.9 required in order to access the chocolateyPackageName and chocolateyPackageVersion environment variables -->
<dependency id="chocolatey" version="0.9.9" />
<!-- Make sure that .Net 4.7.2 or better is installed -->
<dependency id="dotnetfx" version="4.7.2" />
</dependencies>
<releaseNotes>https://github.com/canton7/SyncTrayzor/blob/master/CHANGELOG.md</releaseNotes>
<!--<provides></provides>-->
Expand Down
2 changes: 1 addition & 1 deletion chocolatey/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definitio
$packageName= 'SyncTrayzor'
$file = (Join-Path $toolsDir 'SyncTrayzorSetup-x86.exe')
$file64 = (Join-Path $toolsDir 'SyncTrayzorSetup-x64.exe')
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /SkipDotNetInstall'
$fileType = 'exe'
$validExitCodes = @(0)

Expand Down
29 changes: 16 additions & 13 deletions installer/common.iss
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,27 @@ begin
end
end;

function CmdLineParamGiven(const Value: String): Boolean;
var
I: Integer;
begin
// Can't use {param}, as it doesn't match flags with no value
Result := False;
for I := 1 to ParamCount do
if CompareText(ParamStr(I), Value) = 0 then
begin
Result := True;
Exit;
end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
// 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
// If the installers indicate that they want a restart, this should be done at the end of installation.
// Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

if DotNetIsMissing() then
if not CmdLineParamGiven('/SkipDotNetInstall') and DotNetIsMissing() then
begin
Result := InstallDotNet();
end;
Expand All @@ -268,19 +282,8 @@ begin
end;

function ShouldStartSyncTrayzor(): Boolean;
var
flagPassed: Boolean;
i: Integer;
begin
// Can't use {param}, as it doesn't match flags with no value
flagPassed := False;
for i := 0 to ParamCount do begin
if ParamStr(i) = '/StartSyncTrayzor' then begin
flagPassed := True;
break;
end;
end;
Result := (not WizardSilent()) or flagPassed;
Result := (not WizardSilent()) or CmdLineParamGiven('/StartSyncTrayzor');
end;

function SyncTrayzorStartFlags(param: String): String;
Expand Down