Compare commits

...

34 Commits

Author SHA1 Message Date
3c0378142a Resin CLI v0.5.0 2015-03-19 11:45:38 -04:00
a524bffaa2 Integrate with SDK v1.0.0 2015-03-19 11:45:07 -04:00
4b3decbe03 Resin CLI v0.4.1 2015-03-17 08:54:27 -04:00
fa258a84cc Show a spinner if no progress state in os download command 2015-03-16 11:45:17 -04:00
5efa7309be Fix bug in device init 2015-03-16 11:06:44 -04:00
6e6a01c33c HTML Encode documentation require parameters 2015-03-16 08:51:26 -04:00
94ce15bc2c Make CapitanoDoc output *.markdown files 2015-03-16 08:45:44 -04:00
b20ed34756 Resin CLI v0.4.0 2015-03-12 12:07:51 -04:00
0b188b7ce9 Fetch resin-vcs from NPM 2015-03-12 12:07:18 -04:00
80e0f20301 Make device init attempt to get application id from current directory 2015-03-12 12:03:59 -04:00
8410a709c9 Make use of resin-vcs instead of using gitwrap directly 2015-03-12 11:24:36 -04:00
13011cca23 Regenerate command documentatio 2015-03-11 09:05:48 -04:00
53197856ab Extend device init help message 2015-03-11 09:05:20 -04:00
cb5bb69b47 Get rid of gitCli in favor of gitwrap 2015-03-11 09:03:13 -04:00
4bfe52d73b Require CLI to be updated when running os install 2015-03-11 08:49:26 -04:00
58f557065e Resin CLI v0.3.0 2015-03-10 14:42:48 -04:00
9d8228e1c6 Add ENOGIT specific error message 2015-03-10 13:56:55 -04:00
fec840b897 Upgrade gitwrap to v1.1.0 2015-03-10 13:53:35 -04:00
8fbde4c452 Make use of gitwrap 2015-03-10 10:03:49 -04:00
0cc1765a1e Regenerate documentation 2015-03-09 19:49:46 -04:00
f0346b1fd0 Allow to interactively configure network for os download 2015-03-09 19:42:43 -04:00
1bb798a8b8 Get rid of automatic cache name generation logic 2015-03-09 12:38:37 -04:00
4c35badcad Upgrade Resin SDK to v0.0.2 2015-03-09 11:49:52 -04:00
6ba97cd961 Automate resin init command 2015-03-09 09:14:39 -04:00
af08a2f306 Add LICENSE file 2015-03-05 15:43:39 -04:00
ded24432a5 Remove windows installer from the codebase
Has been moved to https://github.com/resin-io/resin-cli-installer-win32
2015-03-05 15:42:36 -04:00
bf124f196f Remove OS X installer from the codebase
Was moved to https://github.com/resin-io/resin-cli-installer-osx
2015-03-05 12:33:06 -04:00
6fc2d5eee1 Resin CLI v0.2.3 2015-03-05 12:16:48 -04:00
dbe181ea84 Upgrade resin-cli-visuals to v0.0.6 2015-03-05 12:16:31 -04:00
dd169d356a Resin CLI 0.2.2 2015-03-05 11:56:07 -04:00
4fbc016d18 Make use of resin-cli-visuals from NPM 2015-03-05 11:54:53 -04:00
e00ee40bea Resin CLI v0.2.1 2015-03-04 14:48:25 -04:00
9c7b36e1d8 Improve resin update help section 2015-03-04 14:47:46 -04:00
cefa9d1e31 Fix bug with update command 2015-03-04 14:46:34 -04:00
83 changed files with 480 additions and 1159 deletions

View File

@ -1,5 +1,7 @@
(function() {
var _, async, commandOptions, resin, visuals;
var _, async, commandOptions, path, resin, vcs, visuals;
path = require('path');
_ = require('lodash-contrib');
@ -11,6 +13,8 @@
commandOptions = require('./command-options');
vcs = require('resin-vcs');
exports.create = {
signature: 'app create <name>',
description: 'create an application',
@ -98,28 +102,53 @@
}
};
exports.init = {
signature: 'init <id>',
description: 'init an application',
help: 'Use this command to associate a local project to an existing resin.io application.\n\nThe application should be a git repository before issuing this command.\nNotice this command adds a `resin` git remote to your application.\n\nExamples:\n\n $ cd myApp && resin init 91',
exports.associate = {
signature: 'app associate <id>',
description: 'associate a resin project',
help: 'Use this command to associate a project directory with a resin application.\n\nThis command adds a \'resin\' git remote to the directory and runs git init if necessary.\n\nExamples:\n\n $ resin app associate 91\n $ resin app associate 91 --project my/app/directory',
permission: 'user',
action: function(params, options, done) {
var currentDirectory;
currentDirectory = process.cwd();
return async.waterfall([
function(callback) {
return resin.vcs.isResinProject(currentDirectory, callback);
}, function(isResinProject, callback) {
var error;
if (isResinProject) {
error = new Error('Project is already a resin application.');
return callback(error);
}
return callback();
return vcs.initialize(currentDirectory, callback);
}, function(callback) {
return resin.models.application.get(params.id, callback);
}, function(application, callback) {
return resin.vcs.initProjectWithApplication(application, currentDirectory, callback);
return vcs.addRemote(currentDirectory, application.git_repository, callback);
}
], function(error, remoteUrl) {
if (error != null) {
return done(error);
}
console.info("git repository added: " + remoteUrl);
return done(null, remoteUrl);
});
}
};
exports.init = {
signature: 'init',
description: 'init an application',
help: 'Use this command to initialise a directory as a resin application.\n\nThis command performs the following steps:\n - Create a resin.io application.\n - Initialize the current directory as a git repository.\n - Add the corresponding git remote to the application.\n\nExamples:\n\n $ resin init\n $ resin init --project my/app/directory',
permission: 'user',
action: function(params, options, done) {
var currentDirectory;
currentDirectory = process.cwd();
return async.waterfall([
function(callback) {
var currentDirectoryBasename;
currentDirectoryBasename = path.basename(currentDirectory);
return visuals.widgets.ask('What is the name of your application?', currentDirectoryBasename, callback);
}, function(applicationName, callback) {
return exports.create.action({
name: applicationName
}, options, callback);
}, function(applicationId, callback) {
return exports.associate.action({
id: applicationId
}, options, callback);
}
], done);
}

View File

@ -1,4 +1,8 @@
(function() {
var _;
_ = require('lodash');
exports.yes = {
signature: 'yes',
description: 'confirm non interactively',
@ -6,14 +10,17 @@
alias: 'y'
};
exports.application = {
exports.optionalApplication = {
signature: 'application',
parameter: 'application',
description: 'application id',
alias: ['a', 'app'],
required: 'You have to specify an application'
alias: ['a', 'app']
};
exports.application = _.defaults({
required: 'You have to specify an application'
}, exports.optionalApplication);
exports.network = {
signature: 'network',
parameter: 'network',

View File

@ -1,5 +1,5 @@
(function() {
var _, async, commandOptions, osAction, path, resin, visuals;
var _, async, commandOptions, osAction, path, resin, vcs, visuals;
_ = require('lodash-contrib');
@ -11,6 +11,8 @@
visuals = require('resin-cli-visuals');
vcs = require('resin-vcs');
commandOptions = require('./command-options');
osAction = require('./os');
@ -82,7 +84,7 @@
if (!_.isEmpty(params.name)) {
return callback(null, params.name);
}
return visuals.widgets.ask('How do you want to name this device?', callback);
return visuals.widgets.ask('How do you want to name this device?', null, callback);
}, function(name, callback) {
return resin.models.device.rename(params.id, name, callback);
}
@ -109,13 +111,19 @@
exports.init = {
signature: 'device init [device]',
description: 'initialise a device with resin os',
help: 'Use this command to download the OS image of a certain application and write it to an SD Card.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nYou need to configure the network type and other settings:\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nExamples:\n\n $ resin device init --application 91 --network ethernet\n $ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret',
options: [commandOptions.application, commandOptions.network, commandOptions.wifiSsid, commandOptions.wifiKey],
help: 'Use this command to download the OS image of a certain application and write it to an SD Card.\n\nNote that this command requires admin privileges.\n\nIf `device` is omitted, you will be prompted to select a device interactively.\n\nNotice this command asks for confirmation interactively.\nYou can avoid this by passing the `--yes` boolean option.\n\nYou can quiet the progress bar by passing the `--quiet` boolean option.\n\nYou may have to unmount the device before attempting this operation.\n\nYou need to configure the network type and other settings:\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nYou can omit network related options to be asked about them interactively.\n\nExamples:\n\n $ resin device init --application 91\n $ resin device init --application 91 --network ethernet\n $ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret',
options: [commandOptions.optionalApplication, commandOptions.network, commandOptions.wifiSsid, commandOptions.wifiKey],
permission: 'user',
action: function(params, options, done) {
params.id = options.application;
return async.waterfall([
function(callback) {
if (options.application != null) {
return callback(null, options.application);
}
return vcs.getApplicationId(process.cwd(), callback);
}, function(applicationId, callback) {
params.id = applicationId;
if (params.device != null) {
return callback(null, params.device);
}

View File

@ -1,5 +1,5 @@
(function() {
var _, async, examplesData, fs, gitCli, path, resin, visuals;
var _, async, examplesData, fs, path, resin, vcs, visuals;
async = require('async');
@ -9,12 +9,12 @@
_ = require('lodash');
gitCli = require('git-cli');
resin = require('resin-sdk');
visuals = require('resin-cli-visuals');
vcs = require('resin-vcs');
examplesData = require('../data/examples.json');
exports.list = {
@ -64,28 +64,14 @@
help: 'Use this command to clone an example application to the current directory\n\nThis command outputs information about the cloning process.\nUse `--quiet` to remove that output.\n\nExample:\n\n $ resin example clone 3',
permission: 'user',
action: function(params, options, done) {
var example;
var currentDirectory, example;
example = examplesData[params.id - 1];
if (example == null) {
return done(new Error("Unknown example: " + id));
}
return async.waterfall([
function(callback) {
var exampleAbsolutePath;
exampleAbsolutePath = path.join(process.cwd(), example.name);
return fs.exists(exampleAbsolutePath, function(exists) {
var error;
if (!exists) {
return callback();
}
error = new Error("Directory exists: " + example.name);
return callback(error);
});
}, function(callback) {
console.info("Cloning " + example.display_name + " to " + example.name);
return gitCli.Repository.clone(example.repository, example.name, callback);
}
], done);
currentDirectory = process.cwd();
console.info("Cloning " + example.display_name + " to " + currentDirectory);
return vcs.clone(example.repository, currentDirectory, done);
}
};

View File

@ -1,5 +1,5 @@
(function() {
var _, async, capitano, commandOptions, fs, resin, visuals;
var SSH_KEY_WIDTH, _, async, capitano, commandOptions, fs, resin, visuals;
_ = require('lodash');
@ -33,6 +33,8 @@
}
};
SSH_KEY_WIDTH = 43;
exports.info = {
signature: 'key <id>',
description: 'list a single ssh key',
@ -40,12 +42,10 @@
permission: 'user',
action: function(params, options, done) {
return resin.models.key.get(params.id, function(error, key) {
var sshKeyWidth;
if (error != null) {
return done(error);
}
sshKeyWidth = resin.settings.get('sshKeyWidth');
key.public_key = '\n' + visuals.helpers.chop(key.public_key, sshKeyWidth);
key.public_key = '\n' + visuals.helpers.chop(key.public_key, SSH_KEY_WIDTH);
console.log(visuals.widgets.table.vertical(key, ['id', 'title', 'public_key']));
return done();
});

View File

@ -1,5 +1,5 @@
(function() {
var _, async, commandOptions, diskio, fs, mkdirp, os, path, progressStream, resin, visuals;
var _, async, commandOptions, diskio, fs, mkdirp, npm, os, packageJSON, path, progressStream, resin, updateActions, visuals;
_ = require('lodash-contrib');
@ -23,40 +23,64 @@
commandOptions = require('./command-options');
npm = require('../npm');
packageJSON = require('../../package.json');
updateActions = require('./update');
exports.download = {
signature: 'os download <id>',
description: 'download device OS',
help: 'Use this command to download the device OS configured to a specific network.\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nBy default, this command saved the downloaded image into a resin specific directory.\nYou can save it to a custom location by specifying the `--output` option.\n\nExamples:\n\n $ resin os download 91 --network ethernet\n $ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123\n $ resin os download 91 --network ethernet --output ~/MyResinOS.zip',
help: 'Use this command to download the device OS configured to a specific network.\n\nEthernet:\n You can setup the device OS to use ethernet by setting the `--network` option to "ethernet".\n\nWifi:\n You can setup the device OS to use wifi by setting the `--network` option to "wifi".\n If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.\n\nAlternatively, you can omit all kind of network configuration options to configure interactively.\n\nYou have to specify an output location with the `--output` option.\n\nExamples:\n\n $ resin os download 91 --output ~/MyResinOS.zip\n $ resin os download 91 --network ethernet --output ~/MyResinOS.zip\n $ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123 --output ~/MyResinOS.zip\n $ resin os download 91 --network ethernet --output ~/MyResinOS.zip',
options: [
commandOptions.network, commandOptions.wifiSsid, commandOptions.wifiKey, {
signature: 'output',
parameter: 'output',
description: 'output file',
alias: 'o'
alias: 'o',
required: 'You need to specify an output file'
}
],
permission: 'user',
action: function(params, options, done) {
var fileName, osParams;
var osParams;
osParams = {
network: options.network,
wifiSsid: options.ssid,
wifiKey: options.key,
appId: params.id
};
fileName = resin.models.os.generateCacheName(osParams);
if (options.output == null) {
options.output = path.join(resin.settings.get('directories.os'), fileName);
}
return async.waterfall([
function(callback) {
if (osParams.network != null) {
return callback();
}
return visuals.patterns.selectNetworkParameters(function(error, parameters) {
if (error != null) {
return callback(error);
}
_.extend(osParams, parameters);
return callback();
});
}, function(callback) {
return mkdirp(path.dirname(options.output), _.unary(callback));
}, function(callback) {
var bar;
var bar, spinner;
console.info("Destination file: " + options.output + "\n");
bar = new visuals.widgets.Progress('Downloading Device OS');
return resin.models.os.download(osParams, options.output, callback, function(state) {
return bar.update(state);
spinner = new visuals.widgets.Spinner('Downloading Device OS (size unknown)');
return resin.models.os.download(osParams, options.output, function(error) {
spinner.stop();
if (error != null) {
return callback(error);
}
}, function(state) {
if (state != null) {
return bar.update(state);
} else {
return spinner.start();
}
});
}
], function(error) {
@ -78,6 +102,14 @@
action: function(params, options, done) {
return async.waterfall([
function(callback) {
return npm.isUpdated(packageJSON.name, packageJSON.version, callback);
}, function(isUpdated, callback) {
if (isUpdated) {
return callback();
}
console.info('Resin CLI is outdated.\n\nIn order to avoid device compatibility issues, this command\nrequires that you have the Resin CLI updated.\n\nUpdating now...');
return updateActions.update.action(params, options, _.unary(callback));
}, function(callback) {
if (params.device != null) {
return callback(null, params.device);
}

View File

@ -1,11 +1,11 @@
(function() {
var open, resin, url;
var open, settings, url;
open = require('open');
url = require('url');
resin = require('resin-sdk');
settings = require('resin-settings-client');
exports.preferences = {
signature: 'preferences',
@ -13,9 +13,8 @@
help: 'Use this command to open the preferences form.\n\nIn the future, we will allow changing all preferences directly from the terminal.\nFor now, we open your default web browser and point it to the web based preferences form.\n\nExamples:\n\n $ resin preferences',
permission: 'user',
action: function() {
var absUrl, preferencesUrl;
preferencesUrl = resin.settings.get('urls.preferences');
absUrl = url.resolve(resin.settings.get('remoteUrl'), preferencesUrl);
var absUrl;
absUrl = url.resolve(settings.get('remoteUrl'), '/preferences');
return open(absUrl);
}
};

View File

@ -1,38 +1,22 @@
(function() {
var _, async, npm, packageJSON;
var npm, packageJSON;
async = require('async');
_ = require('lodash-contrib');
npm = require('npm');
npm = require('../npm');
packageJSON = require('../../package.json');
exports.update = {
signature: 'update',
description: 'update the resin cli',
help: 'Use this command to update the Resin CLI\n\nThis command outputs information about the update process.\nUse `--quiet` to remove that output.\n\nExamples:\n\n $ resin update',
help: 'Use this command to update the Resin CLI\n\nThis command outputs information about the update process.\nUse `--quiet` to remove that output.\n\nThe Resin CLI checks for updates once per day.\n\nMajor updates require a manual update with this update command,\nwhile minor updates are applied automatically.\n\nExamples:\n\n $ resin update',
action: function(params, options, done) {
return async.waterfall([
function(callback) {
options = {
loglevel: 'silent',
global: true
};
return npm.load(options, _.unary(callback));
}, function(callback) {
return npm.commands.update([packageJSON.name], callback);
}, function(data, lite, callback) {
var newVersion;
if (_.isEmpty(data)) {
return callback(new Error('You are already running the latest version'));
}
newVersion = _.last(_.first(_.last(data)).split('@'));
console.info("Upgraded " + packageJSON.name + " to v" + newVersion + ".");
return callback();
return npm.update(packageJSON.name, function(error, version) {
if (error != null) {
return done(error);
}
], done);
console.info("Upgraded " + packageJSON.name + " to v" + version + ".");
return done(null, version);
});
}
};

View File

@ -77,6 +77,8 @@
capitano.command(actions.app.restart);
capitano.command(actions.app.associate);
capitano.command(actions.app.init);
capitano.command(actions.device.list);
@ -150,10 +152,6 @@
return update.check(callback);
}, function(callback) {
return plugins.register('resin-plugin-', callback);
}, function(callback) {
var dataPrefix;
dataPrefix = resin.settings.get('dataPrefix');
return resin.data.prefix.set(dataPrefix, callback);
}, function(callback) {
var cli;
cli = capitano.parse(process.argv);

View File

@ -28,6 +28,8 @@
message += 'Try running this command again prefixing it with `sudo`.';
}
console.error(message);
} else if (error.code === 'ENOGIT') {
console.error('Git is not installed on this system.\nHead over to http://git-scm.com to install it and run this command again.');
} else if (error.message != null) {
console.error(error.message);
}

63
build/npm.js Normal file
View File

@ -0,0 +1,63 @@
(function() {
var _, async, npm;
npm = require('npm');
async = require('async');
_ = require('lodash-contrib');
exports.update = function(name, callback) {
return async.waterfall([
function(callback) {
var options;
options = {
loglevel: 'silent',
global: true
};
return npm.load(options, _.unary(callback));
}, function(callback) {
return npm.commands.update([name], function(error, data) {
return callback(error, data);
});
}, function(data, callback) {
var error, newVersion;
if (_.isEmpty(data)) {
error = new Error('You are already running the latest version');
return callback(error);
}
newVersion = _.last(_.first(_.last(data)).split('@'));
return callback(null, newVersion);
}
], callback);
};
exports.getLatestVersion = function(name, callback) {
return async.waterfall([
function(callback) {
var options;
options = {
loglevel: 'silent',
global: true
};
return npm.load(options, _.unary(callback));
}, function(callback) {
return npm.commands.view([name], true, function(error, data) {
var versions;
versions = _.keys(data);
return callback(error, _.first(versions));
});
}
], callback);
};
exports.isUpdated = function(name, currentVersion, callback) {
return exports.getLatestVersion(name, function(error, latestVersion) {
if (error != null) {
return callback(error);
}
return callback(null, currentVersion === latestVersion);
});
};
}).call(this);

View File

@ -1,68 +0,0 @@
{
"name": "resin-cli",
"version": "0.0.1",
"description": "Git Push to your devices",
"main": "./lib/actions/index.coffee",
"repository": {
"type": "git",
"url": "git@bitbucket.org:rulemotion/resin-cli.git"
},
"preferGlobal": true,
"bundled_engine": "v0.12.0",
"man": [
"./man/resin.1",
"./man/resin-completion.1",
"./man/resin-plugins.1"
],
"bin": {
"resin": "./bin/resin"
},
"scripts": {
"prepublish": "gulp build",
"test": "gult test",
"install": "node build/install-node.js bin/node"
},
"keywords": [
"resin",
"git"
],
"author": "Juan Cruz Viotti <juanchiviotti@gmail.com>",
"license": "MIT",
"optionalDependencies": {
"windosu": "^0.1.3"
},
"devDependencies": {
"chai": "~1.9.2",
"gulp": "~3.8.9",
"gulp-coffee": "^2.2.0",
"gulp-coffeelint": "~0.4.0",
"gulp-marked-man": "~0.3.1",
"gulp-mocha": "~1.1.1",
"gulp-shell": "^0.2.11",
"gulp-util": "~3.0.1",
"mocha": "~2.0.1",
"mocha-notifier-reporter": "~0.1.0",
"run-sequence": "~1.0.2",
"sinon": "~1.12.1",
"sinon-chai": "~2.6.0"
},
"dependencies": {
"async": "~0.9.0",
"capitano": "~1.5.0",
"coffee-script": "~1.8.0",
"conf.js": "^0.1.1",
"diskio": "^1.0.0",
"drivelist": "^1.2.0",
"git-cli": "~0.8.2",
"lodash": "~2.4.1",
"lodash-contrib": "~241.4.14",
"mkdirp": "~0.5.0",
"node-binary": "^1.0.1",
"nplugm": "^2.0.0",
"open": "0.0.5",
"progress-stream": "^0.5.0",
"resin-cli-visuals": "resin-io/resin-cli-visuals",
"resin-sdk": "resin-io/resin-sdk",
"underscore.string": "~2.4.0"
}
}

View File

@ -0,0 +1,10 @@
# app associate &#60;id&#62;
Use this command to associate a project directory with a resin application.
This command adds a 'resin' git remote to the directory and runs git init if necessary.
Examples:
$ resin app associate 91
$ resin app associate 91 --project my/app/directory

View File

@ -1,4 +1,4 @@
# app create <name>
# app create &#60;name&#62;
Use this command to create a new resin.io application.
@ -16,6 +16,6 @@ Examples:
## Options
### --type, -t <type>
### --type, -t &#60;type&#62;
application type

View File

@ -1,4 +1,4 @@
# app <id>
# app &#60;id&#62;
Use this command to show detailed information for a single application.

13
doc/app/init.markdown Normal file
View File

@ -0,0 +1,13 @@
# init
Use this command to initialise a directory as a resin application.
This command performs the following steps:
- Create a resin.io application.
- Initialize the current directory as a git repository.
- Add the corresponding git remote to the application.
Examples:
$ resin init
$ resin init --project my/app/directory

View File

@ -1,10 +0,0 @@
# init <id>
Use this command to associate a local project to an existing resin.io application.
The application should be a git repository before issuing this command.
Notice this command adds a `resin` git remote to your application.
Examples:
$ cd myApp && resin init 91

View File

@ -1,4 +1,4 @@
# app rm <id>
# app rm &#60;id&#62;
Use this command to remove a resin.io application.

View File

@ -1,4 +1,4 @@
# app restart <id>
# app restart &#60;id&#62;
Use this command to restart all devices that belongs to a certain application.

View File

@ -13,10 +13,10 @@ Examples:
## Options
### --username, -u <username>
### --username, -u &#60;username&#62;
user name
### --password, -p <password>
### --password, -p &#60;password&#62;
user password

View File

@ -18,14 +18,14 @@ Examples:
## Options
### --email, -e <email>
### --email, -e &#60;email&#62;
user email
### --username, -u <username>
### --username, -u &#60;username&#62;
user name
### --password, -p <user password>
### --password, -p &#60;user password&#62;
user password

View File

@ -1,4 +1,4 @@
# device identify <uuid>
# device identify &#60;uuid&#62;
Use this command to identify a device.

View File

@ -1,4 +1,4 @@
# device <id>
# device &#60;id&#62;
Use this command to show information about a single device.

View File

@ -22,25 +22,28 @@ Wifi:
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
You can omit network related options to be asked about them interactively.
Examples:
$ resin device init --application 91
$ resin device init --application 91 --network ethernet
$ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret
## Options
### --application, --a,app, --a,app <application>
### --application, --a,app, --a,app &#60;application&#62;
application id
### --network, -n <network>
### --network, -n &#60;network&#62;
network type
### --ssid, -s <ssid>
### --ssid, -s &#60;ssid&#62;
wifi ssid, if network is wifi
### --key, -k <key>
### --key, -k &#60;key&#62;
wifi key, if network is wifi

View File

@ -8,6 +8,6 @@ Examples:
## Options
### --application, --a,app, --a,app <application>
### --application, --a,app, --a,app &#60;application&#62;
application id

View File

@ -1,4 +1,4 @@
# device rm <id>
# device rm &#60;id&#62;
Use this command to remove a device from resin.io.

View File

@ -1,4 +1,4 @@
# device rename <id> [name]
# device rename &#60;id&#62; [name]
Use this command to rename a device.

View File

@ -1,4 +1,4 @@
# env add <key> [value]
# env add &#60;key&#62; [value]
Use this command to add an enviroment variable to an application.
@ -17,6 +17,6 @@ Examples:
## Options
### --application, --a,app, --a,app <application>
### --application, --a,app, --a,app &#60;application&#62;
application id

View File

@ -14,7 +14,7 @@ Example:
## Options
### --application, --a,app, --a,app <application>
### --application, --a,app, --a,app &#60;application&#62;
application id

View File

@ -1,4 +1,4 @@
# env rm <id>
# env rm &#60;id&#62;
Use this command to remove an environment variable from an application.

View File

@ -1,4 +1,4 @@
# env rename <id> <value>
# env rename &#60;id&#62; &#60;value&#62;
Use this command to rename an enviroment variable from an application.

View File

@ -1,4 +1,4 @@
# example clone <id>
# example clone &#60;id&#62;
Use this command to clone an example application to the current directory

View File

@ -1,4 +1,4 @@
# example <id>
# example &#60;id&#62;
Use this command to show information of a single example application

View File

@ -1,4 +1,4 @@
# key add <name> [path]
# key add &#60;name&#62; [path]
Use this command to associate a new SSH key with your account.

View File

@ -1,4 +1,4 @@
# key <id>
# key &#60;id&#62;
Use this command to show information about a single SSH key.

View File

@ -1,4 +1,4 @@
# key rm <id>
# key rm &#60;id&#62;
Use this command to remove a SSH key from resin.io.

View File

@ -1,4 +1,4 @@
# note <|note>
# note &#60;|note&#62;
Use this command to set or update a device note.
@ -13,6 +13,6 @@ Examples:
## Options
### --device, --d,dev, --d,dev <device>
### --device, --d,dev, --d,dev &#60;device&#62;
device id

View File

@ -1,4 +1,4 @@
# os download <id>
# os download &#60;id&#62;
Use this command to download the device OS configured to a specific network.
@ -9,29 +9,31 @@ Wifi:
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
By default, this command saved the downloaded image into a resin specific directory.
You can save it to a custom location by specifying the `--output` option.
Alternatively, you can omit all kind of network configuration options to configure interactively.
You have to specify an output location with the `--output` option.
Examples:
$ resin os download 91 --network ethernet
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123
$ resin os download 91 --output ~/MyResinOS.zip
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123 --output ~/MyResinOS.zip
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
## Options
### --network, -n <network>
### --network, -n &#60;network&#62;
network type
### --ssid, -s <ssid>
### --ssid, -s &#60;ssid&#62;
wifi ssid, if network is wifi
### --key, -k <key>
### --key, -k &#60;key&#62;
wifi key, if network is wifi
### --output, -o <output>
### --output, -o &#60;output&#62;
output file

View File

@ -1,4 +1,4 @@
# os install <image> [device]
# os install &#60;image&#62; [device]
Use this command to write an operating system image to a device.

View File

@ -1,4 +1,4 @@
# plugin install <name>
# plugin install &#60;name&#62;
Use this command to install a resin plugin

View File

@ -1,4 +1,4 @@
# plugin rm <name>
# plugin rm &#60;name&#62;
Use this command to remove a resin.io plugin.

View File

@ -1,4 +1,4 @@
# plugin update <name>
# plugin update &#60;name&#62;
Use this command to update a resin plugin

View File

@ -5,6 +5,11 @@ Use this command to update the Resin CLI
This command outputs information about the update process.
Use `--quiet` to remove that output.
The Resin CLI checks for updates once per day.
Major updates require a manual update with this update command,
while minor updates are applied automatically.
Examples:
$ resin update

View File

@ -12,7 +12,7 @@ capitano.command
action = require(params.file)
for actionName, actionCommand of action
output = path.join(params.output, "#{actionName}.md")
output = path.join(params.output, "#{actionName}.markdown")
fs.writeFileSync(output, markdown.command(actionCommand))
return done()

View File

@ -1,4 +1,5 @@
_ = require('lodash')
ent = require('ent')
utils = require('./utils')
exports.option = (option) ->
@ -6,7 +7,7 @@ exports.option = (option) ->
exports.command = (command) ->
result = """
# #{command.signature}
# #{ent.encode(command.signature)}
#{command.help}\n
"""

View File

@ -1,4 +1,5 @@
_ = require('lodash')
ent = require('ent')
exports.getOptionPrefix = (signature) ->
if signature.length > 1
@ -22,4 +23,4 @@ exports.parseSignature = (option) ->
if option.parameter?
result += " <#{option.parameter}>"
return result
return ent.encode(result)

View File

@ -1,8 +1,10 @@
path = require('path')
_ = require('lodash-contrib')
async = require('async')
resin = require('resin-sdk')
visuals = require('resin-cli-visuals')
commandOptions = require('./command-options')
vcs = require('resin-vcs')
exports.create =
signature: 'app create <name>'
@ -130,18 +132,18 @@ exports.remove =
resin.models.application.remove(params.id, callback)
, done
exports.init =
signature: 'init <id>'
description: 'init an application'
exports.associate =
signature: 'app associate <id>'
description: 'associate a resin project'
help: '''
Use this command to associate a local project to an existing resin.io application.
Use this command to associate a project directory with a resin application.
The application should be a git repository before issuing this command.
Notice this command adds a `resin` git remote to your application.
This command adds a 'resin' git remote to the directory and runs git init if necessary.
Examples:
$ cd myApp && resin init 91
$ resin app associate 91
$ resin app associate 91 --project my/app/directory
'''
permission: 'user'
action: (params, options, done) ->
@ -150,18 +152,50 @@ exports.init =
async.waterfall [
(callback) ->
resin.vcs.isResinProject(currentDirectory, callback)
(isResinProject, callback) ->
if isResinProject
error = new Error('Project is already a resin application.')
return callback(error)
return callback()
vcs.initialize(currentDirectory, callback)
(callback) ->
resin.models.application.get(params.id, callback)
(application, callback) ->
resin.vcs.initProjectWithApplication(application, currentDirectory, callback)
vcs.addRemote(currentDirectory, application.git_repository, callback)
], done
], (error, remoteUrl) ->
return done(error) if error?
console.info("git repository added: #{remoteUrl}")
return done(null, remoteUrl)
exports.init =
signature: 'init'
description: 'init an application'
help: '''
Use this command to initialise a directory as a resin application.
This command performs the following steps:
- Create a resin.io application.
- Initialize the current directory as a git repository.
- Add the corresponding git remote to the application.
Examples:
$ resin init
$ resin init --project my/app/directory
'''
permission: 'user'
action: (params, options, done) ->
currentDirectory = process.cwd()
async.waterfall([
(callback) ->
currentDirectoryBasename = path.basename(currentDirectory)
visuals.widgets.ask('What is the name of your application?', currentDirectoryBasename, callback)
(applicationName, callback) ->
exports.create.action(name: applicationName, options, callback)
(applicationId, callback) ->
exports.associate.action(id: applicationId, options, callback)
], done)

View File

@ -1,15 +1,20 @@
_ = require('lodash')
exports.yes =
signature: 'yes'
description: 'confirm non interactively'
boolean: true
alias: 'y'
exports.application =
exports.optionalApplication =
signature: 'application'
parameter: 'application'
description: 'application id'
alias: [ 'a', 'app' ]
exports.application = _.defaults
required: 'You have to specify an application'
, exports.optionalApplication
exports.network =
signature: 'network'

View File

@ -3,6 +3,7 @@ path = require('path')
async = require('async')
resin = require('resin-sdk')
visuals = require('resin-cli-visuals')
vcs = require('resin-vcs')
commandOptions = require('./command-options')
osAction = require('./os')
@ -122,7 +123,7 @@ exports.rename =
(callback) ->
if not _.isEmpty(params.name)
return callback(null, params.name)
visuals.widgets.ask('How do you want to name this device?', callback)
visuals.widgets.ask('How do you want to name this device?', null, callback)
(name, callback) ->
resin.models.device.rename(params.id, name, callback)
@ -172,13 +173,16 @@ exports.init =
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
You can omit network related options to be asked about them interactively.
Examples:
$ resin device init --application 91
$ resin device init --application 91 --network ethernet
$ resin device init /dev/disk2 --application 91 --network wifi --ssid MyNetwork --key secret
'''
options: [
commandOptions.application
commandOptions.optionalApplication
commandOptions.network
commandOptions.wifiSsid
commandOptions.wifiKey
@ -191,6 +195,11 @@ exports.init =
async.waterfall([
(callback) ->
return callback(null, options.application) if options.application?
vcs.getApplicationId(process.cwd(), callback)
(applicationId, callback) ->
params.id = applicationId
return callback(null, params.device) if params.device?
visuals.patterns.selectDrive(callback)

View File

@ -2,9 +2,9 @@ async = require('async')
fs = require('fs')
path = require('path')
_ = require('lodash')
gitCli = require('git-cli')
resin = require('resin-sdk')
visuals = require('resin-cli-visuals')
vcs = require('resin-vcs')
examplesData = require('../data/examples.json')
exports.list =
@ -85,18 +85,6 @@ exports.clone =
if not example?
return done(new Error("Unknown example: #{id}"))
async.waterfall [
(callback) ->
exampleAbsolutePath = path.join(process.cwd(), example.name)
fs.exists exampleAbsolutePath, (exists) ->
return callback() if not exists
error = new Error("Directory exists: #{example.name}")
return callback(error)
(callback) ->
console.info("Cloning #{example.display_name} to #{example.name}")
gitCli.Repository.clone(example.repository, example.name, callback)
], done
currentDirectory = process.cwd()
console.info("Cloning #{example.display_name} to #{currentDirectory}")
vcs.clone(example.repository, currentDirectory, done)

View File

@ -24,6 +24,8 @@ exports.list =
console.log visuals.widgets.table.horizontal keys, [ 'id', 'title' ]
return done()
SSH_KEY_WIDTH = 43
exports.info =
signature: 'key <id>'
description: 'list a single ssh key'
@ -39,8 +41,7 @@ exports.info =
resin.models.key.get params.id, (error, key) ->
return done(error) if error?
sshKeyWidth = resin.settings.get('sshKeyWidth')
key.public_key = '\n' + visuals.helpers.chop(key.public_key, sshKeyWidth)
key.public_key = '\n' + visuals.helpers.chop(key.public_key, SSH_KEY_WIDTH)
console.log(visuals.widgets.table.vertical(key, [ 'id', 'title', 'public_key' ]))
return done()

View File

@ -9,6 +9,9 @@ visuals = require('resin-cli-visuals')
progressStream = require('progress-stream')
diskio = require('diskio')
commandOptions = require('./command-options')
npm = require('../npm')
packageJSON = require('../../package.json')
updateActions = require('./update')
exports.download =
signature: 'os download <id>'
@ -23,13 +26,15 @@ exports.download =
You can setup the device OS to use wifi by setting the `--network` option to "wifi".
If you set "network" to "wifi", you will need to specify the `--ssid` and `--key` option as well.
By default, this command saved the downloaded image into a resin specific directory.
You can save it to a custom location by specifying the `--output` option.
Alternatively, you can omit all kind of network configuration options to configure interactively.
You have to specify an output location with the `--output` option.
Examples:
$ resin os download 91 --network ethernet
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123
$ resin os download 91 --output ~/MyResinOS.zip
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
$ resin os download 91 --network wifi --ssid MyNetwork --key secreykey123 --output ~/MyResinOS.zip
$ resin os download 91 --network ethernet --output ~/MyResinOS.zip
'''
options: [
@ -42,6 +47,7 @@ exports.download =
parameter: 'output'
description: 'output file'
alias: 'o'
required: 'You need to specify an output file'
}
]
permission: 'user'
@ -52,11 +58,15 @@ exports.download =
wifiKey: options.key
appId: params.id
fileName = resin.models.os.generateCacheName(osParams)
options.output ?= path.join(resin.settings.get('directories.os'), fileName)
async.waterfall [
(callback) ->
return callback() if osParams.network?
visuals.patterns.selectNetworkParameters (error, parameters) ->
return callback(error) if error?
_.extend(osParams, parameters)
return callback()
(callback) ->
# We need to ensure this directory exists
@ -66,9 +76,16 @@ exports.download =
console.info("Destination file: #{options.output}\n")
bar = new visuals.widgets.Progress('Downloading Device OS')
spinner = new visuals.widgets.Spinner('Downloading Device OS (size unknown)')
resin.models.os.download osParams, options.output, callback, (state) ->
bar.update(state)
resin.models.os.download osParams, options.output, (error) ->
spinner.stop()
return callback(error) if error?
, (state) ->
if state?
bar.update(state)
else
spinner.start()
], (error) ->
return done(error) if error?
@ -111,6 +128,23 @@ exports.install =
action: (params, options, done) ->
async.waterfall [
(callback) ->
npm.isUpdated(packageJSON.name, packageJSON.version, callback)
(isUpdated, callback) ->
return callback() if isUpdated
console.info '''
Resin CLI is outdated.
In order to avoid device compatibility issues, this command
requires that you have the Resin CLI updated.
Updating now...
'''
updateActions.update.action(params, options, _.unary(callback))
(callback) ->
return callback(null, params.device) if params.device?

View File

@ -1,6 +1,6 @@
open = require('open')
url = require('url')
resin = require('resin-sdk')
settings = require('resin-settings-client')
exports.preferences =
signature: 'preferences'
@ -17,6 +17,5 @@ exports.preferences =
'''
permission: 'user'
action: ->
preferencesUrl = resin.settings.get('urls.preferences')
absUrl = url.resolve(resin.settings.get('remoteUrl'), preferencesUrl)
absUrl = url.resolve(settings.get('remoteUrl'), '/preferences')
open(absUrl)

View File

@ -1,6 +1,4 @@
async = require('async')
_ = require('lodash-contrib')
npm = require('npm')
npm = require('../npm')
packageJSON = require('../../package.json')
exports.update =
@ -12,34 +10,17 @@ exports.update =
This command outputs information about the update process.
Use `--quiet` to remove that output.
The Resin CLI checks for updates once per day.
Major updates require a manual update with this update command,
while minor updates are applied automatically.
Examples:
$ resin update
'''
action: (params, options, done) ->
async.waterfall([
(callback) ->
options =
# TODO: There is no way to quiet npm install completely.
# Some output is still shown once the module is updated
# https://github.com/npm/npm/issues/2040
loglevel: 'silent'
global: true
npm.load(options, _.unary(callback))
(callback) ->
npm.commands.update([ packageJSON.name ], callback)
(data, lite, callback) ->
if _.isEmpty(data)
return callback(new Error('You are already running the latest version'))
newVersion = _.last(_.first(_.last(data)).split('@'))
console.info("Upgraded #{packageJSON.name} to v#{newVersion}.")
return callback()
], done)
npm.update packageJSON.name, (error, version) ->
return done(error) if error?
console.info("Upgraded #{packageJSON.name} to v#{version}.")
return done(null, version)

View File

@ -57,6 +57,7 @@ capitano.command(actions.app.list)
capitano.command(actions.app.info)
capitano.command(actions.app.remove)
capitano.command(actions.app.restart)
capitano.command(actions.app.associate)
capitano.command(actions.app.init)
# ---------- Device Module ----------
@ -124,10 +125,6 @@ async.waterfall([
(callback) ->
plugins.register('resin-plugin-', callback)
(callback) ->
dataPrefix = resin.settings.get('dataPrefix')
resin.data.prefix.set(dataPrefix, callback)
(callback) ->
cli = capitano.parse(process.argv)

View File

@ -23,6 +23,12 @@ exports.handle = (error, exit = true) ->
console.error(message)
else if error.code is 'ENOGIT'
console.error '''
Git is not installed on this system.
Head over to http://git-scm.com to install it and run this command again.
'''
else if error.message?
console.error(error.message)

57
lib/npm.coffee Normal file
View File

@ -0,0 +1,57 @@
npm = require('npm')
async = require('async')
_ = require('lodash-contrib')
exports.update = (name, callback) ->
async.waterfall([
(callback) ->
options =
# TODO: There is no way to quiet npm install completely.
# Some output is still shown once the module is updated
# https://github.com/npm/npm/issues/2040
loglevel: 'silent'
global: true
npm.load(options, _.unary(callback))
(callback) ->
npm.commands.update [ name ], (error, data) ->
return callback(error, data)
(data, callback) ->
if _.isEmpty(data)
error = new Error('You are already running the latest version')
return callback(error)
newVersion = _.last(_.first(_.last(data)).split('@'))
return callback(null, newVersion)
], callback)
exports.getLatestVersion = (name, callback) ->
async.waterfall([
(callback) ->
options =
# TODO: There is no way to quiet npm install completely.
# Some output is still shown once the module is updated
# https://github.com/npm/npm/issues/2040
loglevel: 'silent'
global: true
npm.load(options, _.unary(callback))
(callback) ->
npm.commands.view [ name ], true, (error, data) ->
versions = _.keys(data)
return callback(error, _.first(versions))
], callback)
exports.isUpdated = (name, currentVersion, callback) ->
exports.getLatestVersion name, (error, latestVersion) ->
return callback(error) if error?
return callback(null, currentVersion is latestVersion)

View File

@ -1,6 +1,6 @@
{
"name": "resin-cli",
"version": "0.2.0",
"version": "0.5.0",
"description": "Git Push to your devices",
"main": "./lib/actions/index.coffee",
"homepage": "https://github.com/resin-io/resin-cli",
@ -33,6 +33,7 @@
},
"devDependencies": {
"chai": "~1.9.2",
"ent": "^2.2.0",
"gulp": "~3.8.9",
"gulp-coffee": "^2.2.0",
"gulp-coffeelint": "~0.4.0",
@ -53,7 +54,6 @@
"conf.js": "^0.1.1",
"diskio": "^1.0.0",
"drivelist": "^1.2.1",
"git-cli": "~0.8.2",
"lodash": "~2.4.1",
"lodash-contrib": "~241.4.14",
"mkdirp": "~0.5.0",
@ -61,8 +61,10 @@
"npm": "^2.6.1",
"open": "0.0.5",
"progress-stream": "^0.5.0",
"resin-cli-visuals": "resin-io/resin-cli-visuals",
"resin-sdk": "^0.0.1",
"resin-cli-visuals": "^0.1.0",
"resin-sdk": "^1.0.0",
"resin-settings-client": "^1.0.0",
"resin-vcs": "^1.0.0",
"underscore.string": "~2.4.0",
"update-notifier": "^0.3.1"
}

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>Resin CLI</title>
<organization>io.resin</organization>
<domains enable_localSystem="true" />
<options customize="never" require-scripts="true" />
<background file="background.png" alignment="bottomleft" mime-type="image/png" />
<!-- Define documents displayed at various steps -->
<welcome file="welcome.txt" mime-type="text/plain" />
<license file="license.txt" mime-type="text/plain" />
<conclusion file="conclusion.txt" mime-type="text/plain" />
<!-- List all component packages -->
<pkg-ref id="io.resin.cli">cli.pkg</pkg-ref>
<!-- List them again here -->
<choices-outline>
<line choice="io.resin.cli" />
</choices-outline>
<!-- Define each choice above -->
<choice
customLocation="/opt/resin.io/cli"
id="io.resin.cli"
visible="false"
title="Resin CLI"
description="The Resin CLI tool"
start_selected="true">
<pkg-ref id="io.resin.cli" />
</choice>
</installer-gui-script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1 +0,0 @@
Thanks for installing the Resin CLI. Enjoy!

View File

@ -1,3 +0,0 @@
Welcome to the installation of the Resin CLI tool, an advanced way to communicate with Resin.io
The Resin.io CLI tool will be installed in /opt/resin.io/cli.

View File

@ -1,4 +0,0 @@
#!/bin/sh
# Add binary symbolic link
ln -s /opt/resin.io/cli/bin/resin /usr/bin/resin

View File

@ -1,7 +0,0 @@
#!/bin/sh
# Remove previous installations of the CLI
rm -rf /opt/resin.io/cli
# Remove previous symbolic link
rm -f /usr/bin/resin

View File

@ -1,327 +0,0 @@
/**
* EnvVarUpdate.nsh
* : Environmental Variables: append, prepend, and remove entries
*
* WARNING: If you use StrFunc.nsh header then include it before this file
* with all required definitions. This is to avoid conflicts
*
* Usage:
* ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString"
*
* Credits:
* Version 1.0
* * Cal Turney (turnec2)
* * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this
* function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar,
* WriteEnvStr, and un.DeleteEnvStr
* * Diego Pedroso (deguix) for StrTok
* * Kevin English (kenglish_hi) for StrContains
* * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry
* (dandaman32) for StrReplace
*
* Version 1.1 (compatibility with StrFunc.nsh)
* * techtonik
*
* http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
*
*/
!ifndef ENVVARUPDATE_FUNCTION
!define ENVVARUPDATE_FUNCTION
!verbose push
!verbose 3
!include "LogicLib.nsh"
!include "WinMessages.NSH"
!include "StrFunc.nsh"
; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
!macro _IncludeStrFunction StrFuncName
!ifndef ${StrFuncName}_INCLUDED
${${StrFuncName}}
!endif
!ifndef Un${StrFuncName}_INCLUDED
${Un${StrFuncName}}
!endif
!define un.${StrFuncName} "${Un${StrFuncName}}"
!macroend
!insertmacro _IncludeStrFunction StrTok
!insertmacro _IncludeStrFunction StrStr
!insertmacro _IncludeStrFunction StrRep
; ---------------------------------- Macro Definitions ----------------------------------------
!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
Push "${EnvVarName}"
Push "${Action}"
Push "${RegLoc}"
Push "${PathString}"
Call EnvVarUpdate
Pop "${ResultVar}"
!macroend
!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
Push "${EnvVarName}"
Push "${Action}"
Push "${RegLoc}"
Push "${PathString}"
Call un.EnvVarUpdate
Pop "${ResultVar}"
!macroend
!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
; ---------------------------------- Macro Definitions end-------------------------------------
;----------------------------------- EnvVarUpdate start----------------------------------------
!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!define hkcu_current_user 'HKCU "Environment"'
!macro EnvVarUpdate UN
Function ${UN}EnvVarUpdate
Push $0
Exch 4
Exch $1
Exch 3
Exch $2
Exch 2
Exch $3
Exch
Exch $4
Push $5
Push $6
Push $7
Push $8
Push $9
Push $R0
/* After this point:
-------------------------
$0 = ResultVar (returned)
$1 = EnvVarName (input)
$2 = Action (input)
$3 = RegLoc (input)
$4 = PathString (input)
$5 = Orig EnvVar (read from registry)
$6 = Len of $0 (temp)
$7 = tempstr1 (temp)
$8 = Entry counter (temp)
$9 = tempstr2 (temp)
$R0 = tempChar (temp) */
; Step 1: Read contents of EnvVarName from RegLoc
;
; Check for empty EnvVarName
${If} $1 == ""
SetErrors
DetailPrint "ERROR: EnvVarName is blank"
Goto EnvVarUpdate_Restore_Vars
${EndIf}
; Check for valid Action
${If} $2 != "A"
${AndIf} $2 != "P"
${AndIf} $2 != "R"
SetErrors
DetailPrint "ERROR: Invalid Action - must be A, P, or R"
Goto EnvVarUpdate_Restore_Vars
${EndIf}
${If} $3 == HKLM
ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5
${ElseIf} $3 == HKCU
ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5
${Else}
SetErrors
DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"'
Goto EnvVarUpdate_Restore_Vars
${EndIf}
; Check for empty PathString
${If} $4 == ""
SetErrors
DetailPrint "ERROR: PathString is blank"
Goto EnvVarUpdate_Restore_Vars
${EndIf}
; Make sure we've got some work to do
${If} $5 == ""
${AndIf} $2 == "R"
SetErrors
DetailPrint "$1 is empty - Nothing to remove"
Goto EnvVarUpdate_Restore_Vars
${EndIf}
; Step 2: Scrub EnvVar
;
StrCpy $0 $5 ; Copy the contents to $0
; Remove spaces around semicolons (NOTE: spaces before the 1st entry or
; after the last one are not removed here but instead in Step 3)
${If} $0 != "" ; If EnvVar is not empty ...
${Do}
${${UN}StrStr} $7 $0 " ;"
${If} $7 == ""
${ExitDo}
${EndIf}
${${UN}StrRep} $0 $0 " ;" ";" ; Remove '<space>;'
${Loop}
${Do}
${${UN}StrStr} $7 $0 "; "
${If} $7 == ""
${ExitDo}
${EndIf}
${${UN}StrRep} $0 $0 "; " ";" ; Remove ';<space>'
${Loop}
${Do}
${${UN}StrStr} $7 $0 ";;"
${If} $7 == ""
${ExitDo}
${EndIf}
${${UN}StrRep} $0 $0 ";;" ";"
${Loop}
; Remove a leading or trailing semicolon from EnvVar
StrCpy $7 $0 1 0
${If} $7 == ";"
StrCpy $0 $0 "" 1 ; Change ';<EnvVar>' to '<EnvVar>'
${EndIf}
StrLen $6 $0
IntOp $6 $6 - 1
StrCpy $7 $0 1 $6
${If} $7 == ";"
StrCpy $0 $0 $6 ; Change ';<EnvVar>' to '<EnvVar>'
${EndIf}
; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug
${EndIf}
/* Step 3. Remove all instances of the target path/string (even if "A" or "P")
$6 = bool flag (1 = found and removed PathString)
$7 = a string (e.g. path) delimited by semicolon(s)
$8 = entry counter starting at 0
$9 = copy of $0
$R0 = tempChar */
${If} $5 != "" ; If EnvVar is not empty ...
StrCpy $9 $0
StrCpy $0 ""
StrCpy $8 0
StrCpy $6 0
${Do}
${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter
${If} $7 == "" ; If we've run out of entries,
${ExitDo} ; were done
${EndIf} ;
; Remove leading and trailing spaces from this entry (critical step for Action=Remove)
${Do}
StrCpy $R0 $7 1
${If} $R0 != " "
${ExitDo}
${EndIf}
StrCpy $7 $7 "" 1 ; Remove leading space
${Loop}
${Do}
StrCpy $R0 $7 1 -1
${If} $R0 != " "
${ExitDo}
${EndIf}
StrCpy $7 $7 -1 ; Remove trailing space
${Loop}
${If} $7 == $4 ; If string matches, remove it by not appending it
StrCpy $6 1 ; Set 'found' flag
${ElseIf} $7 != $4 ; If string does NOT match
${AndIf} $0 == "" ; and the 1st string being added to $0,
StrCpy $0 $7 ; copy it to $0 without a prepended semicolon
${ElseIf} $7 != $4 ; If string does NOT match
${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0,
StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon
${EndIf} ;
IntOp $8 $8 + 1 ; Bump counter
${Loop} ; Check for duplicates until we run out of paths
${EndIf}
; Step 4: Perform the requested Action
;
${If} $2 != "R" ; If Append or Prepend
${If} $6 == 1 ; And if we found the target
DetailPrint "Target is already present in $1. It will be removed and"
${EndIf}
${If} $0 == "" ; If EnvVar is (now) empty
StrCpy $0 $4 ; just copy PathString to EnvVar
${If} $6 == 0 ; If found flag is either 0
${OrIf} $6 == "" ; or blank (if EnvVarName is empty)
DetailPrint "$1 was empty and has been updated with the target"
${EndIf}
${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty),
StrCpy $0 $0;$4 ; append PathString
${If} $6 == 1
DetailPrint "appended to $1"
${Else}
DetailPrint "Target was appended to $1"
${EndIf}
${Else} ; If Prepend (and EnvVar is not empty),
StrCpy $0 $4;$0 ; prepend PathString
${If} $6 == 1
DetailPrint "prepended to $1"
${Else}
DetailPrint "Target was prepended to $1"
${EndIf}
${EndIf}
${Else} ; If Action = Remove
${If} $6 == 1 ; and we found the target
DetailPrint "Target was found and removed from $1"
${Else}
DetailPrint "Target was NOT found in $1 (nothing to remove)"
${EndIf}
${If} $0 == ""
DetailPrint "$1 is now empty"
${EndIf}
${EndIf}
; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change
;
ClearErrors
${If} $3 == HKLM
WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section
${ElseIf} $3 == HKCU
WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
${EndIf}
IfErrors 0 +4
MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3"
DetailPrint "Could not write updated $1 to $3"
Goto EnvVarUpdate_Restore_Vars
; "Export" our change
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
EnvVarUpdate_Restore_Vars:
;
; Restore the user's variables and return ResultVar
Pop $R0
Pop $9
Pop $8
Pop $7
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Push $0 ; Push my $0 (ResultVar)
Exch
Pop $0 ; Restore his $0
FunctionEnd
!macroend ; EnvVarUpdate UN
!insertmacro EnvVarUpdate ""
!insertmacro EnvVarUpdate "un."
;----------------------------------- EnvVarUpdate end----------------------------------------
!verbose pop
!endif

View File

@ -1,417 +0,0 @@
;ZipDLL include file for NSIS
;Written by Tim Kosse (mailto:tim.kosse@gmx.de)
;some improvements by deguix
;Supported languages with their translators in alphabetical order:
;Arabic translation by asdfuae
;Brazilian Portuguese translation by "deguix"
;Chinese, Simplified translation by Kii Ali <kiiali@cpatch.org>
;Chinese, Traditional traslation by "matini" and Kii Ali <kiiali@cpatch.org>
;Croatian translation by "iostriz"
;Danish translation by Claus Futtrup
;French translation by "veekee"
;German translation by Tim Kosse
;Hungarian translation by Toth Laszlo
;Korean translation by Seongab Kim
;Lithuanian translation by Vytautas Krivickas
;Polish translation by Krzysztof Galuszka
;Russion translation by Sergey
;Spanish translation by "dark_boy"
!ifndef ZIPDLL_USED
!define ZIPDLL_USED
!macro ZIPDLL_EXTRACT SOURCE DESTINATION FILE
!define "FILE_${FILE}"
!ifndef FILE_<ALL>
Push "${FILE}"
!endif
IfFileExists "${DESTINATION}" +2
CreateDirectory "${DESTINATION}"
Push "${DESTINATION}"
IfFileExists "${SOURCE}" +2
SetErrors
Push "${SOURCE}"
;The strings that will be translated are (ready to copy,
;remove leading semicolons in your language block):
!ifdef LANG_ENGLISH
;English is default language of ZipDLL, no need to push the untranslated strings
;StrCmp $LANGUAGE ${LANG_ENGLISH} 0 +1
;Push " Error: %s"
;Push "Could not get file attributes."
;Push "Error: Could not get file attributes."
;Push "Could not extract %s"
;Push " Error: Could not extract %s"
;!ifdef FILE_<ALL>
;Push " Extract: %s"
;Push " Extracting %d files and directories"
;Push "Extracting contents of %s to %s"
;!else
;Push "Specified file does not exist in archive."
;Push "Error: Specified file does not exist in archive."
;Push "Extracting the file %s from %s to %s"
;!endif
;Push "/TRANSLATE"
!endif
!ifdef LANG_HUNGARIAN
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +10
Push " Hiba: %s"
Push "Nem olvashat<61> a f<>jl attrib<69>tumai."
Push "Hiba: Nem olvashat<61> a f<>jl attrib<69>tumai."
Push "Nem siker<65>lt kicsomagolni a(z) %s"
Push " Hiba: Nem siker<65>lt kicsomagolni a(z) %s"
!ifdef FILE_<ALL>
Push " Kicsomagol<6F>s: %s"
Push " %d f<>jl <20>s mappa kicsomagol<6F>sa"
Push "%s tartalom kicsomagol<6F>sa a %s helyre"
!else
Push "A megadott f<>jl nem tal<61>lhat<61> az arh<72>vumban."
Push "Hiba: A megadott f<>jl nem tal<61>lhat<61> az arh<72>vumban."
Push "%s f<>jl kcsomagol<6F>sa a(z) %s f<>jlb<6C>l a %s helyre"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_FRENCH
StrCmp $LANGUAGE ${LANG_FRENCH} 0 +10
Push " Erreur : %s"
Push "Impossible de r<>cup<75>rer les informations sur le fichier."
Push "Erreur : Impossible de r<>cup<75>rer les informations sur le fichier."
Push "Impossible de d<>compresser %s."
Push " Erreur : Impossible de d<>compresser %s."
!ifdef FILE_<ALL>
Push " D<>compression : %s"
Push " D<>compression de %d fichiers et r<>pertoires"
Push "D<EFBFBD>compression des donn<6E>es de %s vers %s"
!else
Push "Le fichier sp<73>cifi<66> n'existe pas dans l'archive"
Push "Erreur : Le fichier sp<73>cifi<66> n'existe pas dans l'archive"
Push "D<EFBFBD>compression du fichier %s depuis %s vers %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_GERMAN
StrCmp $LANGUAGE ${LANG_GERMAN} 0 +10
Push " Fehler: %s"
Push "Dateiattribute konnten nicht ermittelt werden."
Push "Fehler: Dateiattribute konnten nicht ermittelt werden."
Push "%s konnte nicht dekomprimiert werden."
Push " Fehler: %s konnte nicht dekomprimiert werden."
!ifdef FILE_<ALL>
Push " Dekomprimiere: %s"
Push " Dekomprimiere %d Dateien und Verzeichnisse"
Push "Dekomprimiere Inhalt von %s nach %s"
!else
Push "Die angegebene Datei existiert nicht im Archiv"
Push "Fehler: Die angegebene Datei existiert nicht im Archiv"
Push "Dekomprimiere Datei %s von %s nach %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_SPANISH
StrCmp $LANGUAGE ${LANG_SPANISH} 0 +10
Push " Error: %s"
Push "No se obtuvieron atributos del archivo"
Push "Error: No se obtuvieron atributos del archivo"
Push "No se pudo extraer %s"
Push " Error: No se pudo extraer %s"
!ifdef FILE_<ALL>
Push " Extraer: %s"
Push " Extrayendo %d archivos y directorios"
Push "Extraer archivos de %s a %s"
!else
Push "Archivo especificado no existe en el ZIP"
Push "Error: El archivo especificado no existe en el ZIP"
Push "Extrayendo el archivo %s de %s a %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_PORTUGUESEBR
StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} 0 +10
Push " Erro: %s"
Push "N<EFBFBD>o se pode ler os atributos do arquivo"
Push "Error: N<>o se pode ler os atributos do arquivo"
Push "N<EFBFBD>o se pode extrair %s"
Push " Erro: N<>o se pode extrair %s"
!ifdef FILE_<ALL>
Push " Extraindo: %s"
Push " Extraindo %d arquivos e diret<65>rios"
Push "Extraindo arquivos de %s a %s"
!else
Push "O arquivo especificado n<>o existe no ZIP"
Push "Erro: O arquivo especificado n<>o existe no ZIP"
Push "Extraindo o arquivo %s de %s a %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_TRADCHINESE
StrCmp $LANGUAGE ${LANG_TRADCHINESE} 0 +11
Push " <20><><EFBFBD>~: %s"
Push "<EFBFBD>L<EFBFBD>k<EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>ɮ<EFBFBD><EFBFBD>ݩʡC"
Push "<EFBFBD><EFBFBD><EFBFBD>~: <20>L<EFBFBD>k<EFBFBD><6B><EFBFBD>o<EFBFBD>ɮ<EFBFBD><C9AE>ݩʡC"
Push "<EFBFBD>L<EFBFBD>k<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y %s"
Push " <20><><EFBFBD>~<7E>G<EFBFBD>L<EFBFBD>k<EFBFBD><6B><EFBFBD><EFBFBD><EFBFBD>Y %s"
!ifdef FILE_<ALL>
Push " <20><><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD>G%s"
Push " <20><><EFBFBD>b<EFBFBD><62><EFBFBD><EFBFBD><EFBFBD>Y %d <20>ɮ׻P<D7BB>ؿ<EFBFBD>"
Push "<EFBFBD><EFBFBD><EFBFBD>b<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y %s <20><><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD><65> %s"
!else
Push "<EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><EFBFBD><EFBFBD>ɮרä<EFBFBD><EFBFBD>s<EFBFBD>b<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD>]<5D>C"
Push "<EFBFBD><EFBFBD><EFBFBD>~<7E>G<EFBFBD><47><EFBFBD>w<EFBFBD><77><EFBFBD>ɮרä<D7A8><C3A4>s<EFBFBD>b<EFBFBD><62><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD>]<5D>C"
Push "<EFBFBD><EFBFBD><EFBFBD>b<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y<EFBFBD>ɮ<EFBFBD> %s <20>A<EFBFBD>q %s <20><> %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_SIMPCHINESE
StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +11
Push " <20><><EFBFBD><EFBFBD>: %s"
Push "<EFBFBD>޷<EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԡ<EFBFBD>"
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20>޷<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ԡ<EFBFBD>"
Push "<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD> %s"
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><DEB7><EFBFBD>ѹ<EFBFBD><D1B9> %s"
!ifdef FILE_<ALL>
Push " <20><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>%s"
Push " <20><><EFBFBD>ڽ<EFBFBD>ѹ<EFBFBD><D1B9> %d <20>ļ<EFBFBD><C4BC><EFBFBD>Ŀ¼"
Push "<EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD>ѹ<EFBFBD><EFBFBD> %s <20><><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD> %s"
!else
Push "ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
Push "<EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD> %s <20><><EFBFBD><EFBFBD> %s <20><> %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_LITHUANIAN
StrCmp $LANGUAGE ${LANG_LITHUANIAN} 0 +10
Push " Klaida: %s"
Push "Negaleta gauti bylos nuorodu."
Push "Klaida: Negaleta gauti bylos nuorodu."
Push "Negaleta i<>traukti %s"
Push " Klaida: Negaleta i<>traukti %s"
!ifdef FILE_<ALL>
Push " I<>traukiam : %s"
Push " I<>traukiame %d bylas ir katalogus"
Push "I<EFBFBD>traukiame viska is %s i %s"
!else
Push "Parinkta byla nesurasta <20>iame archyve."
Push "Klaida: Parinkta byla nesurasta <20>iame archyve."
Push "I<EFBFBD>traukiame byla %s i<> %s i %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef "LANG_POLISH"
strcmp $LANGUAGE ${LANG_POLISH} 0 +10
Push " B<><42>d: %s"
Push "Nie mo<6D>e pobra<72> atrybutu pliku."
Push "B<EFBFBD><EFBFBD>d: Nie mo<6D>e pobra<72> atrybutu pliku."
Push "Nie mo<6D>e rozpakowa<77> %s."
Push " B<><42>d: Nie mo<6D>e rozpakowa<77> %s."
!ifdef FILE_<ALL>
Push " Rozpakuj: %s"
Push " Rozpakowywanie %d plik<69>w i katalog<6F>w"
Push "Rozpakowywanie zawarto<74>ci %s do %s"
!else
Push "Plik nie istnieje w archiwum"
Push "B<EFBFBD><EFBFBD>d: Plik nie istnieje w archiwum"
Push "Rozpakowywanie pliku %s z %s do %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef "LANG_KOREAN"
strcmp $LANGUAGE ${LANG_KOREAN} 0 +10
Push " <20><><EFBFBD><EFBFBD> : %s"
Push "ȭ<EFBFBD><EFBFBD> <20>Ӽ<EFBFBD><D3BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ȭ<><C8AD> <20>Ӽ<EFBFBD><D3BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
Push "%s<><73>(<28><>) Ǯ <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
Push " <20><><EFBFBD><EFBFBD>: %s<><73>(<28><>) Ǯ <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
!ifdef FILE_<ALL>
Push " Ǯ<><C7AE> : %s"
Push " %d<><64><EFBFBD><EFBFBD> <20><><EFBFBD>ϰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ǫ<><C7AA> <20><>"
Push "%s<><73> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s<><73> Ǫ<><C7AA> <20><>"
!else
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ȿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ȿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>."
Push "%s <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s<><73><EFBFBD><EFBFBD> %s<><73> Ǫ<><C7AA> <20><>"
!endif
Push "/TRANSLATE"
!endif
!ifdef "LANG_RUSSIAN"
strcmp $LANGUAGE ${LANG_RUSSIAN} 0 +10
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %s"
Push "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s"
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s"
!ifdef LANG_<ALL>
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : %s"
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>"
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> %s <20> %s"
!else
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: S<><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> %s <20><> %s <20> %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_ARABIC
StrCmp $LANGUAGE ${LANG_ARABIC} 0 +10
Push " <20><><EFBFBD><EFBFBD>: %s"
Push "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s"
Push " <20><><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s"
!ifdef FILE_<ALL>
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : %s"
Push " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> %d"
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %s <20><><EFBFBD> %s"
!else
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>."
Push "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> %s <20><> %s <20><><EFBFBD> %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_DANISH
StrCmp $LANGUAGE ${LANG_DANISH} 0 +10
Push " Fejl: %s"
Push "Kunne ikke l<>se fil attributter."
Push "Fejl: Kunne ikke l<>se fil attributter."
Push "Kunne ikke udpakke %s"
Push " Fejl: Kunne ikke udpakke %s"
!ifdef FILE_<ALL>
Push " Udpakker: %s"
Push " Udpakker %d filer og mapper"
Push "Udpakker indhold fra %s til %s"
!else
Push "Specificeret fil eksisterer ikke i filarkivet"
Push "Fejl: Specificeret fil eksisterer ikke i filarkivet"
Push "Udpakker fil %s fra %s til %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef LANG_CROATIAN
StrCmp $LANGUAGE ${LANG_CROATIAN} 0 +10
Push " Gre<72>ka: %s"
Push "Ne mogu dohvatiti atribute datoteke."
Push "Gre<EFBFBD>ka: Ne mogu dohvatiti atribute datoteke."
Push "Ne mogu ekstrahirati %s"
Push " Gre<72>ka: Ne mogu ekstrahirati %s"
!ifdef FILE_<ALL>
Push " Ekstrakcija: %s"
Push " Ekstrakcija %d datoteka i mapa"
Push "Ekstrakcija sadr<64>aja %s u %s"
!else
Push "Tra<EFBFBD>ena datoteka ne postoji u arhivi."
Push "Gre<EFBFBD>ka: Tra<72>ena datoteka ne postoji u arhivi."
Push "Ekstrakcija datoteke %s iz %s u %s"
!endif
Push "/TRANSLATE"
!endif
!ifdef FILE_<ALL>
ZipDLL::extractall
!else
ZipDLL::extractfile
!endif
!undef "FILE_${FILE}"
!macroend
!endif

View File

@ -1,21 +0,0 @@
The MIT License
Copyright (c) 2014 Resin.io, Inc. https://resin.io
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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@ -1,44 +0,0 @@
!addincludedir "Include"
!addplugindir "Plugins"
!include "MUI2.nsh"
!include "EnvVarUpdate.nsh"
!include "zipdll.nsh"
Name "Resin CLI"
OutFile "..\..\build\distrib\resin-cli-setup.exe"
BrandingText "Resin.io"
InstallDir "$PROGRAMFILES\Resin.io\resin-cli"
; MUI settings
!define MUI_ICON "logo.ico"
!define MUI_UNICON "logo.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "banner.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "banner.bmp"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "Install"
SetOutPath $INSTDIR
File "..\..\build\distrib\resin-cli-win32.zip"
!insertmacro ZIPDLL_EXTRACT "$INSTDIR\resin-cli-win32.zip" "$INSTDIR" "<ALL>"
Delete "$INSTDIR\resin-cli-win32.zip"
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Uninstall"
RMDir /r "$INSTDIR"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
SectionEnd