Skip to content

Commit

Permalink
Version 1.0 release
Browse files Browse the repository at this point in the history
Version 1.0 release
  • Loading branch information
Yattabyte committed Mar 29, 2019
1 parent 168f749 commit ea646bc
Show file tree
Hide file tree
Showing 29 changed files with 56 additions and 29 deletions.
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ x64/
x32/
Documentation/
.vs/
src/installer/installer.dir/
src/updater/updater.dir/
src/nstlr/nstlr.dir/
src/nStaller/nStaller.dir/
src/nUpdater/nUpdater.dir/
src/nSuite/nSuite.dir/
app/

# Other
Expand Down Expand Up @@ -67,4 +67,8 @@ CMakeCache.txt
CMakeDoxyfile.tpl.bak
CMakeDoxyfile.in
PredictedInputCache_Debug_x64.dat
PredictedInputCache_Release_x64.dat
PredictedInputCache_Release_x64.dat

# Exceptions
!Dist x64/nSuite.exe
!Dist x64/nUpdater.exe
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(nStallr)
project(nStallerTools)

# Get dependency directory locations from the user
set (LZ4_DIR "" CACHE PATH "LZ4 root directory")
Expand All @@ -15,10 +15,10 @@ link_libraries ( debug ${LZ4_DIR}/x64_Debug/liblz4_static.lib
optimized ${LZ4_DIR}/x64_Release/liblz4_static.lib )

# add all sub-projects and plugins here
add_subdirectory( "src/installer" )
add_subdirectory( "src/updater" )
add_subdirectory( "src/nstlr" )
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT nstlr)
add_subdirectory( "src/nStaller" )
add_subdirectory( "src/nUpdater" )
add_subdirectory( "src/nSuite" )
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT nSuite)

# Enable folder structure
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
Binary file added Dist x64/nSuite.exe
Binary file not shown.
Binary file added Dist x64/nUpdater.exe
Binary file not shown.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
# nStallr
# nStaller Tools

This project contains a set of tools to package directories & files into portable installers, tools to diff/delta-encode directories, creating patch files, as well as tools to apply patches.
This project allows developers to generate and distribute portable installers for a given input directory, as well as diff the contents of 2 input directories into a single patch file.
Provides means for users to install and update files managed by this set of tools.

This project is a work-in-progress, and is currently undergoing a bit of an overhaul. This section will be updated when Version 1.0 is released.
## nSuite.exe
The nSuite tool is intended to be used by developers or those who wish to package/diff/distribute one or many files. It is run by command-line, and requires one of the following sets of arguments to be fulfilled:
- #### `-installer -src=<path> -dst=<path>`
- Packages + compress an entire **source** directory into a **destionation** installer *.exe file* (filename optional)

- #### `-pack -src=<path> -dst=<path>`
- Same as the installer, though doesn't embed into an installer, just a *.npack* file (filename optional)
- Package files can be read-through by the diffing command, so many versions of a directory can be easily stored on disk in single snapshots.

- #### `-unpack -src=<path> -dst=<path>`
- Decompresses the files held in the **source** *.npack* file, dumping into the **destination** directory.

- #### `-diff -old=<path> -new=<path> -dst=<path>`
- Finds all the common, new, and old files between the **old** and **new** directories. All common files are analyzed bytewise for their differences, and patch instructions are generated. All instructions are compressed and stored in a **destination** *.ndiff* file. ***All*** files are hashed, to ensure the right versions of files are consumed at patch-time.
- Can use *.npack* files as the **old** ***or*** **new** directories (serving as snapshots). Diffing packages means storing less files and folders across multiple versions on disk -> just 1 snapshot per version.

- #### `-patch -src=<path> -dst=<path>`
- Uses a **source** *.ndiff* file and executes all the instructions contained within, patching the **destination** directory. All files within the directory are hashed, and must match the hashes found in the patch. Additionally, the post-patch results must match what's expected in the hash. If any of the strict conditions aren't met, it will halt prior to any files being modified (preventing against file corruption).


## Installer
The installer tool is a portable version of the unpack command, and is generated by nSuite. Each one will have a custom *.npack* file embedded within. The installer is very basic and installs to the directory it runs from.

### Dependencies/Requirements
## Updater
The updater tool is a portable version of the patch command. It automatically applies all *.ndiff* files it can find, and if successfull, deletes them after. This tool is a naiive implementation of an updater, and would ideally be expanded on by other developers. For instance, if patches were found that would modify an app from v.1 -> v.2 -> v.3 -> v.1, the updater won't try to stop at v.3 (as there are no version headers applied to patches). Further, this updater cannot connect to any servers to fetch patch data, but that would be the next logical step after implementing versioning.

# Dependencies/Requirements
- 64-bit only
- Might only work in Windows
- Uses [CMake](https://cmake.org/)
- Requires the [LZ4 - Compression Library](https://github.com/lz4/lz4) to build, but **does not** come bundled with it
- Using BSD-3-Clause license
- Using BSD-3-Clause license
2 changes: 1 addition & 1 deletion src/Updater/CMakeLists.txt → src/nStaller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endforeach()
############
# EXEC #
############
set (Module updater)
set (Module nStaller)
# Create a library using those source files
add_executable(${Module} ${ROOT}
${CORE_DIR}/Common.h
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/nStlr/CMakeLists.txt → src/nSuite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endforeach()
############
# EXEC #
############
set (Module nstlr)
set (Module nSuite)
# Create a library using those source files
add_executable(${Module} ${ROOT}
${CORE_DIR}/Common.h
Expand All @@ -24,7 +24,7 @@ add_executable(${Module} ${ROOT}
${CORE_DIR}/DirectoryTools.h
${CORE_DIR}/DirectoryTools.cpp)
# This module requires the installer to be built first
add_dependencies(nstlr installer)
add_dependencies(nSuite nStaller)
# Set working directory to the project directory
set_target_properties(${Module} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/nStlr/nstlr.cpp → src/nSuite/nSuite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ int main(int argc, char *argv[])
struct compare_string { bool operator()(const char * a, const char * b) const { return strcmp(a, b) < 0; } };
const std::map<const char *, Command*, compare_string> commandMap{
{ "-installer" , new InstallerCommand() },
{ "-diff" , new DiffCommand() },
{ "-patch" , new PatchCommand() },
{ "-pack" , new PackCommand() },
{ "-unpack" , new UnpackCommand() }
{ "-unpack" , new UnpackCommand() },
{ "-diff" , new DiffCommand() },
{ "-patch" , new PatchCommand() }
};

// Check for valid arguments
Expand All @@ -33,11 +33,11 @@ int main(int argc, char *argv[])
" /\n"
"~\n\n"
" Operations Supported:\n"
" -installer (To compress and package an entire directory into an executable)\n"
" -diff (To diff an entire directory into a file)\n"
" -patch (To patch an entire directory from a patch file)\n"
" -pack (To compress an entire directory into a single file)\n"
" -unpack (To decompress an entire directory from a pack file)\n"
" -installer (To package and compress an entire directory into an executable file)\n"
" -pack (To compress an entire directory into a single .npack file)\n"
" -unpack (To decompress an entire directory from a .npack file)\n"
" -diff (To diff an entire directory into a single .ndiff file)\n"
" -patch (To patch an entire directory from a .ndiff file)\n"
"\n\n"
);

Expand Down
Binary file renamed src/nStlr/nstlr.rc → src/nSuite/nSuite.rc
Binary file not shown.
4 changes: 1 addition & 3 deletions src/Installer/CMakeLists.txt → src/nUpdater/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endforeach()
############
# EXEC #
############
set (Module installer)
set (Module nUpdater)
# Create a library using those source files
add_executable(${Module} ${ROOT}
${CORE_DIR}/Common.h
Expand All @@ -23,8 +23,6 @@ add_executable(${Module} ${ROOT}
${CORE_DIR}/BufferTools.cpp
${CORE_DIR}/DirectoryTools.h
${CORE_DIR}/DirectoryTools.cpp )
# This module requires the updater to be built first
add_dependencies(installer updater)
# Set working directory to the project directory
set_target_properties (${Module} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Updater/updater.cpp → src/nUpdater/nUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main()
" ~-----------------~\n"
" /\n"
"~\n\n"
"There are " << patches.size() << " patches(s) found.\n"
"There are " << patches.size() << " patches(s) found.\n"
"\n";
if (patches.size()) {
pause_program("Ready to update?");
Expand Down
File renamed without changes.

0 comments on commit ea646bc

Please sign in to comment.