-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from msupply-foundation/162-windows-installer…
…-setup 162 windows installer setup
- Loading branch information
Showing
12 changed files
with
4,526 additions
and
16 deletions.
There are no files selected for viewing
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
Binary file not shown.
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,14 @@ | ||
#[cfg(windows)] | ||
extern crate winres; | ||
|
||
#[cfg(windows)] | ||
fn main() { | ||
let mut res = winres::WindowsResource::new(); | ||
res.set_icon("notify.ico"); | ||
// The winres crate compiles the icon into a Windows resource file and directs cargo to link it into the output binary | ||
res.compile().unwrap(); | ||
} | ||
|
||
// Keep the unix build happy | ||
#[cfg(unix)] | ||
fn main() {} |
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,17 @@ | ||
License | ||
|
||
Notify software (including it's documentation produced by mSupply Foundation) is protected by copyright and licensed with the GNU Affero General Public License v3.0. | ||
A copy of the license is available at https://github.com/msupply-foundation/notify/blob/main/LICENSE | ||
|
||
mSupply Foundation grants you license to use notify software according to the stated licensing agreement and your installation and/or continued use of notify confirms your agreement. | ||
|
||
The user guide, including material on the mSupply web site may not, in whole or in part, be copied, reproduced, translated or reduced to any machine readable form without prior consent in writing from mSupply Foundation. | ||
|
||
|
||
Warranty | ||
|
||
No warranty is given on product software, the user guide and other training materials. Even though mSupply Foundation has tested the software and documentation and reviewed their contents, mSupply Foundation and its distributors and dealers make no warranties, either expressed or implied, with respect to their fitness for a particular purpose. The program and the user guides are distributed solely on an "as is" basis. The entire risk as to their quality and performance is with the you. | ||
|
||
Should either the software or the manuals or both prove defective, you, and not mSupply Foundation or its distributors or dealers, assume the entire cost of all necessary servicing, repair, or correction. | ||
|
||
mSupply Foundation and its distributors and dealers will not be liable for direct, indirect, incidental, or consequential damages resulting from any defect in the software or user guide, even if they have been advised of the possibility of such damage. |
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,21 @@ | ||
const fs = require('fs'); | ||
const files = fs.readdirSync('.'); | ||
|
||
files.forEach((fileName) => { | ||
if (fileName.endsWith('.suf')) { | ||
const sufFileName = `${fileName}`; | ||
const fileContent = fs.readFileSync(sufFileName, 'utf8'); | ||
fs.writeFileSync(fileName, replaceVersion(adjustOutputFolder(fileContent))); | ||
} | ||
}); | ||
|
||
function replaceVersion(fileContent) { | ||
return fileContent.replace(/replace with version/g, process.env.versionTag); | ||
} | ||
|
||
function adjustOutputFolder(fileContent) { | ||
return fileContent.replace( | ||
/<OutputFolder>.*<\/OutputFolder>/g, | ||
`<OutputFolder>${process.env.installersOutputFolder}</OutputFolder>` | ||
); | ||
} |
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,19 @@ | ||
@ECHO ##### Removing installers folder ##### | ||
@rmdir "installers" /s /q | ||
|
||
@ECHO ##### Update SUF files ##### | ||
copy /y notify\notify\notify_service.suf notify\notify_service.suf | ||
|
||
@ECHO ##### Adjusting SUFS ##### | ||
SET installerWorkspace=%cd%\notify | ||
SET SUFlocation=%installerWorkspace%\notify | ||
FOR /F "delims=*" %%i in ('more notify\notify\version.txt') do SET versionTag=%%i | ||
@ECHO "current tag = %versionTag%" | ||
SET installersOutputFolder=%cd%\installers | ||
|
||
@cd notify | ||
node "%SUFlocation%\adjustSUFs.js" | ||
@cd .. | ||
|
||
@ECHO ##### Creating installers ##### | ||
start "" /wait "C:\Program Files (x86)\Setup Factory 9\SUFDesign.exe" /BUILD /LOG:installers\setup-factory.log "%installerWorkspace%\notify_service.suf" |
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,19 @@ | ||
@ECHO ##### Removing previous builds ##### | ||
@rmdir "notify" /s /q | ||
|
||
@ECHO ##### Starting notify builds ##### | ||
mkdir "notify" | ||
xcopy "notify\configuration" "notify\configuration" /e /h /c /i | ||
|
||
copy "backend\server\notify.ico" "build\notify.ico" | ||
xcopy "build\*.*" "notify" /c | ||
xcopy "build\windows\*.*" "notify" /c | ||
copy "version.txt" "notify\version.txt" | ||
|
||
@ECHO ##### Prepare notify frontend ##### | ||
start /b /wait build\windows\notify-prepare.bat | ||
@if %errorlevel% neq 0 exit /b %errorlevel% | ||
|
||
ECHO ##### Building notify app ##### | ||
cd backend && cargo build --release --bin notify_service && copy "target\release\notify_service.exe" "..\notify\notify_service.exe" | ||
if %errorlevel% neq 0 exit /b %errorlevel% |
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,8 @@ | ||
IF NOT EXIST version.txt ( | ||
@ECHO ##### No version.txt found, defaulting to package version ##### | ||
node -p "require('./frontend/package.json').version" > version.txt | ||
) | ||
set /p APP_BUILD_VERSION=<version.txt | ||
@ECHO %APP_BUILD_VERSION% | ||
cd frontend && yarn install --force --frozen-lockfile && yarn build-windows | ||
if %errorlevel% neq 0 exit /b %errorlevel% |
Oops, something went wrong.