Browse Source

Adding Win7 Support

v0.0.11
John Haverlack 3 years ago
parent
commit
e3e85a3763
  1. 2
      .gitignore
  2. 11
      download/skqitam-setup-win7.ps1
  3. 57
      index.js
  4. 6
      web/root/docs/index.md
  5. 16
      web/root/docs/js/skq-it-am.js
  6. 9
      web/root/site/index.html
  7. 16
      web/root/site/js/skq-it-am.js
  8. 2
      web/root/site/search/search_index.json
  9. BIN
      web/root/site/sitemap.xml.gz

2
.gitignore

@ -6,7 +6,7 @@ node_modules/*
download/skqitam-client.tgz
download/skqitam-client.zip
download/win7-x64-installer/*
download/skqitam-client-win7x6-installer.zip
download/skqitam-client-win7-installer.zip
itam-data/hosts/*
itam-data/host-id-map.json
itam-data/logs/*

11
download/skqitam-setup-win7.ps1

@ -0,0 +1,11 @@
$app_dir = "$env:USERPROFILE\AppData\Local\skqitam"
Write-Output "Sikuliaq IT Asset Manager Client Setup"
Write-Output " Copyright (C) 2021 University of Alaska Fairbanks / R/V Sikuliaq"
Write-Output " "
Write-Output ("INSTALLING: The skqitam client is being installed in: " $app_dir)
# Make $app_dir
if(-not (test-path $app_dir)) {
md $app_dir | out-null
}

57
index.js

@ -1,11 +1,11 @@
var path = require('path')
var fs = require('fs')
var ecstatic = require('ecstatic')
const express = require('express')
const app = express()
var tar = require('tar')
var path = require('path')
var fs = require('fs')
var ecstatic = require('ecstatic')
const express = require('express')
const app = express()
var tar = require('tar')
const archiver = require('archiver');
var skqlib = require('./skq_modules/skq-lib')
var skqlib = require('./skq_modules/skq-lib')
// GLOBAL CONFIG
process['CONFIG'] = JSON.parse(fs.readFileSync(path.join(__dirname, 'config','skqitam-server-config.json'), 'utf8'))
@ -54,25 +54,30 @@ try {
try {
fs.copyFileSync(path.join(__dirname, 'nodejs', 'node-v8.17.0-win-x64.zip'), path.join(__dirname, 'download', 'win7-x64-installer', 'node-v8.17.0-win-x64.zip'))
const w7x64_ziparch = fs.createWriteStream(path.join(__dirname, 'download', 'skqitam-client-win7x6-installer.zip'))
const w7x64_archive = archiver('zip', {
zlib: { level: 9 } // Sets the compression level.
})
w7x64_archive.on('warning', function(err) {
if (err.code === 'ENOENT') {
// log warning
} else {
// throw error
throw err;
}
})
w7x64_archive.pipe(w7x64_ziparch)
w7x64_archive.directory(path.join('download', 'win7-x64-installer'), 'win7-x64-installer');
w7x64_archive.finalize()
try {
fs.copyFileSync(path.join(__dirname, 'download', 'skqitam-setup-win7.ps1'), path.join(__dirname, 'download', 'win7-x64-installer', 'skqitam-setup-win7.ps1'))
const w7x64_ziparch = fs.createWriteStream(path.join(__dirname, 'download', 'skqitam-client-win7-installer.zip'))
const w7x64_archive = archiver('zip', {
zlib: { level: 9 } // Sets the compression level.
})
w7x64_archive.on('warning', function(err) {
if (err.code === 'ENOENT') {
// log warning
} else {
// throw error
throw err;
}
})
w7x64_archive.pipe(w7x64_ziparch)
w7x64_archive.directory(path.join('download', 'win7-x64-installer'), 'win7-x64-installer');
w7x64_archive.finalize()
} catch (e) {
console.log ('ERROR: Could not copy: '+ path.join(__dirname, 'download', 'skqitam-setup-win7.ps1'))
process.exit(1)
}
} catch (e) {
console.log ('ERROR: Could not copy: '+ path.join(__dirname, 'nodejs', 'node-v8.17.0-win-x64.zip'))
process.exit(1)

6
web/root/docs/index.md

@ -37,7 +37,7 @@ or
---
#### <span class="fab fa-windows"></span> Windows 7, 10
#### <span class="fab fa-windows"></span> Windows 10 (PowerShell 5.x+)
From a CMD terminal window at the command line:
@ -45,3 +45,7 @@ From a CMD terminal window at the command line:
<div id="debug-config"></div>
#### <span class="fab fa-microsoft"></span> Windows 7 (PowerShell 2.x)
1. Download skqitam Win7 Zipfile: <div class="WIN7_ZIPFILE_URL"></div>

16
web/root/docs/js/skq-it-am.js

@ -184,3 +184,19 @@ function it_am_var_parser() {
}
}
}
// Win 7 Zipfile
if (document.getElementsByClassName("WIN7_ZIPFILE_URL")) {
let webconf = JSON.parse(sessionStorage.webconf)
for (e=0; e<document.getElementsByClassName("WIN7_ZIPFILE_URL").length; e++) {
let html = ''
let url = webconf['BROWSER']['BASE_URL'] + '/download/skqitam-client-win7-installer.zip'
html +=' <a title="Download skqitam Win7 Installer" href="' + url + '" >' + url + '</a>' + "\n"
document.getElementsByClassName("WIN7_ZIPFILE_URL")[e].innerHTML = html
// document.getElementById("WIN_CMD_CMD").value = cmd
// document.getElementById("btn-cp-win").setAttribute('data-clipboard-text', cmd)
}
}

9
web/root/site/index.html

@ -153,11 +153,16 @@
<div class="POSIX_WGET_CMD"></div>
<hr />
<h4 id="windows-7-10"><span class="fab fa-windows"></span> Windows 7, 10</h4>
<h4 id="windows-10-powershell-5x"><span class="fab fa-windows"></span> Windows 10 (PowerShell 5.x+)</h4>
<p>From a CMD terminal window at the command line:</p>
<div class="WIN_CMD_CMD"></div>
<div id="debug-config"></div></div>
<div id="debug-config"></div>
<h4 id="windows-7-powershell-2x"><span class="fab fa-microsoft"></span> Windows 7 (PowerShell 2.x)</h4>
<ol>
<li>Download skqitam Win7 Zipfile: <div class="WIN7_ZIPFILE_URL"></div></li>
</ol></div>
</div>
</div>

16
web/root/site/js/skq-it-am.js

@ -184,3 +184,19 @@ function it_am_var_parser() {
}
}
}
// Win 7 Zipfile
if (document.getElementsByClassName("WIN7_ZIPFILE_URL")) {
let webconf = JSON.parse(sessionStorage.webconf)
for (e=0; e<document.getElementsByClassName("WIN7_ZIPFILE_URL").length; e++) {
let html = ''
let url = webconf['BROWSER']['BASE_URL'] + '/download/skqitam-client-win7-installer.zip'
html +=' <a title="Download skqitam Win7 Installer" href="' + url + '" >' + url + '</a>' + "\n"
document.getElementsByClassName("WIN7_ZIPFILE_URL")[e].innerHTML = html
// document.getElementById("WIN_CMD_CMD").value = cmd
// document.getElementById("btn-cp-win").setAttribute('data-clipboard-text', cmd)
}
}

2
web/root/site/search/search_index.json
File diff suppressed because it is too large
View File

BIN
web/root/site/sitemap.xml.gz

Loading…
Cancel
Save