diff --git a/bin/installer/generate-sections.py b/bin/installer/generate-sections.py index 3153299..316c776 100644 --- a/bin/installer/generate-sections.py +++ b/bin/installer/generate-sections.py @@ -195,13 +195,14 @@ class GenerateInstall: ) self.section_list.append('') - # generate executable info + # generate tool info tool_exe_total = self.iterate_tool_exe(folder_path) tool_jar_total = self.iterate_tool_jar(folder_path) + tool_py_total = self.iterate_tool_py(folder_path) # iterate sub folders for item in pathlib.Path(folder_path).iterdir(): - if item.is_dir() & (tool_exe_total == 0) & (tool_jar_total == 0): + if item.is_dir() & (tool_exe_total == 0) & (tool_jar_total == 0) & (tool_py_total == 0): print(colorama.Fore.MAGENTA + f' [!] Iterate sub folder: "{item}"') self.iterate_tool(item, True) @@ -332,6 +333,41 @@ class GenerateInstall: ) self.section_list.append('') + def iterate_tool_py(self, folder_path): + jar_list = list(folder_path.glob('*.py')) + + # for now there is always 1 + if len(jar_list) == 0: + return 0 + + self.iterate_tool_py_gen(jar_list[0]) + + return len(jar_list) + + def iterate_tool_py_gen(self, py_path): + print(colorama.Fore.GREEN + f' [*] Adding: "{str(pathlib.Path(py_path).name)}"') + tool_py_path = self.absolute_to_local_path(py_path) + working_dir = str(pathlib.Path(py_path).parent) + + self.section_list.append('[Icons]') + self.section_list.append( + f'Name: "{{group}}\\{{#MyAppName}}\\{self.tool_name}"; ' + f'Filename: "{{sys}}\\cmd.exe"; ' + f'Parameters: "/K python ""{{#MyAppToolsFolder}}\\{tool_py_path}"""; ' + f'WorkingDir: "{{#MyAppToolsFolder}}\\{self.absolute_to_local_path(working_dir)}"; ' + f'Components: "{component_name(self.section_name)}\\{component_name(self.tool_name)}"; ' + f'IconFilename: "{self.get_tool_icon()}";' + ) + self.section_list.append( + f'Name: "{{#MyAppBinsFolder}}\\sendto\\sendto\\{self.section_name}\\{self.tool_name}"; ' + f'Filename: "{{sys}}\\cmd.exe"; ' + f'Parameters: "/K python ""{{#MyAppToolsFolder}}\\{tool_py_path}"""; ' + f'WorkingDir: "{{#MyAppToolsFolder}}\\{self.absolute_to_local_path(working_dir)}"; ' + f'Components: "{component_name(self.section_name)}\\{component_name(self.tool_name)}"; ' + f'IconFilename: "{self.get_tool_icon()}";' + ) + self.section_list.append('') + def cli_env_extra_code(self): print('') print(colorama.Fore.YELLOW + f'[+] Generate cli register code') diff --git a/bin/installer/sections/decompilers.iss b/bin/installer/sections/decompilers.iss index eb08060..d170bc7 100644 --- a/bin/installer/sections/decompilers.iss +++ b/bin/installer/sections/decompilers.iss @@ -135,6 +135,10 @@ Name: "decompilers\pythonpyinstxtractor"; Description: "[PYTHON] PyInstxtractor" [Files] Source: "{#MySrcDir}\toolkit\Decompilers\[PYTHON] PyInstxtractor\*"; DestDir: "{#MyAppToolsFolder}\Decompilers\[PYTHON] PyInstxtractor"; Components: "decompilers\pythonpyinstxtractor"; Flags: ignoreversion recursesubdirs createallsubdirs; +[Icons] +Name: "{group}\{#MyAppName}\[PYTHON] PyInstxtractor"; Filename: "{sys}\cmd.exe"; Parameters: "/K python ""{#MyAppToolsFolder}\Decompilers\[PYTHON] PyInstxtractor\pyinstxtractor.py"""; WorkingDir: "{#MyAppToolsFolder}\Decompilers\[PYTHON] PyInstxtractor"; Components: "decompilers\pythonpyinstxtractor"; IconFilename: "{#MyAppToolsIconsFolder}\pyinstxtractor.ico"; +Name: "{#MyAppBinsFolder}\sendto\sendto\Decompilers\[PYTHON] PyInstxtractor"; Filename: "{sys}\cmd.exe"; Parameters: "/K python ""{#MyAppToolsFolder}\Decompilers\[PYTHON] PyInstxtractor\pyinstxtractor.py"""; WorkingDir: "{#MyAppToolsFolder}\Decompilers\[PYTHON] PyInstxtractor"; Components: "decompilers\pythonpyinstxtractor"; IconFilename: "{#MyAppToolsIconsFolder}\pyinstxtractor.ico"; + ; [VB] VB Decompiler