Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
which was requested in issue #5
  • Loading branch information
BiltuDas1 committed Jan 21, 2023
1 parent 468ec31 commit 35ef178
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 92 deletions.
6 changes: 3 additions & 3 deletions docs/function.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
### noedge.exe
The noedge.exe is the main component of the whole scenario. It checks for required components and then execute with Administrator privilege.
The noedge.exe is the main component of the whole scenario. It checks for required components and then execute with Administrator privilege. If you are looking for command line arguments of noedge.exe then check [parameters.md](parameters.md)

### msedge.exe
This program redirect all parameters to default browser.

It is located under `%PROGRAMDATA%\MSEDGE\msedge.exe` and copied to `%PROGRAMFILES(X86)%\Microsoft\Edge\Application\msedge.exe`

### msedge.ini
Configuration file for [noedge.exe](#noedge.exe) and [msedge.exe](#msedge.exe). It contains many human readable configuration which is acceptable by noedge.exe and msedge.exe. It is located under `%PROGRAMDATA%\MSEDGE\msedge.ini`. If it got deleted then msedge.exe will stop working.
Configuration file for [noedge.exe](#noedgeexe) and [msedge.exe](#msedgeexe). It contains many human readable configuration which is acceptable by noedge.exe and msedge.exe. It is located under `%PROGRAMDATA%\MSEDGE\msedge.ini`. If it got deleted then msedge.exe will stop working. If it got deleted mistakenly then you can recreate it using [noedge.exe](#noedgeexe). For manually configuration check [msedgeini.md](msedgeini.md)

### search.json
The most important file which contains all the search engine and their parameters. It is used by [noedge.exe](#noedge.exe) for listening all the search engine into one window and configure [msedge.ini](#msedge.ini) according to user choice.
The most important file which contains all the search engine and their parameters. It is used by [noedge.exe](#noedgeexe) for listening all the search engine into one window and configure [msedge.ini](#msedgeini) according to user choice.
24 changes: 24 additions & 0 deletions docs/msedgeini.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# msedge.ini
This tutorial will tell you how to configure msedge.ini manually
Here is a sample of msedge.ini file
```
[msedge.exe]
hash=99376139f61d90be727106a65d2640362edf6efac1a0ab8bbda6033272869cf6
name=Google
parameters=/search?q=$query$
url=www.google.com
[noedge.exe]
upgradable=true
version=1.2.0.1
```
### Supported Configurations
**Note: Bold fields are mandatory for each msedge.ini for working into latest version of noedge.exe**
#### `[msedge.exe]`
* hash - sha256 value of msedge.exe
* name - name of the Search Engine
* **parameters - search parameter of Search Engine, for example check [search.json](../search.json)**
* **url - URL of Search Engine, without protocol e.g. http, https**

#### `[noedge.exe]`
* upgradable - forces noedge.exe to fresh install, default value is false.
* **version - version of noedge.exe which was last used for generating msedge.ini file, If you are not sure about the version then change to `0.0.0.0`. This is mandatory field, if it not present into msedge.ini file then noedge.exe will crash.**
14 changes: 14 additions & 0 deletions docs/parameters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Parameters of noedge.exe
### Default Parameters
`--offline jsonFile=<jsonfile>` - Allows noedge.exe to execute without any internet connection. Here `<jsonfile>` is the path of a jsonfile which contains list of search engines and their parameters. It should be format like [search.json](../search.json) or it wouldn't work properly.

`--online` - Allows noedge.exe to fetch files from this repo instead of locally.

`--recovery` - Lists all backups which was created by noedge.exe.
### Debug Parameters
Note: This is intended for advanced users. And those parameters might be removed into future released. All parameters will work after passing `--debug` parameter.
Example: `noedge.exe --debug --upgrade true`

`--upgrade <bool>` - This is used for whether noedge.exe will fresh install or not. If no value passed then it just switch the current configuration to opposite e.g. true to false, false to true.

`--seenlicense <bool>` - Show/Hide the license screen while executing noedge.exe. If not value passed then it switch the current configuration with the opposite one.
4 changes: 2 additions & 2 deletions include/compn.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ string exec, tmp, arc, tver, ver, desktop, system32, cd, noedgeconf, edge, temp_
const string durl = "https://github.com/BiltuDas1/no-edge/releases/latest/download/noedge.exe";
const string eurl = "https://github.com/BiltuDas1/no-edge/releases/latest/download/msedge.exe";
int lkey, temp_int;
bool upgrade, isFailed = true, temp_bool;
bool upgrade, isFailed = true;

ifstream file;
ofstream myfile;
Expand Down Expand Up @@ -52,7 +52,7 @@ void license()
system("mode 96,30");
system("title License");
printf(" NO EDGE IS SIGNED UNDER THE UNLICENSE\n");
printf(" This is free and unencumbered software released into the public domain.\n\n");
printf(" This is freeand unencumbered software released into the public domain.\n\n");
printf(" Anyone is free to copy, modify, publish, use, compile, sell, or\n");
printf(" distribute this software, either in source code form or as a compiled\n");
printf(" binary, for any purpose, commercial or non - commercial, and by any\n");
Expand Down
104 changes: 17 additions & 87 deletions noedge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,19 +352,7 @@ class function1 {
temp_str2 = "noedge-recovery" + *tp;
fs::create_directory("Recovery/" + temp_str2);
delete tp;

// Terminating Edge Update Services
ShellExecuteA(NULL, "open", (system32 + "\\taskkill.exe").c_str(), "/im MicrosoftEdgeUpdate.exe /f", NULL, SW_SHOW);
lkey = _getch();
// Deleting Edge Update Registry
winreg::RegKey key;
winreg::RegResult g = key.TryOpen(HKEY_LOCAL_MACHINE, L"SYSTEM\\ControlSet001\\Services");
if (g)
{
g = key.TryDeleteTree(L"edgeupdate");
g = key.TryDeleteTree(L"edgeupdatem");
}
key.~RegKey();


// Moving all files to 'noedge-recovery'
if (fs::exists("Edge"))
Expand Down Expand Up @@ -393,31 +381,20 @@ class function1 {
function1()
{
// License
msedge.load(noedgeconf + "\\\\msedge.ini");
try{
temp_bool = msedge["noedge.exe"]["seenlicense"].as<bool>();
}
catch (...)
{
temp_bool = false;
}
if(!temp_bool)
while (true)
{
while (true)
{
license();
cout << " Are you Agree with the License?[Y/N]" << endl;
lkey = _getch();
if (lkey == 89 || lkey == 121)
break;
else if (lkey == 78 || lkey == 110)
exit(0);
else {
system("CLS");
cout << " " << dye::red("Error: Invalid Option, Please try again.") << hue::green << endl;
Sleep(5000);
system("CLS");
}
license();
cout << " Are you Agree with the License?[Y/N]" << endl;
lkey = _getch();
if (lkey == 89 || lkey == 121)
break;
else if (lkey == 78 || lkey == 110)
exit(0);
else {
system("CLS");
cout << " " << dye::red("Error: Invalid Option, Please try again.") << hue::green << endl;
Sleep(5000);
system("CLS");
}
}

Expand Down Expand Up @@ -483,13 +460,12 @@ class function1 {
lkey = _getch();
exit(1);
}
// Generating sha256
system("certutil -hashfile %programdata%\\MSEDGE\\msedge.exe SHA256>%tmp%\\sha256.tmp");
file.open(tmp + "\\\\sha256.tmp");
system("certutil -hashfile %programdata%\\MSEDGE\\msedge.exe SHA256>%tmp%\\sha256");
file.open(tmp + "\\\\sha256");
getline(file, temp_str);
getline(file, temp_str);
file.close();
delf(tmp + "\\\\sha256.tmp");
delf(tmp + "\\\\sha256");
msedge.load(noedgeconf + "\\\\msedge.ini");
msedge["msedge.exe"]["hash"] = temp_str;
msedge.save(noedgeconf + "\\\\msedge.ini");
Expand Down Expand Up @@ -572,13 +548,10 @@ class recovery
}
}
delete pth;
printf("0. Exit");
cout << endl;
cout << "Choice: ";
cin >> temp_int;
cout << hue::reset << endl << endl;
if (temp_int == 0)
exit(0);
if (temp_int > *i || temp_int <= 0)
{
cout << dye::red("Invalid choice, Please try again.");
Expand Down Expand Up @@ -752,49 +725,6 @@ class debug
cout << dye::green("upgradable value is set to ") << dye::green(msedge["noedge.exe"]["upgradable"].as<string>()) << endl;
}
}
else if (*arg2 == "--seen-license")
{
startup::conf_noedge();
if (argc > 3)
{
string* arg3 = new string(argv[3]);
if (*arg3 == "true" || *arg3 == "1")
{
msedge.load(noedgeconf + "\\\\msedge.ini");
msedge["noedge.exe"]["seenlicense"] = true;
msedge.save(noedgeconf + "\\\\msedge.ini");
}
else if (*arg3 == "false" || *arg3 == "0")
{
msedge.load(noedgeconf + "\\\\msedge.ini");
msedge["noedge.exe"]["seenlicense"] = false;
msedge.save(noedgeconf + "\\\\msedge.ini");
}
else
{
cout << dye::red("Invalid value passed, only bool type value supported.") << endl;
}
delete arg3;
}
else
{
msedge.load(noedgeconf + "\\\\msedge.ini");
try {
if (msedge["noedge.exe"]["seenlicense"].as<bool>() == false)
msedge["noedge.exe"]["seenlicense"] = true;
else if (msedge["noedge.exe"]["seenlicense"].as<bool>() == true)
msedge["noedge.exe"]["seenlicense"] = false;
else
msedge["noedge.exe"]["seenlicense"] = false;
}
catch (...) {
msedge["noedge.exe"]["seenlicense"] = true;
}
msedge.save(noedgeconf + "\\\\msedge.ini");
msedge.load(noedgeconf + "\\\\msedge.ini");
cout << dye::green("seenlicense value is set to ") << dye::green(msedge["noedge.exe"]["seenlicense"].as<string>()) << endl;
}
}
else
{
cout << dye::red("Error: Unknown debug parameter") << endl;
Expand Down

0 comments on commit 35ef178

Please sign in to comment.