Skip to content

Commit 49cc7e4

Browse files
Fomin PetrFomin Petr
authored andcommitted
Добавьте файлы проекта.
1 parent dd2d6b3 commit 49cc7e4

4 files changed

Lines changed: 308 additions & 0 deletions

File tree

Program.cpp

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#include <iostream>
2+
#include <fstream>
3+
#include <string>
4+
#include <vector>
5+
#include <windows.h>
6+
#include <urlmon.h>
7+
8+
#pragma comment(lib, "urlmon.lib")
9+
void SetConsoleOutputCP() {
10+
11+
SetConsoleOutputCP(CP_UTF8);
12+
}
13+
14+
void DownloadFile(const std::string& url, const std::string& outputPath) {
15+
HRESULT result = URLDownloadToFileA(NULL, url.c_str(), outputPath.c_str(), 0, NULL);
16+
if (SUCCEEDED(result)) {
17+
std::cout << "Ôàéë çàãðóæåí: " << outputPath << std::endl;
18+
}
19+
else {
20+
std::cerr << "Îøèáêà çàãðóçêè ôàéëà: " << url << std::endl;
21+
}
22+
}
23+
24+
void LaunchFile(const std::string& filePath) {
25+
ShellExecuteA(NULL, "open", filePath.c_str(), NULL, NULL, SW_SHOW);
26+
}
27+
28+
int main() {
29+
30+
SetConsoleOutputCP();
31+
setlocale(LC_ALL, "Russian");
32+
33+
34+
std::vector<std::string> fileUrls = {
35+
"https://www.7-zip.org/a/7z2408-x64.exe",
36+
"https://github.com/ShareX/ShareX/releases/download/v16.1.0/ShareX-16.1.0-setup.exe",
37+
"https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.7.2/npp.8.7.2.Installer.exe",
38+
"https://github.com/benbuck/rbtray/releases/download/v4.14/x64.zip",
39+
"https://github.com/microsoft/PowerToys/releases/download/v0.86.0/PowerToysUserSetup-0.86.0-x64.exe",
40+
"https://github.com/TranslucentTB/TranslucentTB/releases/download/2024.1/TranslucentTB-portable-x64.zip",
41+
"https://ru.download.nvidia.com/nvapp/client/11.0.1.163/NVIDIA_app_v11.0.1.163.exe",
42+
"https://engine.steelseriescdn.com/SteelSeriesGG75.1.0Setup.exe",
43+
"https://github.com/Codeusa/Borderless-Gaming/releases/download/9.5.6/BorderlessGaming9.5.6_admin_setup.exe",
44+
"https://files.multimc.org/downloads/mmc-develop-win32.zip",
45+
"https://download.radmin-vpn.com/download/files/Radmin_VPN_1.4.4642.1.exe",
46+
"https://github.com/Windows200000/TwitchDropsMiner-updated/releases/download/v15.9.1/Twitch.Drops.Miner.Windows.zip",
47+
"https://github.com/windirstat/windirstat/releases/download/release%2Fv2.0.3/WinDirStat-x64.msi",
48+
"https://download01.logi.com/web/ftp/pub/techsupport/gaming/lghub_installer.exe",
49+
"https://vscode.download.prss.microsoft.com/dbazure/download/stable/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/VSCodeUserSetup-x64-1.95.3.exe",
50+
"https://dl.ocbase.com/per/stable/OCCT.exe"
51+
};
52+
53+
std::vector<std::string> fileNames = {
54+
"7-zip",
55+
"ShareX",
56+
"Notepad++",
57+
"RBtray",
58+
"PowerToys",
59+
"TranslucentTB",
60+
"Nvidia app",
61+
"SteelSeries app",
62+
"Borderless-Gaming",
63+
"multimc",
64+
"RadminVPN",
65+
"TwitchDropsMiner",
66+
"WinDirStat",
67+
"Logitech G HUB",
68+
"Visual Studio Code",
69+
"OCCT"
70+
};
71+
72+
73+
std::string downloadFolder;
74+
char* buffer = nullptr;
75+
size_t size;
76+
77+
78+
if (_dupenv_s(&buffer, &size, "USERPROFILE") == 0) {
79+
downloadFolder = std::string(buffer) + "\\Documents\\DownloadedFiles";
80+
free(buffer);
81+
}
82+
else {
83+
std::cerr << "Íå óäàëîñü ïîëó÷èòü ïóòü ê ïàïêå ïîëüçîâàòåëÿ." << std::endl;
84+
return 1;
85+
}
86+
87+
CreateDirectoryA(downloadFolder.c_str(), NULL);
88+
89+
std::cout << "Âûáåðèòå ïðîãðàììû äëÿ çàãðóçêè (ââåäèòå íîìåðà ÷åðåç ïðîáåë):" << std::endl;
90+
for (size_t i = 0; i < fileNames.size(); ++i) {
91+
std::cout << i + 1 << ". " << fileNames[i] << std::endl;
92+
}
93+
94+
std::string input;
95+
std::getline(std::cin, input);
96+
97+
98+
std::vector<int> selectedFiles;
99+
size_t pos = 0;
100+
while ((pos = input.find(' ')) != std::string::npos) {
101+
selectedFiles.push_back(std::stoi(input.substr(0, pos)) - 1);
102+
input.erase(0, pos + 1);
103+
}
104+
selectedFiles.push_back(std::stoi(input) - 1);
105+
106+
for (int index : selectedFiles) {
107+
if (index >= 0 && index < fileUrls.size()) {
108+
std::string fileName = fileUrls[index].substr(fileUrls[index].find_last_of('/') + 1);
109+
std::string filePath = downloadFolder + "\\" + fileName;
110+
111+
112+
DownloadFile(fileUrls[index], filePath);
113+
114+
LaunchFile(filePath);
115+
}
116+
else {
117+
std::cerr << "Íåêîððåêòíûé íîìåð: " << index + 1 << std::endl;
118+
}
119+
}
120+
std::cout << "Íàæìèòå Enter äëÿ âûõîäà..." << std::endl;
121+
std::cin.get();
122+
return 0;
123+
}

WinReinstallHelper.sln

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35521.163 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinReinstallHelper", "WinReinstallHelper.vcxproj", "{6574A70A-0469-48AF-A351-1C241209C131}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{6574A70A-0469-48AF-A351-1C241209C131}.Debug|x64.ActiveCfg = Debug|x64
17+
{6574A70A-0469-48AF-A351-1C241209C131}.Debug|x64.Build.0 = Debug|x64
18+
{6574A70A-0469-48AF-A351-1C241209C131}.Debug|x86.ActiveCfg = Debug|Win32
19+
{6574A70A-0469-48AF-A351-1C241209C131}.Debug|x86.Build.0 = Debug|Win32
20+
{6574A70A-0469-48AF-A351-1C241209C131}.Release|x64.ActiveCfg = Release|x64
21+
{6574A70A-0469-48AF-A351-1C241209C131}.Release|x64.Build.0 = Release|x64
22+
{6574A70A-0469-48AF-A351-1C241209C131}.Release|x86.ActiveCfg = Release|Win32
23+
{6574A70A-0469-48AF-A351-1C241209C131}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal

WinReinstallHelper.vcxproj

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>17.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{6574a70a-0469-48af-a351-1c241209c131}</ProjectGuid>
25+
<RootNamespace>WinReinstallHelper</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<ClCompile>
75+
<WarningLevel>Level3</WarningLevel>
76+
<SDLCheck>true</SDLCheck>
77+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
<ConformanceMode>true</ConformanceMode>
79+
</ClCompile>
80+
<Link>
81+
<SubSystem>Console</SubSystem>
82+
<GenerateDebugInformation>true</GenerateDebugInformation>
83+
</Link>
84+
</ItemDefinitionGroup>
85+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
86+
<ClCompile>
87+
<WarningLevel>Level3</WarningLevel>
88+
<FunctionLevelLinking>true</FunctionLevelLinking>
89+
<IntrinsicFunctions>true</IntrinsicFunctions>
90+
<SDLCheck>true</SDLCheck>
91+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
92+
<ConformanceMode>true</ConformanceMode>
93+
</ClCompile>
94+
<Link>
95+
<SubSystem>Console</SubSystem>
96+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
97+
<OptimizeReferences>true</OptimizeReferences>
98+
<GenerateDebugInformation>true</GenerateDebugInformation>
99+
</Link>
100+
</ItemDefinitionGroup>
101+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
102+
<ClCompile>
103+
<WarningLevel>Level3</WarningLevel>
104+
<SDLCheck>true</SDLCheck>
105+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
106+
<ConformanceMode>true</ConformanceMode>
107+
</ClCompile>
108+
<Link>
109+
<SubSystem>Console</SubSystem>
110+
<GenerateDebugInformation>true</GenerateDebugInformation>
111+
</Link>
112+
</ItemDefinitionGroup>
113+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
114+
<ClCompile>
115+
<WarningLevel>Level3</WarningLevel>
116+
<FunctionLevelLinking>true</FunctionLevelLinking>
117+
<IntrinsicFunctions>true</IntrinsicFunctions>
118+
<SDLCheck>true</SDLCheck>
119+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120+
<ConformanceMode>true</ConformanceMode>
121+
</ClCompile>
122+
<Link>
123+
<SubSystem>Console</SubSystem>
124+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
125+
<OptimizeReferences>true</OptimizeReferences>
126+
<GenerateDebugInformation>true</GenerateDebugInformation>
127+
</Link>
128+
</ItemDefinitionGroup>
129+
<ItemGroup>
130+
<ClCompile Include="Program.cpp" />
131+
</ItemGroup>
132+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
133+
<ImportGroup Label="ExtensionTargets">
134+
</ImportGroup>
135+
</Project>

WinReinstallHelper.vcxproj.filters

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Исходные файлы">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Файлы заголовков">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Файлы ресурсов">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="Program.cpp">
19+
<Filter>Исходные файлы</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>

0 commit comments

Comments
 (0)