Giter Site home page Giter Site logo

sibtiger / powershell-compact-archive-tool Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 50.12 MB

Compacts all assets of the project into ZDoom's ZIP filesystem standards. Useful for creating PK3 or PK7, as an alternative of a WAD file.

License: GNU General Public License v3.0

PowerShell 94.02% Inno Setup 5.16% Batchfile 0.82%
7z 7zip compiler doom doom-2 doommodding gzdoom gzdoom-mod powershell powershell-compat-archive-tool powershell-core powershell-scripts pscat skulltag wad zandronum zdoom zdoom-doom zdoom-mods zip

powershell-compact-archive-tool's People

Contributors

sibtiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

disco0

powershell-compact-archive-tool's Issues

Support Unified PowerShell Module Functions

Implement PowerShell Module functions in a generalized form, allowing the ability to reuse the functions for various CMDLets - not just locked to only one CMDLet. These functions should be added into CommonIO class.

  • Detect PowerShell Module
  • Install PowerShell Module
  • Update PowerShell Module
  • Uninstall PowerShell Module
  • About PowerShell Module
  • Check for Update PowerShell Module
  • Fetch Local PowerShell Module metadata
  • Fetch Remote PowerShell Module metadata
  • Check if PowerShell exists in Repository

Support ONLY dotNet ZIP or 7-Zip

To help reduce code complexity and increase code maintainability, it might be best to ditch either supporting 7-Zip OR dotNET ZIP functionality entirely.

More thought is needed before proceeding down this path.

Remove the ability for the user to configure notifications - audible sounds

Modern applications are expected to provide audible feedback based on whatever events had been raised. It is quite unnatural to allow the user to disable or only have one event trigger sounds. I believe that all audible notification sounds should be enabled - with no ability to disable all or only allow one specific event.

Remove Git extCMD Support

Because we will be switching to PowerShell Modules, and to make maintaining this functionality easier, it would be easier to drop Git extCMD from PSCAT.

This issue depends on the following:

Remove Multithreaded option

Remove the ability for the user to configure the Multithreaded option from the user configuration. By default, 7zip will always use multithreading when available.

BurntToast - Add in Settings Menu

Allow user the ability to configure BurntToast within the BurntToast Settings, which is accessible through the Settings Menu. The following will be presented to the user within BurntToast Settings:

  1. If Installed:
    A. About BurntToast
    B. Update BurntToast - If updates are available
    C. Exit
  2. Else:
    A. Install BurntToast
    B. Exit

Simplify Code Base

Please inspect every possible way to simplify the code base; this is a living ticket for the time being.

The code base is getting too confusing for myself, and find myself asking "Why did I do this?".

Rename PSCAT Projects to PSCAT Blueprints

This effort is to rename all mentions of PSCAT Projects, and projects related to the same functionality) as 'Blueprints'. The current naming scheme, in my personal experience, confuses me - especially if I need to convey the information to the user in the front-end. For instance, are we talking about the ZDoom mod projects or PSCAT projects? It becomes confusing.

Blueprint definitions:

  • An original plan or prototype that influences subsequent design or practice.
  • Something intended as a guide for making something else.

Implement Git PowerShell Module Support

When finding a suitable and reliable Git PowerShell Module, then the functionality to use the module should then be added into the GetControl Class.

In doing so, the previous implementation of using the ExtCMD will be entirely replaced for the PowerShell Module.

This issue depends on the following:

Remove 7Zip extCMD Support

Because we will be switching to PowerShell Modules, and to make maintaining this functionality easier, it would be easier to drop 7Zip extCMD from PSCAT.

This issue depends on the following:

EmbedInstaller - Ability to Update PSCAT Projects

This feature will allow the user to easily update one or more of PSCAT based projects that had already been installed within the user's roaming profile installation directory [%AppData%/PowerShell-Compact-Archive-Tool]. The base procedure will follow the same method as a normal or first time installation of a project.

By doing this, the Embed Installer will provide the following actions:

  1. Present instructions to the user in regards to the operation that will occur.
  2. Create a temporary directory and present that directory to the user, by using the Windows' File Explorer.
  3. Allow the user the ability to drag'n-drop their desired project (.zip) files into that same temporary directory.
  4. Continue operation when the user closes the temporary directory shown within the Windows' File Explorer.
  5. Create a new temporary and extract project files into the same temporary directory.
  6. Inspect a file named meta.info
  7. Obtain: Project Name (same as directory) and version.
  8. Find the Project install directory, if available - and open meta.info. If the project was not installed, skip comparison.
  9. Compare version from previous install and the temporarily extracted project meta version string.
    A. If the previously installed is newer: Skip update
    B. If the previously installed is older: Perform update by relocating assets from the temporary extracted project directory, but first deleting the previous install.
    C. If both versions are equally the same version, then skip update.

This issue depends on the following:

Visually Impaired Features

If there is support for this feature, it is possible to implement the following:

  • Text to Speech; Windows Only
  • High Contrast theme

These features can be able to help those that want to use this program, but have challenges with their vision.

Please reply for feedback or like this ticket to support this feature.

Installing Projects into PSCAT - Using File Browser

Presently, the current algorithm requires the user to move items into a temporary directory - which from there several cons happen:

  1. User might accidentally use the 'move' operation instead of copying the file from the same filesystem. This can cause the file to be accidentally deleted.
  2. Could be confusing to the user as it is unnatural.
  3. Lose track of the new File Explorer instance, if the user's desktop is cluttered.
  4. User can accidentally move . files, but not zip files, into the temporary directory - which could be deleted.

Instead of using this current method of 'uploading' projects from the user, we should use the File Browser and restrict it to only allow *.ZIP files. This step reverses the cons that are listed above.

Filesystem Structure: Projects

To allow projects to be installed and contain a structure that conforms to PSCAT, the filesystem must first be designed. The goal is to allow projects to have: logo images for Windows Toast notifications, complex builder scripts, Project Meta, and potentially more in the future.

  • %AppData%\PowerShell Compact-Archive Tool\Projects$projectName
    • \Images\
      • logo.png
      • banner.png
    • ComplexBuilder.pscat
    • Project.meta

Create Program to Generate new PSCAT Projects

Due to the nature of the Embed Installer's functionality and future builds beyond 1.2.0, the user will need a way to create new PSCAT Projects. By supporting newly generated projects, it must conform to Embed Installer's data structures and also be seamless to the user creating the new project (or updating an existing).

I am thinking of using C# this time to get the job done, using a GUI.

Presently, Embed Installer demands the following structure:

  • Images
    • Banner.png
    • Logo.png
  • meta

The contents within the ascii file, meta, must be exactly as follows:

Project_Name:       <Data Type: STRING>
Project_Revision:    <Data Type: UINT64>
Project_Signature:  <Data Type: GUID>

Find Replacement of 7Zip extCMD to POSH Module

Find a replacement of the external command, 7Zip.exe, by switching to a PowerShell Module. It must be clear that switching over to a PowerShell Module, the functionality and support must remain intact from what already exists. Further, by switching to a PowerShell Module, PSCAT can then manage the PowerShell Module dependency. By managing the PowerShell Module, the module can be installed, updated, or removed when requested by the user.

Required Functionality within SevenZip Class:

  • Get Hash - ArchiveHash()
  • Verify Archive - VerifyArchive()
  • List Files in Archive - ListFiles()
  • Extract Files - ExtractArchive()
  • Create Archive - CreateArchive()

Project Manager - User Configures Where Project Source is Located

Presently, there is no possible way for a PSCAT Project to contain information as to where the source files exist within the user's host system. To resolve this, each individual project must contain the source path. This will be generated by the user by using a file named, UserConfig. In this file, it will contain the absolute path to the project source files. When upon loading a project into the program's environment, the UserConfig will also be loaded. To configure UserConfig, the user will need to interact with PSCAT either during Installation of the PSCAT Project OR within the settings. Without this functionality, it is not possible for PSCAT to compile any game mods.

UserConfig File:
Project_Source = C:\Users\JohnDoe\Projects\ZDoom Games\TGRDM3\src\

Creating UserConfig File:

  1. Installing a new Project into PSCAT; updates do not count UNLESS the path does not exist.
  2. Compiling without a UserConfig OR the path specified in the UserConfig does not exist.
  3. Settings

User Interacting with UserConfig

  1. PSCAT detects UserConfig is missing, PSCAT detects UserConfig:Project_Source path does not exist, OR User explicitly goes into the settings to configure UserConfig properties.
  2. Provide instructions to the user for providing a path for Project_Source
  3. Use Directory Browser through CommonGUI obj.
  4. Done

Automated Test Cases

With an automated test case, it assures that:

  • ALL functions individually work correctly
  • Output is correct (or matches expectations)
  • Retains proper flow for larger operations such as: Compiling, updating a project, and generating reports.

Filesystem Structure: Program

To allow PSCAT data to be more organized and structurally sound, the filesystem needs to be improved for future builds - to keep organized for years to come.

  • %LocalAppData%\PowerShell Compact-Archive Tool\Program\
    • Logs\
      • $extCMD\
      • Program\
    • Images\
      • Logo.png
      • Banner.png

Generating PDF Reports are slow

I had just now realized that generating an ASCII report takes mere seconds, while a PDF now takes roughly five minutes. Previously it would just take a minute at worst - but this is now a serious performance degradation that needs to be investigated.

Reports are not generated

After a build had been successfully compiled, the program will not generate a report - despite the user settings had requested it.

Project Manager - Load Projects [One PSCAT for ALL Projects]

Finally, one PSCAT for ALL projects - no longer multiple PSCATs for per-project! This was the original goal of PSCAT, but had to be pushed back for incremental releases. Now is the time to support that idea!

With having the Embed Installer implemented, the user will be able to load projects within each session - without having to terminate PSCAT to launch another project in a new session.

  • PSCAT Startup
    • Retrieve directory list
      • If no projects found, launch the Embed Installer
      • If only one project found, load it.
      • If more than one project found, ask user what project to load.
  • Main Menu
    • Show 'Load Project' if more than one project exists.

This issue depends on the following:

Windows Explorer not used after compile

The Windows Explorer (GUI) functionality is not used to easily point out to the compile build location. The program will need to respect the user's configuration regarding this feature.

About Section

If possible, create a new section within the main menu that holds an 'About' section. This provides basic information regarding the program, possibly contributors, copyright, license, and anything else that may be worth providing.

Find Replacement of Git extCMD to POSH Module

Find a replacement of the external command, Git.exe, by switching to a PowerShell Module. It must be clear that switching over to a PowerShell Module, the functionality and support must remain intact from what already exists. Further, by switching to a PowerShell Module, PSCAT can then manage the PowerShell Module dependency. By managing the PowerShell Module, the module can be installed, updated, or removed when requested by the user.

Required Functionality within GitControl Class:

  • Update Local Repository - UpdateLocalRepository()
  • Switch Local Branch - SwitchLocalBranch()
  • Fetch Hash Commit - FetchCommitID()
  • Fetch Commit History - FetchCommitHistory()
  • Get Current Branch Name - FetchCurrentBranch()
  • Get All Branches - FetchAllBranches()
  • Get History of All Branches - FetchAllBranchesActivity()
  • Get Activity Line Graph - GenerateActivityLineGraph()

Update 7Zip Settings to Reflect PowerShell Module Changeover

When switching to a PowerShell Module for 7Zip functionality, the 7Zip Settings will need to be adapted to include options available from the PowerShell Module as well as managing the PowerShell Module itself.

When an exact PowerShell Module had been found, this list will need to be updated.

7Zip Settings Menu List:

  1. Show Install PowerShell Module - if not found.
  2. Show Update PowerShell Module - if outdated
  3. Show Remove PowerShell Module - if found
  4. Show About 7Zip PowerShell Module - if found
  5. Use 7Zip Functionality
  6. Locate the 7Zip Application - REMOVED
  7. Select Compression Method
  8. Change Zip Algorithms
  9. Change 7Zip Algorithms
  10. Compression Level
  11. Verify Build
  12. Create Report

This issue depends on the following:

Expunge all or some PSCAT directories

Allow the user the ability to remove:

  • Configurations
  • All logs and reports
  • All compiled builds

By doing this, this may prove to be useful for someone that wishes to:

  • Cleanup their filesystem
  • Start over with PSCAT
  • Uninstall

Rename the Embed Installer to Project Manager

Rename the 'Embed Installer' to 'Project Manager'. Originally, the Embed Installer was going to focus on two types of installations methods:

  1. PSCAT Projects
  2. Burnt Toast Module

Because we can use POSH to perform the installation of modules for us - instead of manually installing it ourselves - there is no need to support installing the modules. Thus, the only need for this functionality is purely for PSCAT Projects.

Report Bug Feature

Allow the user to report bugs in a easy fashion. When the user wants to report a bug, the program will capture their current logfiles and their current configuration within the roaming profile. With that, this will allow the user to rapidly send the required resources to the proper medium for reporting purposes.

Support Windows 10 Toast Notifications

To help provide Notifications to the end user when an operation is completed, PSCAT can send a 'toast' notification to the user via the Action Center. This can help to grab the user's attention, alongside the audible notifications.

Update Git Settings to Reflect PowerShell Module Changeover

When switching to a PowerShell Module for Git functionality, the Git Settings will need to be adapted to include options available from the PowerShell Module as well as managing the PowerShell Module itself.

When an exact PowerShell Module had been found, this list will need to be updated.

Git Settings Menu List:

  1. Show Install PowerShell Module - if not found.
  2. Show Update PowerShell Module - if outdated
  3. Show Remove PowerShell Module - if found
  4. Show About Git PowerShell Module - If found
  5. Use Git Functionality
  6. Locate the Git Application - REMOVED
  7. Update Source
  8. Size of Commit ID
  9. Retrieve History
  10. History Commit Size
  11. Create Report

This issue depends on the following:

Compiling a development build is not properly supported

When compiling a project, it is presently treated as a production release - instead of allowing for a development release. With that, the git hash is never applied to the compiled build's name.

Resolution:

  1. Main Menu allows the user to switch between Production Release and Development Release
  2. Provide the current state of what build of the project is to be compiled; either a Production build or Development build, this will be shown underneath the first option within the list.
  3. Show a note about how to switch the compiled builds further below the Exit option.
  4. Perhaps the hotkey should be "-" to toggle the build types.

Visual Aid
Screenshot 2021-06-20 151141

EmbedInstaller - Ability to Install PSCAT Projects

This feature will allow the user to easily install one or more PSCAT based projects into the user's roaming profile installation directory [%AppData%/PowerShell Compact-Archive Tool].

By doing this, the Embed Installer will provide the following actions:

  1. Present instructions to the user in regards to the operation that will occur.
  2. Create a temporary directory and present that directory to the user, by using the Windows' File Explorer.
  3. Allow the user the ability to drag'n-drop their desired project (.zip) files into that same temporary directory.
  4. Continue operation when the user closes the temporary directory shown within the Windows' File Explorer.
  5. Embed Installer will extract each Zip file into their respected final install location.

Create Compile Project from Main Menu

Relocate Create a new Build and Create Developmental Build to a new menu item, Compile Project. By doing this, the Main Menu will be one item short - but also allowing more information to be present within the compile menu.

  • Compile $ProjectName
    • Create Normal Build of $projectName
    • Create Developmental Build of $projectName

Delete Global Variables - Constants

This issue only effects those that consistently use the PowerShell terminal for their end-to-end operations through out the entire day (or days). The issue is that once the variable had been declared as a constant within the script, the variable will remain valid - until the terminal is restarted. As such, if there are two scripts that rely on that variable - but the values differ, there is going to be an issue as the variable can not be re-initialized nor deleted before hand.

The reason for this behavior is the 'Constant' flag that is being used. To circumvent this complication, we can use the 'ReadOnly' option instead. While the ReadOnly can still be manipulated in contrast to the Constant, we can be able to ultimately remove that variable during an uninitialization phase while closing down the application.

More information in regards to 'Remove-Variable' CMDlet:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/remove-variable?view=powershell-7.2

PSCAT Installer

While I am thinking about creating an uninstaller for the application, relating to this ticket: #15. Perhaps it might be a good idea to create a script that will install the application for the user automatically, if they choose to do so.

If using the installer, then the installation path should be the following:
%PROGRAMFILES%

Luckily, all application data that is generated by PSCAT is stored in the user's %APPDATA% and %LOCALAPPDATA%. Thus, making this move to %PROGRAMFILES% as the formal installation path - should be acceptable.

Implement 7Zip PowerShell Module Support

When finding a suitable and reliable 7Zip PowerShell Module, then the functionality to use the module should then be added into the SevenZip Class. In doing so, the previous implementation of using the ExtCMD will be entirely replaced for the PowerShell Module.

This issue depends on the following:

EmbedInstaller - Ability to Delete Projects

Allow the user the ability to delete projects from the installed directory, in which the all data related within that project directory is permanently deleted by user's request.

The following actions well be performed:

  1. User accesses the Embed Installer (or Add or Configure Project)
  2. Present a menu to the user requiring input from the menu selection:
    A. Install or Update Projects
    B. Remove Projects
    C. Return to previous menu
  3. User selects 'Remove Projects'
  4. Present instructions to the user
  5. Present the Select Directory GUI (Allow multiple selections)
  6. If 'Cancel', abort and return to Project Menu again.
  7. Else, Confirm to the user
  8. If 'False', abort to Project Menu again.
  9. Else, perform the desired action.
  10. Return back to the Project Menu.

This issue depends on the following:

Project Manager - List Installed Projects

Allow the user with the ability to view all installed PSCAT projects through the Project Manager menu when requested.

The following actions will be performed:

  1. User accesses the Project Manager (fka Embed Installer)
  2. Present a menu to the user requiring input from the menu selection:
    a. Install or Update Projects
    b. Uninstall Projects
    c. View all Installed Projects
    d. Return to previous menu
  3. User selects 'View Installed Projects'
  4. Present brief description to the user
  5. Show all installed projects to user one page at a time for an abundance of installed projects; similar to using extCMD more.
    a. Show Directory Name of the project
    b. Show Project Name from the meta file
    c. Show Project Revision from the meta file
  6. Wait for user to press the enter key; allow them to view the results.
  7. Return to Project Manager's Menu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.