Skip to content

Commit

Permalink
fix(dmg): license
Browse files Browse the repository at this point in the history
Close #1491
  • Loading branch information
develar committed Apr 24, 2017
1 parent 36fc3db commit 5a163df
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 8 deletions.
14 changes: 9 additions & 5 deletions packages/electron-builder/src/targets/dmgLicense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ export async function addLicenseToDmg(packager: PlatformPackager<any>, dmgPath:
const kind = item.file.toLowerCase().endsWith(".rtf") ? "RTF" : "TEXT"
data += `data '${kind}' (${counter}, "${item.langName} SLA") {\n`

data += '$"' + (await readFile(item.file)).toString("hex").toUpperCase() + '"\n'
const hex = (await readFile(item.file)).toString("hex").toUpperCase()
for (let i = 0; i < hex.length; i += 32) {
data += '$"' + hex.substring(i, Math.min(i + 32, hex.length)) + '"\n'
}

data += "};\n\n"
// noinspection SpellCheckingInspection
data += `data 'styl' (${counter}, "${item.langName} SLA") {
$"0003 0000 0000 000C 0009 0015 0000 0000"
$"0000 0000 0000 0000 002A 000C 0009 0015"
$"0100 0000 0000 0000 0000 0000 002E 000C"
$"0009 0015 0000 0000 0000 0000 0000"
$"0003 0000 0000 000C 0009 0014 0000 0000"
$"0000 0000 0000 0000 0027 000C 0009 0014"
$"0100 0000 0000 0000 0000 0000 002A 000C"
$"0009 0014 0000 0000 0000 0000 0000"
};`

counter++
Expand Down
75 changes: 75 additions & 0 deletions test/fixtures/license_en.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Foo
Copyright (c) 2017 Foo Ltd.

*** END USER LICENSE AGREEMENT ***

IMPORTANT: PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THIS SOFTWARE.

1. LICENSE

By receiving, opening the file package, and/or using Foo("Software") containing this software, you agree that this End User User License Agreement(EULA) is a legally binding and valid contract and agree to be bound by it. You agree to abide by the intellectual property laws and all of the terms and conditions of this Agreement.

Unless you have a different license agreement signed by Foo Ltd. your use of Foo indicates your acceptance of this license agreement and warranty.

Subject to the terms of this Agreement, Foo Ltd. grants to you a limited, non-exclusive, non-transferable license, without right to sub-license, to use Foo in accordance with this Agreement and any other written agreement with Foo Ltd.. Foo Ltd. does not transfer the title of Foo to you; the license granted to you is not a sale. This agreement is a binding legal agreement between Foo Ltd. and the purchasers or users of Foo.

If you do not agree to be bound by this agreement, remove Foo from your computer now and, if applicable, promptly return to Foo Ltd. by mail any copies of Foo and related documentation and packaging in your possession.

2. DISTRIBUTION

Foo and the license herein granted shall not be copied, shared, distributed, re-sold, offered for re-sale, transferred or sub-licensed in whole or in part except that you may make one copy for archive purposes only. For information about redistribution of Foo contact Foo Ltd..

3. USER AGREEMENT

3.1 Use

Your license to use Foo is limited to the number of licenses purchased by you. You shall not allow others to use, copy or evaluate copies of Foo.

3.2 Use Restrictions

You shall use Foo in compliance with all applicable laws and not for any unlawful purpose. Without limiting the foregoing, use, display or distribution of Foo together with material that is pornographic, racist, vulgar, obscene, defamatory, libelous, abusive, promoting hatred, discriminating or displaying prejudice based on religion, ethnic heritage, race, sexual orientation or age is strictly prohibited.

Each licensed copy of Foo may be used on one single computer location by one user. Use of Foo means that you have loaded, installed, or run Foo on a computer or similar device. If you install Foo onto a multi-user platform, server or network, each and every individual user of Foo must be licensed separately.

You may make one copy of Foo for backup purposes, providing you only have one copy installed on one computer being used by one person. Other users may not use your copy of Foo . The assignment, sublicense, networking, sale, or distribution of copies of Foo are strictly forbidden without the prior written consent of Foo Ltd.. It is a violation of this agreement to assign, sell, share, loan, rent, lease, borrow, network or transfer the use of Foo. If any person other than yourself uses Foo registered in your name, regardless of whether it is at the same time or different times, then this agreement is being violated and you are responsible for that violation!

3.3 Copyright Restriction

This Software contains copyrighted material, trade secrets and other proprietary material. You shall not, and shall not attempt to, modify, reverse engineer, disassemble or decompile Foo. Nor can you create any derivative works or other works that are based upon or derived from Foo in whole or in part.

Foo Ltd.'s name, logo and graphics file that represents Foo shall not be used in any way to promote products developed with Foo . Foo Ltd. retains sole and exclusive ownership of all right, title and interest in and to Foo and all Intellectual Property rights relating thereto.

Copyright law and international copyright treaty provisions protect all parts of Foo, products and services. No program, code, part, image, audio sample, or text may be copied or used in any way by the user except as intended within the bounds of the single user program. All rights not expressly granted hereunder are reserved for Foo Ltd..

3.4 Limitation of Responsibility

You will indemnify, hold harmless, and defend Foo Ltd. , its employees, agents and distributors against any and all claims, proceedings, demand and costs resulting from or in any way connected with your use of Foo Ltd.'s Software.

In no event (including, without limitation, in the event of negligence) will Foo Ltd. , its employees, agents or distributors be liable for any consequential, incidental, indirect, special or punitive damages whatsoever (including, without limitation, damages for loss of profits, loss of use, business interruption, loss of information or data, or pecuniary loss), in connection with or arising out of or related to this Agreement, Foo or the use or inability to use Foo or the furnishing, performance or use of any other matters hereunder whether based upon contract, tort or any other theory including negligence.

Foo Ltd.'s entire liability, without exception, is limited to the customers' reimbursement of the purchase price of the Software (maximum being the lesser of the amount paid by you and the suggested retail price as listed by Foo Ltd. ) in exchange for the return of the product, all copies, registration papers and manuals, and all materials that constitute a transfer of license from the customer back to Foo Ltd..

3.5 Warranties

Except as expressly stated in writing, Foo Ltd. makes no representation or warranties in respect of this Software and expressly excludes all other warranties, expressed or implied, oral or written, including, without limitation, any implied warranties of merchantable quality or fitness for a particular purpose.

3.6 Governing Law

This Agreement shall be governed by the law of the Bulgaria applicable therein. You hereby irrevocably attorn and submit to the non-exclusive jurisdiction of the courts of Bulgaria therefrom. If any provision shall be considered unlawful, void or otherwise unenforceable, then that provision shall be deemed severable from this License and not affect the validity and enforceability of any other provisions.

3.7 Termination

Any failure to comply with the terms and conditions of this Agreement will result in automatic and immediate termination of this license. Upon termination of this license granted herein for any reason, you agree to immediately cease use of Foo and destroy all copies of Foo supplied under this Agreement. The financial obligations incurred by you shall survive the expiration or termination of this license.

4. DISCLAIMER OF WARRANTY

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. THIS DISCLAIMER CONCERNS ALL FILES GENERATED AND EDITED BY Foo AS WELL.

5. CONSENT OF USE OF DATA

You agree that Foo Ltd. may collect and use information gathered in any manner as part of the product support services provided to you, if any, related to Foo.Foo Ltd. may also use this information to provide notices to you which may be of use or interest to you.

6. REFUND POLICY

Since we offers non-tangible, irrevocable goods we do not provide refunds after the product is purchased, which you acknowledge prior to purchasing any product at our website. We do have a fully functioning 30 day trial available which is identical to the product that you may download and try before making a purchase. If you have any questions about this Policy, please contact us.

6 changes: 3 additions & 3 deletions test/src/mac/dmgTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { attachAndExecute } from "electron-builder/out/targets/dmg"
import { copy, remove, writeFile } from "fs-extra-p"
import * as path from "path"
import { assertThat } from "../helpers/fileAssert"
import { app, assertPack } from "../helpers/packTester"
import { app, assertPack, copyTestAsset } from "../helpers/packTester"

test.ifMac("no build directory", app({
targets: Platform.MAC.createTarget("dmg"),
Expand Down Expand Up @@ -150,7 +150,7 @@ test.ifAll.ifMac("disable dmg icon (light), bundleVersion", () => {
})
})

test.ifAll("multi language license", app({
test.ifAll.ifMac("multi language license", app({
targets: Platform.MAC.createTarget("dmg"),
}, {
projectDirCreated: projectDir => {
Expand All @@ -176,7 +176,7 @@ test.ifAll.ifMac("license en", app({
}, {
projectDirCreated: projectDir => {
return BluebirdPromise.all([
writeFile(path.join(projectDir, "build", "license_ru.txt"), "Hi\n".repeat(12)),
copyTestAsset("license_en.txt", path.join(projectDir, "build", "license_en.txt")),
])
},
}))

0 comments on commit 5a163df

Please sign in to comment.