Compare commits

...

42 Commits

Author SHA1 Message Date
3fbf1b80ae Adopt WinStd changes
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-03-02 16:19:30 +01:00
d52e531b25 Update translation template
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-02-17 13:33:56 +01:00
b447e24d42 Update Copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2022-01-07 11:38:09 +01:00
6c851968a9 Redirect output files to the output folder
Thou linker can locate the output .lib file of referenced projects
wherever .lib is just fine, this helps us to gather all .pdb files in
the output folder.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-01 08:47:25 +01:00
f35a15f3fd Switch to SPDX license notice
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-01 08:47:25 +01:00
845ceb53fd Cleanup project files
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-01 08:47:25 +01:00
6d52aa2f1b Retire Visual Studio 2010 support and merge 2017 and 2019 project files
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-30 12:44:50 +01:00
c9cf29551d Resolve charset .idtx/.idt confusion
NMake inline files are always created using ACP. The "1252" in the .idtx
header has no effect on this. However, we must encode the .idt files
using correct charset/codepage regardless the ACP being used on the
building machine.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-11-19 14:19:44 +01:00
c27435b037 Copyright: Bump year
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-03-25 08:32:39 +01:00
a1f596f968 Add UTF-8 BOM markers
MSVC needs them to use correct charset when Language for non-Unicode
programs is set to Windows-1252 or anything different than UTF-8.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-19 10:56:40 +01:00
1eb3292770 Address C5205 compiler warning
Recent Visual Studio 2019 suggests that auto-generated base virtual
class destructor is non-virtual resulting in undefined behavior.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-08-20 12:13:57 +02:00
b701f48fd3 Cleanup .gitignore
.opensdf files are lock files present only when Visual Studio 2010 is
open. As the Visual Studio might contain unsaved files, it is not wise
to ignore that on commit.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-08-20 12:11:51 +02:00
ea617a8eba Makefile: Optimize building
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-03-03 14:44:16 +01:00
6e26cd801a Address code analysis warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-15 19:06:26 +01:00
f39c7b3caf Simplify COpRegValueCreate
Registry is a binary storage. No need to treat strings, DWORDs, or
binaries any different.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-13 10:52:14 +01:00
5581277863 Extend copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-11 15:35:07 +01:00
302c7c9adb Rename stdafx.h to pch.h
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-10 14:09:21 +01:00
76f3bba849 Unify platform designations
.sln uses the same as .vcxproj files

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-02-10 13:49:00 +01:00
Denis Renzi
ae180de826 Add Italian translation 2020-01-17 08:12:36 +01:00
aca0b3a2eb Add Visual Studio 2019 support
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-06-19 11:40:28 +02:00
35b063d709 Switch to Transifex project for localization 2018-09-19 12:05:44 +02:00
79ec696f2a Update translation template 2018-09-19 09:03:52 +02:00
07188e9b20 Extend copyright year 2018-09-07 23:57:23 +02:00
3b1e787f77 Introduce ARM64 support 2018-09-07 13:45:34 +02:00
6eece2eae8 Clean-up 2018-08-31 14:20:42 +02:00
e67d7e6f14 Split the project files to versions for VC2010 and VC2017 2018-08-31 14:15:36 +02:00
2eb6b2a311 Redesign the project files 2018-08-31 13:49:18 +02:00
49b327a955 Update WinStd path 2018-08-31 13:49:01 +02:00
0db18a40b1 COM initialization replaced by auto-initializer 2017-04-25 00:52:17 +02:00
5de934285e Over-matching template operators << and >> replaced with variants for selected data-types only 2017-04-25 00:34:43 +02:00
cf1869f495 Library moved to MSI/MSICA/lib 2017-04-24 23:02:52 +02:00
557eb4403f Translation update 2017-04-24 22:59:44 +02:00
64296e1d3b ATL to WinStd transition completed:
- COpList changed to comprise of std::unique_ptr objects instead of raw COperation* pointers, allowing auto-cleanup
- ATL::CAtlFile replaced with MSICA::CStream
- CComPtr and CComQIPtr replaced with winstd::com_obj
2017-04-24 21:46:00 +02:00
a8b69efe02 ATL::CAtlString, ATL::CAtlArray and ATL::CAtlList replaced with std c++ equivalents 2017-04-24 14:30:23 +02:00
365d82a3ee Copyright extended to 2017 2017-04-18 13:49:23 +02:00
7273e43f83 Translation update 2016-10-05 08:37:28 +02:00
f5d251f96c Translation update 2016-10-04 13:40:45 +02:00
367f05ef1d rcxgettext.exe dependency eliminated 2016-09-19 10:46:06 +02:00
37479173a2 Adaptation to MSIBuild updates
- Source file English "en_US" instead of generic "En" now
- MSIBUILD_LANG_PO merged to LANG
2016-09-19 09:57:02 +02:00
8f264447dd Generation of localized IDT files simplified 2016-09-06 16:40:44 +02:00
18ac2241b3 Support for Russian localization introduced 2016-07-14 18:07:36 +02:00
e321a4082e German and Russian translation stub added 2016-05-13 20:03:13 +02:00
24 changed files with 2339 additions and 1861 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
/*.opensdf
/*.sdf
/*.suo
/.vs
/ipch
*.user
temp

Binary file not shown.

View File

@ -1,9 +1,5 @@
@echo off
nmake.exe /ls All LANG=En CFG=Debug PLAT=Win32
nmake.exe /ls All LANG=Sl CFG=Debug PLAT=Win32
nmake.exe /ls All LANG=En CFG=Debug PLAT=x64
nmake.exe /ls All LANG=Sl CFG=Debug PLAT=x64
nmake.exe /ls All LANG=En CFG=Release PLAT=Win32
nmake.exe /ls All LANG=Sl CFG=Release PLAT=Win32
nmake.exe /ls All LANG=En CFG=Release PLAT=x64
nmake.exe /ls All LANG=Sl CFG=Release PLAT=x64
nmake.exe /ls All LANG=en_US CFG=Debug PLAT=Win32
nmake.exe /ls All LANG=en_US CFG=Debug PLAT=x64
nmake.exe /ls All LANG=en_US CFG=Release PLAT=Win32
nmake.exe /ls All LANG=en_US CFG=Release PLAT=x64

View File

@ -1,9 +1,5 @@
@echo off
nmake.exe /ls Clean LANG=En CFG=Debug PLAT=Win32
nmake.exe /ls Clean LANG=Sl CFG=Debug PLAT=Win32
nmake.exe /ls Clean LANG=En CFG=Debug PLAT=x64
nmake.exe /ls Clean LANG=Sl CFG=Debug PLAT=x64
nmake.exe /ls Clean LANG=En CFG=Release PLAT=Win32
nmake.exe /ls Clean LANG=Sl CFG=Release PLAT=Win32
nmake.exe /ls Clean LANG=En CFG=Release PLAT=x64
nmake.exe /ls Clean LANG=Sl CFG=Release PLAT=x64
nmake.exe /ls Clean LANG=en_US CFG=Debug PLAT=Win32
nmake.exe /ls Clean LANG=en_US CFG=Debug PLAT=x64
nmake.exe /ls Clean LANG=en_US CFG=Release PLAT=Win32
nmake.exe /ls Clean LANG=en_US CFG=Release PLAT=x64

View File

@ -1,36 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29728.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSICALib", "build\MSICALib.vcxproj", "{8552EE55-177E-4F51-B51B-BAF7D6462CDE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "atlex", "..\atlex\build\atlex.vcxproj", "{5A4EADF2-3237-457A-9DA8-BB9942A91019}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|ARM64.Build.0 = Debug|ARM64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|Win32.ActiveCfg = Debug|Win32
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|Win32.Build.0 = Debug|Win32
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|x64.ActiveCfg = Debug|x64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Debug|x64.Build.0 = Debug|x64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|ARM64.ActiveCfg = Release|ARM64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|ARM64.Build.0 = Release|ARM64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|Win32.ActiveCfg = Release|Win32
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|Win32.Build.0 = Release|Win32
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|x64.ActiveCfg = Release|x64
{8552EE55-177E-4F51-B51B-BAF7D6462CDE}.Release|x64.Build.0 = Release|x64
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Debug|Win32.ActiveCfg = Debug|Win32
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Debug|Win32.Build.0 = Debug|Win32
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Debug|x64.ActiveCfg = Debug|x64
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Debug|x64.Build.0 = Debug|x64
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Release|Win32.ActiveCfg = Release|Win32
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Release|Win32.Build.0 = Release|Win32
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Release|x64.ActiveCfg = Release|x64
{5A4EADF2-3237-457A-9DA8-BB9942A91019}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FD46612E-A0D9-4E88-9A26-38DE0813EF45}
EndGlobalSection
EndGlobal

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>temp\$(ProjectName).$(Platform).$(Configuration)\</OutDir>
<IntDir>temp\$(ProjectName).$(Platform).$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\include;..\..\atlex\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
@ -9,6 +13,10 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -20,62 +28,52 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8552EE55-177E-4F51-B51B-BAF7D6462CDE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MSICALib</RootNamespace>
<ProjectName>MSICALib</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Release'">
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
<PropertyGroup Label="Configuration" Condition="'$(Platform)'=='ARM64'">
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\Win32.props" />
<Import Project="..\..\..\include\Release.props" />
<Import Project="MSICALib.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\Win32.props" />
<Import Project="..\..\..\include\Debug.props" />
<Import Project="MSICALib.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\x64.props" />
<Import Project="..\..\..\include\Release.props" />
<Import Project="MSICALib.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\x64.props" />
<Import Project="..\..\..\include\Debug.props" />
<Import Project="MSICALib.props" />
<Import Project="..\..\..\include\$(Platform).props" Condition="exists('..\..\..\include\$(Platform).props')" />
<Import Project="..\..\..\include\$(Configuration).props" Condition="exists('..\..\..\include\$(Configuration).props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir>..\..\..\output\$(Platform).$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\include;..\..\WinStd\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\OpCert.cpp" />
<ClCompile Include="..\src\MSICALib.cpp" />
@ -84,21 +82,14 @@
<ClCompile Include="..\src\OpTS.cpp" />
<ClCompile Include="..\src\OpReg.cpp" />
<ClCompile Include="..\src\OpWLAN.cpp" />
<ClCompile Include="..\src\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<ClCompile Include="..\src\pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\MSICALib.h" />
<ClInclude Include="..\src\stdafx.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\locale\sl_SI.po" />
<ClInclude Include="..\src\pch.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@ -9,10 +9,6 @@
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\MSICALib.cpp">
@ -24,7 +20,7 @@
<ClCompile Include="..\src\OpTS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\stdafx.cpp">
<ClCompile Include="..\src\pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\OpReg.cpp">
@ -44,13 +40,8 @@
<ClInclude Include="..\include\MSICALib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\stdafx.h">
<ClInclude Include="..\src\pch.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\locale\sl_SI.po">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

226
locale/MSICALib.pot Normal file
View File

@ -0,0 +1,226 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-17 13:30+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.x64.Release.Error-2.idtx:4
msgid "Error opening installation package. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:5
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.x64.Release.Error-2.idtx:5
msgid "Error [2] creating task list. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:6
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.x64.Release.Error-2.idtx:6
msgid "Error [3] writing to \"[2]\" task list file. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:7
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.x64.Release.Error-2.idtx:7
msgid "Error [3] reading from \"[2]\" task list file. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:8
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.x64.Release.Error-2.idtx:8
msgid "Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:9
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.x64.Release.Error-2.idtx:9
msgid "Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:10
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.x64.Release.Error-2.idtx:10
msgid "Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:11
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.x64.Release.Error-2.idtx:11
msgid "Error [3] creating \"[2]\" scheduled task. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:12
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.x64.Release.Error-2.idtx:12
msgid "Error [3] deleting \"[2]\" scheduled task. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:13
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.x64.Release.Error-2.idtx:13
msgid "Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:14
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.x64.Release.Error-2.idtx:14
msgid "Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:15
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.x64.Release.Error-2.idtx:15
msgid "Error [3] installing certificate to certificate store \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:16
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.x64.Release.Error-2.idtx:16
msgid "Error [3] removing certificate from certificate store \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:17
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.x64.Release.Error-2.idtx:17
msgid "Error [3] changing service \"[2]\" start type. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:18
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.x64.Release.Error-2.idtx:18
msgid "Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:19
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.x64.Release.Error-2.idtx:19
msgid "Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:20
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.x64.Release.Error-2.idtx:20
msgid "Error installing WLAN profiles, because WLAN is not installed. Please, install Wireless LAN Service Windows feature, or contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:21
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.x64.Release.Error-2.idtx:21
msgid "Error opening WLAN handle, because WLAN AutoConfig service is not started. Please, enable and start WLAN AutoConfig service, or contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:22
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:23
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.x64.Release.Error-2.idtx:23
msgid "WLAN profile \"[2]\" XML data is not UTF-16 encoded. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:24
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.x64.Release.Error-2.idtx:24
msgid "Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:25
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.x64.Release.Error-2.idtx:25
msgid "Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.ARM64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.ARM64.Release.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:26
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.x64.Release.Error-2.idtx:26
msgid "Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is [4]). Please, contact your support personnel."
msgstr ""

218
locale/de_DE.po Normal file
View File

@ -0,0 +1,218 @@
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-19 08:58+0200\n"
"PO-Revision-Date: \n"
"Language-Team: German (Germany) (https://www.transifex.com/amebis/teams/91600/de_DE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de_DE\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.x64.Release.Error-2.idtx:4
msgid ""
"Error opening installation package. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:5
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.x64.Release.Error-2.idtx:5
msgid "Error [2] creating task list. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:6
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.x64.Release.Error-2.idtx:6
msgid ""
"Error [3] writing to \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:7
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.x64.Release.Error-2.idtx:7
msgid ""
"Error [3] reading from \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:8
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.x64.Release.Error-2.idtx:8
msgid ""
"Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:9
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.x64.Release.Error-2.idtx:9
msgid "Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:10
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.x64.Release.Error-2.idtx:10
msgid ""
"Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:11
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.x64.Release.Error-2.idtx:11
msgid ""
"Error [3] creating \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:12
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.x64.Release.Error-2.idtx:12
msgid ""
"Error [3] deleting \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:13
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.x64.Release.Error-2.idtx:13
msgid ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:14
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.x64.Release.Error-2.idtx:14
msgid ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:15
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.x64.Release.Error-2.idtx:15
msgid ""
"Error [3] installing certificate to certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:16
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.x64.Release.Error-2.idtx:16
msgid ""
"Error [3] removing certificate from certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:17
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.x64.Release.Error-2.idtx:17
msgid ""
"Error [3] changing service \"[2]\" start type. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:18
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.x64.Release.Error-2.idtx:18
msgid ""
"Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:19
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.x64.Release.Error-2.idtx:19
msgid ""
"Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:20
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.x64.Release.Error-2.idtx:20
msgid ""
"Error installing WLAN profiles, because WLAN is not installed. Please, "
"install Wireless LAN Service Windows feature, or contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:21
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.x64.Release.Error-2.idtx:21
msgid ""
"Error opening WLAN handle, because WLAN AutoConfig service is not started. "
"Please, enable and start WLAN AutoConfig service, or contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:22
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:23
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.x64.Release.Error-2.idtx:23
msgid ""
"WLAN profile \"[2]\" XML data is not UTF-16 encoded. Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:24
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.x64.Release.Error-2.idtx:24
msgid ""
"Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact "
"your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:25
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.x64.Release.Error-2.idtx:25
msgid ""
"Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please,"
" contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:26
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.x64.Release.Error-2.idtx:26
msgid ""
"Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is "
"[4]). Please, contact your support personnel."
msgstr ""

270
locale/it_IT.po Normal file
View File

@ -0,0 +1,270 @@
# Translators:
# Denis Renzi <itis05@virgilio.it>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-19 08:58+0200\n"
"PO-Revision-Date: 2018-09-19 09:02+0000\n"
"Last-Translator: Denis Renzi <itis05@virgilio.it>, 2020\n"
"Language-Team: Italian (Italy) (https://www.transifex.com/amebis/teams/91600/it_IT/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it_IT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.x64.Release.Error-2.idtx:4
msgid ""
"Error opening installation package. Please, contact your support personnel."
msgstr ""
"Errore durante l'apertura del pacchetto di installazione. Si prega di "
"contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:5
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.x64.Release.Error-2.idtx:5
msgid "Error [2] creating task list. Please, contact your support personnel."
msgstr ""
"Errore [2] durante la creazione dell'elenco attività. Si prega di contattare"
" il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:6
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.x64.Release.Error-2.idtx:6
msgid ""
"Error [3] writing to \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
"Errore [3] durante la scrittura nel file dell'elenco attività \"[2]\". Si "
"prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:7
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.x64.Release.Error-2.idtx:7
msgid ""
"Error [3] reading from \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
"Errore [3] durante la lettura dal file dell'elenco attività \"[2]\". Si "
"prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:8
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.x64.Release.Error-2.idtx:8
msgid ""
"Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
"Errore [3] durante l'impostazione del parametro \"[2]\". Si prega di "
"contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:9
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.x64.Release.Error-2.idtx:9
msgid "Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
"Errore [3] durante l'eliminazione del file \"[2]\". Si prega di contattare "
"il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:10
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.x64.Release.Error-2.idtx:10
msgid ""
"Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support "
"personnel."
msgstr ""
"Errore [4] durante lo spostamento del file \"[2]\" su \"[3]\". Si prega di "
"contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:11
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.x64.Release.Error-2.idtx:11
msgid ""
"Error [3] creating \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Errore [3] durante la creazione dell'attività \"[2]\" pianificata. Si prega "
"di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:12
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.x64.Release.Error-2.idtx:12
msgid ""
"Error [3] deleting \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Errore [3] durante l'eliminazione dell'attività pianificata \"[2]\". Si "
"prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:13
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.x64.Release.Error-2.idtx:13
msgid ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your "
"support personnel."
msgstr ""
"Errore [3] abilitazione / disabilitazione dell'attività pianificata \"[2]\"."
" Si prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:14
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.x64.Release.Error-2.idtx:14
msgid ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your "
"support personnel."
msgstr ""
"Errore [4] durante la copia dell'attività pianificata \"[2]\" su \"[3]\". Si"
" prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:15
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.x64.Release.Error-2.idtx:15
msgid ""
"Error [3] installing certificate to certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Errore [3] durante l'installazione del certificato nell'archivio certificati"
" \"[2]\". Si prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:16
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.x64.Release.Error-2.idtx:16
msgid ""
"Error [3] removing certificate from certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Errore [3] durante la rimozione del certificato dall'archivio certificati "
"\"[2]\". Si prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:17
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.x64.Release.Error-2.idtx:17
msgid ""
"Error [3] changing service \"[2]\" start type. Please, contact your support "
"personnel."
msgstr ""
"Errore [3] durante la modifica del tipo di avvio del servizio \"[2]\". Si "
"prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:18
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.x64.Release.Error-2.idtx:18
msgid ""
"Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
"Errore [3] durante l'avvio del servizio \"[2]\". Si prega di contattare il "
"personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:19
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.x64.Release.Error-2.idtx:19
msgid ""
"Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
"Errore [3] arresto del servizio \"[2]\". Si prega di contattare il personale"
" di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:20
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.x64.Release.Error-2.idtx:20
msgid ""
"Error installing WLAN profiles, because WLAN is not installed. Please, "
"install Wireless LAN Service Windows feature, or contact your support "
"personnel."
msgstr ""
"Errore durante l'installazione dei profili WLAN, poiché la WLAN non è "
"installata. Installa la funzione Windows del servizio LAN wireless o "
"contatta il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:21
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.x64.Release.Error-2.idtx:21
msgid ""
"Error opening WLAN handle, because WLAN AutoConfig service is not started. "
"Please, enable and start WLAN AutoConfig service, or contact your support "
"personnel."
msgstr ""
"Errore durante l'apertura dell'handle WLAN, perché il servizio di "
"configurazione automatica della WLAN non è stato avviato. Abilitare e "
"avviare il servizio di configurazione automatica della WLAN o contattare il "
"personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:22
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
"Errore [2] durante l'apertura dell'handle WLAN. Si prega di contattare il "
"personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:23
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.x64.Release.Error-2.idtx:23
msgid ""
"WLAN profile \"[2]\" XML data is not UTF-16 encoded. Please, contact your "
"support personnel."
msgstr ""
"I dati XML del profilo WLAN \"[2]\" non sono codificati UTF-16. Si prega di "
"contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:24
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.x64.Release.Error-2.idtx:24
msgid ""
"Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact "
"your support personnel."
msgstr ""
"Errore [4] durante l'eliminazione del profilo \"[3]\" sull'interfaccia WLAN "
"[2]. Si prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:25
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.x64.Release.Error-2.idtx:25
msgid ""
"Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please,"
" contact your support personnel."
msgstr ""
"Errore [5] che rinomina il profilo \"[3]\" in \"[4]\" sull'interfaccia WLAN "
"[2]. Si prega di contattare il personale di supporto."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:26
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.x64.Release.Error-2.idtx:26
msgid ""
"Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is "
"[4]). Please, contact your support personnel."
msgstr ""
"Errore [5] impostazione profilo \"[3]\" sull'interfaccia WLAN [2] (motivo "
"WLAN è [4]). Si prega di contattare il personale di supporto."

218
locale/ru_RU.po Normal file
View File

@ -0,0 +1,218 @@
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-19 08:58+0200\n"
"PO-Revision-Date: \n"
"Language-Team: Russian (Russia) (https://www.transifex.com/amebis/teams/91600/ru_RU/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru_RU\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.x64.Release.Error-2.idtx:4
msgid ""
"Error opening installation package. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:5
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.x64.Release.Error-2.idtx:5
msgid "Error [2] creating task list. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:6
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.x64.Release.Error-2.idtx:6
msgid ""
"Error [3] writing to \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:7
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.x64.Release.Error-2.idtx:7
msgid ""
"Error [3] reading from \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:8
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.x64.Release.Error-2.idtx:8
msgid ""
"Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:9
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.x64.Release.Error-2.idtx:9
msgid "Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:10
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.x64.Release.Error-2.idtx:10
msgid ""
"Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:11
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.x64.Release.Error-2.idtx:11
msgid ""
"Error [3] creating \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:12
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.x64.Release.Error-2.idtx:12
msgid ""
"Error [3] deleting \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:13
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.x64.Release.Error-2.idtx:13
msgid ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:14
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.x64.Release.Error-2.idtx:14
msgid ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:15
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.x64.Release.Error-2.idtx:15
msgid ""
"Error [3] installing certificate to certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:16
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.x64.Release.Error-2.idtx:16
msgid ""
"Error [3] removing certificate from certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:17
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.x64.Release.Error-2.idtx:17
msgid ""
"Error [3] changing service \"[2]\" start type. Please, contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:18
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.x64.Release.Error-2.idtx:18
msgid ""
"Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:19
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.x64.Release.Error-2.idtx:19
msgid ""
"Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:20
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.x64.Release.Error-2.idtx:20
msgid ""
"Error installing WLAN profiles, because WLAN is not installed. Please, "
"install Wireless LAN Service Windows feature, or contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:21
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.x64.Release.Error-2.idtx:21
msgid ""
"Error opening WLAN handle, because WLAN AutoConfig service is not started. "
"Please, enable and start WLAN AutoConfig service, or contact your support "
"personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:22
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:23
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.x64.Release.Error-2.idtx:23
msgid ""
"WLAN profile \"[2]\" XML data is not UTF-16 encoded. Please, contact your "
"support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:24
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.x64.Release.Error-2.idtx:24
msgid ""
"Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact "
"your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:25
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.x64.Release.Error-2.idtx:25
msgid ""
"Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please,"
" contact your support personnel."
msgstr ""
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:26
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.x64.Release.Error-2.idtx:26
msgid ""
"Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is "
"[4]). Please, contact your support personnel."
msgstr ""

View File

@ -1,164 +1,47 @@
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-14 17:15+0100\n"
"POT-Creation-Date: 2018-09-19 08:58+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon.rozman@amebis.si>\n"
"Language-Team: Amebis, d. o. o., Kamnik <simon.rozman@amebis.si>\n"
"Language: sl_SI\n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n"
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/amebis/teams/91600/sl_SI/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __\n"
"Language: sl_SI\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 1.8.7\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"X-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
"X-Poedit-SourceCharset: UTF-8\n"
# Windows charset for this language (decimal)
#: MSIBuild/En.Win32.Debug.Error-2.idtx:3
#: MSIBuild/En.Win32.Release.Error-2.idtx:3
#: MSIBuild/En.x64.Debug.Error-2.idtx:3 MSIBuild/En.x64.Release.Error-2.idtx:3
msgid "1252"
msgstr "1250"
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:4
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:4
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:4
#: MSIBuild/en_US.x64.Release.Error-2.idtx:4
msgid ""
"Error opening installation package. Please, contact your support personnel."
msgstr ""
"Pri odpiranju namestitvenega paketa je prišlo do napake. Obrnite se na svojo"
" tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:5
#: MSIBuild/En.Win32.Release.Error-2.idtx:5
#: MSIBuild/En.x64.Debug.Error-2.idtx:5 MSIBuild/En.x64.Release.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:5
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:5
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:5
#: MSIBuild/en_US.x64.Release.Error-2.idtx:5
msgid "Error [2] creating task list. Please, contact your support personnel."
msgstr ""
"Pri pripravi seznama opravil je prišlo do napake [2]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:22
#: MSIBuild/En.Win32.Release.Error-2.idtx:22
#: MSIBuild/En.x64.Debug.Error-2.idtx:22
#: MSIBuild/En.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
"Pri odpiranju ročice WLAN je prišlo do napake [2]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:17
#: MSIBuild/En.Win32.Release.Error-2.idtx:17
#: MSIBuild/En.x64.Debug.Error-2.idtx:17
#: MSIBuild/En.x64.Release.Error-2.idtx:17
msgid ""
"Error [3] changing service \"[2]\" start type. Please, contact your support "
"personnel."
msgstr ""
"Pri nastavljanju servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:11
#: MSIBuild/En.Win32.Release.Error-2.idtx:11
#: MSIBuild/En.x64.Debug.Error-2.idtx:11
#: MSIBuild/En.x64.Release.Error-2.idtx:11
msgid ""
"Error [3] creating \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Pri stvaritvi razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite "
"se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:9
#: MSIBuild/En.Win32.Release.Error-2.idtx:9
#: MSIBuild/En.x64.Debug.Error-2.idtx:9 MSIBuild/En.x64.Release.Error-2.idtx:9
msgid ""
"Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
"Pri brisanju datoteke »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:12
#: MSIBuild/En.Win32.Release.Error-2.idtx:12
#: MSIBuild/En.x64.Debug.Error-2.idtx:12
#: MSIBuild/En.x64.Release.Error-2.idtx:12
msgid ""
"Error [3] deleting \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Pri brisanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite "
"se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:13
#: MSIBuild/En.Win32.Release.Error-2.idtx:13
#: MSIBuild/En.x64.Debug.Error-2.idtx:13
#: MSIBuild/En.x64.Release.Error-2.idtx:13
msgid ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your "
"support personnel."
msgstr ""
"Pri o(ne)mogočanju razporejenega opravila »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:15
#: MSIBuild/En.Win32.Release.Error-2.idtx:15
#: MSIBuild/En.x64.Debug.Error-2.idtx:15
#: MSIBuild/En.x64.Release.Error-2.idtx:15
msgid ""
"Error [3] installing certificate to certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Pri nameščanju digitalnega potrdila v shrambo »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:7
#: MSIBuild/En.Win32.Release.Error-2.idtx:7
#: MSIBuild/En.x64.Debug.Error-2.idtx:7 MSIBuild/En.x64.Release.Error-2.idtx:7
msgid ""
"Error [3] reading from \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
"Pri branju iz datoteke seznama opravil »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:16
#: MSIBuild/En.Win32.Release.Error-2.idtx:16
#: MSIBuild/En.x64.Debug.Error-2.idtx:16
#: MSIBuild/En.x64.Release.Error-2.idtx:16
msgid ""
"Error [3] removing certificate from certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Pri odstranjevanju digitalnega potrdila iz shrambe »[2]« je prišlo do napake "
"[3]. Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:8
#: MSIBuild/En.Win32.Release.Error-2.idtx:8
#: MSIBuild/En.x64.Debug.Error-2.idtx:8 MSIBuild/En.x64.Release.Error-2.idtx:8
msgid ""
"Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
"Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na "
"svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:18
#: MSIBuild/En.Win32.Release.Error-2.idtx:18
#: MSIBuild/En.x64.Debug.Error-2.idtx:18
#: MSIBuild/En.x64.Release.Error-2.idtx:18
msgid ""
"Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
"Pri zagonu servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:19
#: MSIBuild/En.Win32.Release.Error-2.idtx:19
#: MSIBuild/En.x64.Debug.Error-2.idtx:19
#: MSIBuild/En.x64.Release.Error-2.idtx:19
msgid ""
"Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
"Pri zaustavitvi servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:6
#: MSIBuild/En.Win32.Release.Error-2.idtx:6
#: MSIBuild/En.x64.Debug.Error-2.idtx:6 MSIBuild/En.x64.Release.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:6
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:6
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:6
#: MSIBuild/en_US.x64.Release.Error-2.idtx:6
msgid ""
"Error [3] writing to \"[2]\" task list file. Please, contact your support "
"personnel."
@ -166,32 +49,40 @@ msgstr ""
"Pri pisanju v datoteko seznama opravil »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:14
#: MSIBuild/En.Win32.Release.Error-2.idtx:14
#: MSIBuild/En.x64.Debug.Error-2.idtx:14
#: MSIBuild/En.x64.Release.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:7
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:7
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:7
#: MSIBuild/en_US.x64.Release.Error-2.idtx:7
msgid ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your "
"support personnel."
"Error [3] reading from \"[2]\" task list file. Please, contact your support "
"personnel."
msgstr ""
"Pri kopiranju razporejenega opravila »[2]« v »[3]« je prišlo do napake [4]. "
"Pri branju iz datoteke seznama opravil »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:24
#: MSIBuild/En.Win32.Release.Error-2.idtx:24
#: MSIBuild/En.x64.Debug.Error-2.idtx:24
#: MSIBuild/En.x64.Release.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:8
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:8
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:8
#: MSIBuild/en_US.x64.Release.Error-2.idtx:8
msgid ""
"Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact "
"your support personnel."
"Error [3] setting \"[2]\" parameter. Please, contact your support personnel."
msgstr ""
"Pri brisanju profila »[3]« na vmesniku WLAN [2] je prišlo do napake [4]. "
"Obrnite se na svojo tehnično službo."
"Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na "
"svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:10
#: MSIBuild/En.Win32.Release.Error-2.idtx:10
#: MSIBuild/En.x64.Debug.Error-2.idtx:10
#: MSIBuild/En.x64.Release.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:9
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:9
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:9
#: MSIBuild/en_US.x64.Release.Error-2.idtx:9
msgid "Error [3] deleting \"[2]\" file. Please, contact your support personnel."
msgstr ""
"Pri brisanju datoteke »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:10
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:10
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:10
#: MSIBuild/en_US.x64.Release.Error-2.idtx:10
msgid ""
"Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support "
"personnel."
@ -199,32 +90,107 @@ msgstr ""
"Pri premikanju datoteke »[2]« v »[3]« je prišlo do napake [4]. Obrnite se na"
" svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:25
#: MSIBuild/En.Win32.Release.Error-2.idtx:25
#: MSIBuild/En.x64.Debug.Error-2.idtx:25
#: MSIBuild/En.x64.Release.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:11
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:11
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:11
#: MSIBuild/en_US.x64.Release.Error-2.idtx:11
msgid ""
"Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please, "
"Error [3] creating \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Pri stvaritvi razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite "
"se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:12
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:12
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:12
#: MSIBuild/en_US.x64.Release.Error-2.idtx:12
msgid ""
"Error [3] deleting \"[2]\" scheduled task. Please, contact your support "
"personnel."
msgstr ""
"Pri brisanju razporejenega opravila »[2]« je prišlo do napake [3]. Obrnite "
"se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:13
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:13
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:13
#: MSIBuild/en_US.x64.Release.Error-2.idtx:13
msgid ""
"Error [3] enabling/disabling \"[2]\" scheduled task. Please, contact your "
"support personnel."
msgstr ""
"Pri o(ne)mogočanju razporejenega opravila »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:14
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:14
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:14
#: MSIBuild/en_US.x64.Release.Error-2.idtx:14
msgid ""
"Error [4] copying \"[2]\" scheduled task to \"[3]\". Please, contact your "
"support personnel."
msgstr ""
"Pri kopiranju razporejenega opravila »[2]« v »[3]« je prišlo do napake [4]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:15
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:15
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:15
#: MSIBuild/en_US.x64.Release.Error-2.idtx:15
msgid ""
"Error [3] installing certificate to certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Pri preimenovanju profila »[3]« v »[4]« na vmesniku WLAN [2] je prišlo do "
"napake [5]. Obrnite se na svojo tehnično službo."
"Pri nameščanju digitalnega potrdila v shrambo »[2]« je prišlo do napake [3]."
" Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:26
#: MSIBuild/En.Win32.Release.Error-2.idtx:26
#: MSIBuild/En.x64.Debug.Error-2.idtx:26
#: MSIBuild/En.x64.Release.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:16
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:16
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:16
#: MSIBuild/en_US.x64.Release.Error-2.idtx:16
msgid ""
"Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is "
"[4]). Please, contact your support personnel."
"Error [3] removing certificate from certificate store \"[2]\". Please, "
"contact your support personnel."
msgstr ""
"Pri nastavljanju profila »[3]« na vmesniku WLAN [2] je prišlo do napake [5] "
"(vzrok WLAN je [4]). Obrnite se na svojo tehnično službo."
"Pri odstranjevanju digitalnega potrdila iz shrambe »[2]« je prišlo do napake"
" [3]. Obrnite se na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:20
#: MSIBuild/En.Win32.Release.Error-2.idtx:20
#: MSIBuild/En.x64.Debug.Error-2.idtx:20
#: MSIBuild/En.x64.Release.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:17
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:17
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:17
#: MSIBuild/en_US.x64.Release.Error-2.idtx:17
msgid ""
"Error [3] changing service \"[2]\" start type. Please, contact your support "
"personnel."
msgstr ""
"Pri nastavljanju servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:18
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:18
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:18
#: MSIBuild/en_US.x64.Release.Error-2.idtx:18
msgid ""
"Error [3] starting service \"[2]\". Please, contact your support personnel."
msgstr ""
"Pri zagonu servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:19
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:19
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:19
#: MSIBuild/en_US.x64.Release.Error-2.idtx:19
msgid ""
"Error [3] stopping service \"[2]\". Please, contact your support personnel."
msgstr ""
"Pri zaustavitvi servisa »[2]« je prišlo do napake [3]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:20
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:20
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:20
#: MSIBuild/en_US.x64.Release.Error-2.idtx:20
msgid ""
"Error installing WLAN profiles, because WLAN is not installed. Please, "
"install Wireless LAN Service Windows feature, or contact your support "
@ -234,19 +200,10 @@ msgstr ""
"Namestite Windowsov del Wireless LAN Service, ali se obrnite na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:4
#: MSIBuild/En.Win32.Release.Error-2.idtx:4
#: MSIBuild/En.x64.Debug.Error-2.idtx:4 MSIBuild/En.x64.Release.Error-2.idtx:4
msgid ""
"Error opening installation package. Please, contact your support personnel."
msgstr ""
"Pri odpiranju namestitvenega paketa je prišlo do napake. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:21
#: MSIBuild/En.Win32.Release.Error-2.idtx:21
#: MSIBuild/En.x64.Debug.Error-2.idtx:21
#: MSIBuild/En.x64.Release.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:21
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:21
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:21
#: MSIBuild/en_US.x64.Release.Error-2.idtx:21
msgid ""
"Error opening WLAN handle, because WLAN AutoConfig service is not started. "
"Please, enable and start WLAN AutoConfig service, or contact your support "
@ -256,13 +213,55 @@ msgstr ""
"ni zagnana. Omogočite in zaženite storitev WLAN AutoConfig, ali se obrnite "
"na svojo tehnično službo."
#: MSIBuild/En.Win32.Debug.Error-2.idtx:23
#: MSIBuild/En.Win32.Release.Error-2.idtx:23
#: MSIBuild/En.x64.Debug.Error-2.idtx:23
#: MSIBuild/En.x64.Release.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:22
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:22
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:22
#: MSIBuild/en_US.x64.Release.Error-2.idtx:22
msgid "Error [2] opening WLAN handle. Please, contact your support personnel."
msgstr ""
"Pri odpiranju ročice WLAN je prišlo do napake [2]. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:23
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:23
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:23
#: MSIBuild/en_US.x64.Release.Error-2.idtx:23
msgid ""
"WLAN profile \"[2]\" XML data is not UTF-16 encoded. Please, contact your "
"support personnel."
msgstr ""
"Zapis XML profila WLAN »[2]« ni zapisan v UTF-16. Obrnite se na svojo "
"tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:24
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:24
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:24
#: MSIBuild/en_US.x64.Release.Error-2.idtx:24
msgid ""
"Error [4] deleting profile \"[3]\" on WLAN interface [2]. Please, contact "
"your support personnel."
msgstr ""
"Pri brisanju profila »[3]« na vmesniku WLAN [2] je prišlo do napake [4]. "
"Obrnite se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:25
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:25
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:25
#: MSIBuild/en_US.x64.Release.Error-2.idtx:25
msgid ""
"Error [5] renaming profile \"[3]\" to \"[4]\" on WLAN interface [2]. Please,"
" contact your support personnel."
msgstr ""
"Pri preimenovanju profila »[3]« v »[4]« na vmesniku WLAN [2] je prišlo do "
"napake [5]. Obrnite se na svojo tehnično službo."
#: MSIBuild/en_US.Win32.Debug.Error-2.idtx:26
#: MSIBuild/en_US.Win32.Release.Error-2.idtx:26
#: MSIBuild/en_US.x64.Debug.Error-2.idtx:26
#: MSIBuild/en_US.x64.Release.Error-2.idtx:26
msgid ""
"Error [5] setting profile \"[3]\" on WLAN interface [2] (WLAN reason is "
"[4]). Please, contact your support personnel."
msgstr ""
"Pri nastavljanju profila »[3]« na vmesniku WLAN [2] je prišlo do napake [5] "
"(vzrok WLAN je [4]). Obrnite se na svojo tehnično službo."

View File

@ -1,25 +1,12 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
#pragma comment(lib, "msi.lib")
#pragma comment(lib, "shlwapi.lib")
namespace MSICA {
@ -33,6 +20,10 @@ COperation::COperation(int iTicks) :
{
}
COperation::~COperation()
{
}
////////////////////////////////////////////////////////////////////////////
// COpTypeSingleString
@ -89,65 +80,42 @@ HRESULT COpRollbackEnable::Execute(CSession *pSession)
// COpList
////////////////////////////////////////////////////////////////////////////
COpList::COpList(int iTicks) :
COperation(iTicks),
ATL::CAtlList<COperation*>(sizeof(COperation*))
COpList::COpList(int iTicks) : COperation(iTicks)
{
}
void COpList::Free()
DWORD COpList::LoadFromFile(LPCTSTR pszFileName)
{
POSITION pos;
for (pos = GetHeadPosition(); pos;) {
COperation *pOp = GetNext(pos);
COpList *pOpList = dynamic_cast<COpList*>(pOp);
if (pOpList) {
// Recursivelly free sublists.
pOpList->Free();
}
delete pOp;
}
RemoveAll();
}
HRESULT COpList::LoadFromFile(LPCTSTR pszFileName)
{
HRESULT hr;
ATL::CAtlFile fSequence;
hr = fSequence.Create(pszFileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN);
if (FAILED(hr)) return hr;
CStream fSequence(CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL));
if (!fSequence)
return GetLastError();
// Load operation sequence.
return fSequence >> *this;
if (!(fSequence >> *this))
return GetLastError();
return NO_ERROR;
}
HRESULT COpList::SaveToFile(LPCTSTR pszFileName) const
DWORD COpList::SaveToFile(LPCTSTR pszFileName) const
{
HRESULT hr;
ATL::CAtlFile fSequence;
hr = fSequence.Create(pszFileName, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN);
if (FAILED(hr)) return hr;
CStream fSequence(CreateFile(pszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL));
if (!fSequence)
return GetLastError();
// Save execute sequence to file.
hr = fSequence << *this;
fSequence.Close();
DWORD dwResult = (fSequence << *this) ? NO_ERROR : GetLastError();
fSequence.free();
if (FAILED(hr)) ::DeleteFile(pszFileName);
return hr;
if (dwResult != NO_ERROR) ::DeleteFile(pszFileName);
return dwResult;
}
HRESULT COpList::Execute(CSession *pSession)
{
POSITION pos;
HRESULT hr;
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
@ -161,8 +129,8 @@ HRESULT COpList::Execute(CSession *pSession)
::MsiRecordSetInteger(hRecordProg, 1, 2);
::MsiRecordSetInteger(hRecordProg, 3, 0);
for (pos = GetHeadPosition(); pos;) {
COperation *pOp = GetNext(pos);
for (auto op = cbegin(), op_end = cend(); op != op_end; ++op) {
COperation *pOp = op->get();
hr = pOp->Execute(pSession);
if (!pSession->m_bContinueOnError && FAILED(hr)) {
@ -173,7 +141,7 @@ HRESULT COpList::Execute(CSession *pSession)
::MsiRecordSetInteger(hRecordProg, 2, pOp->m_iTicks);
if (::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_PROGRESS, hRecordProg) == IDCANCEL)
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
}
::MsiRecordSetInteger(hRecordProg, 2, m_iTicks);
@ -195,48 +163,41 @@ CSession::CSession() :
}
CSession::~CSession()
{
m_olRollback.Free();
m_olCommit.Free();
}
////////////////////////////////////////////////////////////////////////////
// Helper functions
////////////////////////////////////////////////////////////////////////////
UINT SaveSequence(MSIHANDLE hInstall, LPCTSTR szActionExecute, LPCTSTR szActionCommit, LPCTSTR szActionRollback, const COpList &olExecute)
{
HRESULT hr;
UINT uiResult;
ATL::CAtlString sSequenceFilename;
ATL::CAtlFile fSequence;
DWORD dwResult;
winstd::tstring sSequenceFilename;
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
// Prepare our own sequence script file.
// The InstallCertificates is a deferred custom action, thus all this information will be unavailable to it.
// Therefore save all required info to file now.
{
LPTSTR szBuffer = sSequenceFilename.GetBuffer(MAX_PATH);
::GetTempPath(MAX_PATH, szBuffer);
::GetTempFileName(szBuffer, _T("MSICA"), 0, szBuffer);
sSequenceFilename.ReleaseBuffer();
std::unique_ptr<TCHAR> szBuffer(new TCHAR[MAX_PATH]);
if (!szBuffer) return ERROR_OUTOFMEMORY;
::GetTempPath(MAX_PATH, szBuffer.get());
::GetTempFileName(szBuffer.get(), _T("MSICA"), 0, szBuffer.get());
sSequenceFilename.assign(szBuffer.get(), wcsnlen(szBuffer.get(), MAX_PATH));
}
// Save execute sequence to file.
hr = olExecute.SaveToFile(sSequenceFilename);
if (SUCCEEDED(hr)) {
dwResult = olExecute.SaveToFile(sSequenceFilename.c_str());
if (dwResult == NO_ERROR) {
// Store sequence script file names to properties for deferred custiom actions.
uiResult = ::MsiSetProperty(hInstall, szActionExecute, sSequenceFilename);
uiResult = ::MsiSetProperty(hInstall, szActionExecute, sSequenceFilename.c_str());
if (uiResult == NO_ERROR) {
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename);
ATL::CAtlString sSequenceFilename2;
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename.c_str());
winstd::tstring sSequenceFilename2;
sSequenceFilename2.Format(_T("%.*ls-rb%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionRollback, sSequenceFilename2);
sprintf(sSequenceFilename2, _T("%.*ls-rb%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionRollback, sSequenceFilename2.c_str());
if (uiResult == NO_ERROR) {
sSequenceFilename2.Format(_T("%.*ls-cm%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionCommit, sSequenceFilename2);
sprintf(sSequenceFilename2, _T("%.*ls-cm%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionCommit, sSequenceFilename2.c_str());
if (uiResult != NO_ERROR) {
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_PROPERTY_SET);
::MsiRecordSetString (hRecordProg, 2, szActionCommit );
@ -255,12 +216,12 @@ UINT SaveSequence(MSIHANDLE hInstall, LPCTSTR szActionExecute, LPCTSTR szActionC
::MsiRecordSetInteger(hRecordProg, 3, uiResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
if (uiResult != NO_ERROR) ::DeleteFile(sSequenceFilename);
if (uiResult != NO_ERROR) ::DeleteFile(sSequenceFilename.c_str());
} else {
uiResult = ERROR_INSTALL_SCRIPT_WRITE;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -271,9 +232,10 @@ UINT SaveSequence(MSIHANDLE hInstall, LPCTSTR szActionExecute, LPCTSTR szActionC
UINT ExecuteSequence(MSIHANDLE hInstall)
{
UINT uiResult;
DWORD dwResult;
HRESULT hr;
BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL));
ATL::CAtlString sSequenceFilename;
winstd::com_initializer com_init(NULL);
winstd::tstring sSequenceFilename;
uiResult = ::MsiGetProperty(hInstall, _T("CustomActionData"), sSequenceFilename);
if (uiResult == NO_ERROR) {
@ -281,8 +243,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
BOOL bIsCleanup = ::MsiGetMode(hInstall, MSIRUNMODE_COMMIT) || ::MsiGetMode(hInstall, MSIRUNMODE_ROLLBACK);
// Load operation sequence.
hr = lstOperations.LoadFromFile(sSequenceFilename);
if (SUCCEEDED(hr)) {
dwResult = lstOperations.LoadFromFile(sSequenceFilename.c_str());
if (dwResult == NO_ERROR) {
MSICA::CSession session;
session.m_hInstall = hInstall;
@ -295,43 +257,42 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
if (!bIsCleanup) {
// Save cleanup scripts of delayed action regardless of action's execution status.
// Rollback action MUST be scheduled in InstallExecuteSequence before this action! Otherwise cleanup won't be performed in case this action execution failed.
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename);
ATL::CAtlString sSequenceFilenameCM, sSequenceFilenameRB;
HRESULT hr;
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename.c_str());
winstd::tstring sSequenceFilenameCM, sSequenceFilenameRB;
sSequenceFilenameRB.Format(_T("%.*ls-rb%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
sSequenceFilenameCM.Format(_T("%.*ls-cm%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
sprintf(sSequenceFilenameRB, _T("%.*ls-rb%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
sprintf(sSequenceFilenameCM, _T("%.*ls-cm%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
// After commit, delete rollback file. After rollback, delete commit file.
session.m_olCommit.AddTail(new MSICA::COpFileDelete(
session.m_olCommit.push_back(new MSICA::COpFileDelete(
#ifdef _UNICODE
sSequenceFilenameRB
sSequenceFilenameRB.c_str()
#else
ATL::CAtlStringW(sSequenceFilenameRB)
std::wstring(sSequenceFilenameRB)
#endif
));
session.m_olRollback.AddTail(new MSICA::COpFileDelete(
session.m_olRollback.push_back(new MSICA::COpFileDelete(
#ifdef _UNICODE
sSequenceFilenameCM
sSequenceFilenameCM.c_str()
#else
ATL::CAtlStringW(sSequenceFilenameCM)
std::wstring(sSequenceFilenameCM)
#endif
));
// Save commit file first.
hr = session.m_olCommit.SaveToFile(sSequenceFilenameCM);
if (SUCCEEDED(hr)) {
dwResult = session.m_olCommit.SaveToFile(sSequenceFilenameCM.c_str());
if (dwResult == NO_ERROR) {
// Save rollback file next.
hr = session.m_olRollback.SaveToFile(sSequenceFilenameRB);
if (SUCCEEDED(hr)) {
dwResult = session.m_olRollback.SaveToFile(sSequenceFilenameRB.c_str());
if (dwResult == NO_ERROR) {
uiResult = NO_ERROR;
} else {
// Saving rollback file failed.
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
uiResult = ERROR_INSTALL_SCRIPT_WRITE;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameRB);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameRB.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
} else {
@ -339,8 +300,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
uiResult = ERROR_INSTALL_SCRIPT_WRITE;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameCM);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameCM.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -349,7 +310,7 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
session.m_bContinueOnError = TRUE;
session.m_bRollbackEnabled = FALSE;
session.m_olRollback.Execute(&session);
::DeleteFile(sSequenceFilenameRB);
::DeleteFile(sSequenceFilenameRB.c_str());
}
} else {
// No cleanup after cleanup support.
@ -361,8 +322,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
uiResult = HRESULT_CODE(hr);
}
::DeleteFile(sSequenceFilename);
} else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) && bIsCleanup) {
::DeleteFile(sSequenceFilename.c_str());
} else if (dwResult == ERROR_FILE_NOT_FOUND && bIsCleanup) {
// Sequence file not found and this is rollback/commit action. Either of the following scenarios are possible:
// - The delayed action failed to save the rollback/commit file. The delayed action performed cleanup itself. No further action is required.
// - Somebody removed the rollback/commit file between delayed action and rollback/commit action. No further action is possible.
@ -372,17 +333,14 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
uiResult = ERROR_INSTALL_SCRIPT_READ;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
lstOperations.Free();
} else {
// Couldn't get CustomActionData property. uiResult has the error code.
}
if (bIsCoInitialized) ::CoUninitialize();
return uiResult;
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
#pragma comment(lib, "crypt32.lib")
@ -41,10 +27,9 @@ COpCertStore::COpCertStore(LPCWSTR pszStore, DWORD dwEncodingType, DWORD dwFlags
////////////////////////////////////////////////////////////////////////////
COpCert::COpCert(LPCVOID lpCert, SIZE_T nSize, LPCWSTR pszStore, DWORD dwEncodingType, DWORD dwFlags, int iTicks) :
m_binCert(reinterpret_cast<LPCBYTE>(lpCert), reinterpret_cast<LPCBYTE>(lpCert) + nSize),
COpCertStore(pszStore, dwEncodingType, dwFlags, iTicks)
{
m_binCert.SetCount(nSize);
memcpy(m_binCert.GetData(), lpCert, nSize);
}
@ -63,25 +48,25 @@ HRESULT COpCertInstall::Execute(CSession *pSession)
HCERTSTORE hCertStore;
// Open certificate store.
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue);
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue.c_str());
if (hCertStore) {
// Create certificate context.
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.GetData(), (DWORD)(m_binCert.GetCount()));
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.data(), static_cast<DWORD>(m_binCert.size()));
if (pCertContext) {
PMSIHANDLE hRecordMsg = ::MsiCreateRecord(1);
ATL::CAtlStringW sCertName;
std::wstring sCertName;
// Display our custom message in the progress bar.
::CertGetNameStringW(pCertContext, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, sCertName);
::MsiRecordSetStringW(hRecordMsg, 1, sCertName);
::MsiRecordSetStringW(hRecordMsg, 1, sCertName.c_str());
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
// Add certificate to certificate store.
if (::CertAddCertificateContextToStore(hCertStore, pCertContext, CERT_STORE_ADD_NEW, NULL)) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the certificate.
pSession->m_olRollback.AddHead(new COpCertRemove(m_binCert.GetData(), m_binCert.GetCount(), m_sValue, m_dwEncodingType, m_dwFlags));
pSession->m_olRollback.push_front(new COpCertRemove(m_binCert.data(), m_binCert.size(), m_sValue.c_str(), m_dwEncodingType, m_dwFlags));
}
dwError = NO_ERROR;
} else {
@ -103,10 +88,10 @@ HRESULT COpCertInstall::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_CERT_INSTALL);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}
@ -126,20 +111,20 @@ HRESULT COpCertRemove::Execute(CSession *pSession)
HCERTSTORE hCertStore;
// Open certificate store.
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue);
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue.c_str());
if (hCertStore) {
// Create certificate context.
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.GetData(), (DWORD)(m_binCert.GetCount()));
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.data(), static_cast<DWORD>(m_binCert.size()));
if (pCertContext) {
PMSIHANDLE hRecordMsg = ::MsiCreateRecord(1);
ATL::CAtlStringW sCertName;
std::wstring sCertName;
PCCERT_CONTEXT pCertContextExisting;
// Display our custom message in the progress bar.
::CertGetNameStringW(pCertContext, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, sCertName);
::MsiRecordSetStringW(hRecordMsg, 1, sCertName);
::MsiRecordSetStringW(hRecordMsg, 1, sCertName.c_str());
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
pCertContextExisting = ::CertFindCertificateInStore(hCertStore, m_dwEncodingType, 0, CERT_FIND_EXISTING, pCertContext, NULL);
if (pCertContextExisting) {
@ -147,7 +132,7 @@ HRESULT COpCertRemove::Execute(CSession *pSession)
if (::CertDeleteCertificateFromStore(pCertContextExisting)) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to reinstall the certificate.
pSession->m_olRollback.AddHead(new COpCertInstall(m_binCert.GetData(), m_binCert.GetCount(), m_sValue, m_dwEncodingType, m_dwFlags));
pSession->m_olRollback.push_front(new COpCertInstall(m_binCert.data(), m_binCert.size(), m_sValue.c_str(), m_dwEncodingType, m_dwFlags));
}
dwError = NO_ERROR;
} else {
@ -170,10 +155,10 @@ HRESULT COpCertRemove::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_CERT_REMOVE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
namespace MSICA {
@ -37,24 +23,24 @@ HRESULT COpFileDelete::Execute(CSession *pSession)
DWORD dwError;
if (pSession->m_bRollbackEnabled) {
ATL::CAtlStringW sBackupName;
std::wstring sBackupName;
UINT uiCount = 0;
do {
// Rename the file to make a backup.
sBackupName.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
dwError = ::MoveFileW(m_sValue, sBackupName) ? NO_ERROR : ::GetLastError();
sprintf(sBackupName, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
dwError = ::MoveFileW(m_sValue.c_str(), sBackupName.c_str()) ? NO_ERROR : ::GetLastError();
} while (dwError == ERROR_ALREADY_EXISTS);
if (dwError == NO_ERROR) {
// Order rollback action to restore from backup copy.
pSession->m_olRollback.AddHead(new COpFileMove(sBackupName, m_sValue));
pSession->m_olRollback.push_front(new COpFileMove(sBackupName.c_str(), m_sValue.c_str()));
// Order commit action to delete backup copy.
pSession->m_olCommit.AddTail(new COpFileDelete(sBackupName));
pSession->m_olCommit.push_back(new COpFileDelete(sBackupName.c_str()));
}
} else {
// Delete the file.
dwError = ::DeleteFileW(m_sValue) ? NO_ERROR : ::GetLastError();
dwError = ::DeleteFileW(m_sValue.c_str()) ? NO_ERROR : ::GetLastError();
}
if (dwError == NO_ERROR || dwError == ERROR_FILE_NOT_FOUND)
@ -62,10 +48,10 @@ HRESULT COpFileDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_FILE_DELETE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}
@ -85,22 +71,22 @@ HRESULT COpFileMove::Execute(CSession *pSession)
DWORD dwError;
// Move the file.
dwError = ::MoveFileW(m_sValue1, m_sValue2) ? NO_ERROR : ::GetLastError();
dwError = ::MoveFileW(m_sValue1.c_str(), m_sValue2.c_str()) ? NO_ERROR : ::GetLastError();
if (dwError == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to move it back.
pSession->m_olRollback.AddHead(new COpFileMove(m_sValue2, m_sValue1));
pSession->m_olRollback.push_front(new COpFileMove(m_sValue2.c_str(), m_sValue1.c_str()));
}
return S_OK;
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_FILE_MOVE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2 );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
namespace MSICA {
@ -58,8 +44,8 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
{
LONG lResult;
REGSAM samAdditional = 0;
ATL::CAtlStringW sPartialName;
int iStart = 0;
std::wstring sPartialName;
size_t iStart = 0;
#ifndef _WIN64
if (IsWow64Process()) {
@ -71,24 +57,24 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
for (;;) {
HKEY hKey;
int iStartNext = m_sValue.Find(L'\\', iStart);
if (iStartNext >= 0)
sPartialName.SetString(m_sValue, iStartNext);
size_t iStartNext = m_sValue.find(L'\\', iStart);
if (iStartNext != std::wstring::npos)
sPartialName.assign(m_sValue.c_str(), iStartNext);
else
sPartialName = m_sValue;
// Try to open the key, to see if it exists.
lResult = ::RegOpenKeyExW(m_hKeyRoot, sPartialName, 0, KEY_ENUMERATE_SUB_KEYS | samAdditional, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, sPartialName.c_str(), 0, KEY_ENUMERATE_SUB_KEYS | samAdditional, &hKey);
if (lResult == ERROR_FILE_NOT_FOUND) {
// The key doesn't exist yet. Create it.
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the key. ::RegCreateEx() might create a key but return failure.
pSession->m_olRollback.AddHead(new COpRegKeyDelete(m_hKeyRoot, sPartialName));
pSession->m_olRollback.push_front(new COpRegKeyDelete(m_hKeyRoot, sPartialName.c_str()));
}
// Create the key.
lResult = ::RegCreateKeyExW(m_hKeyRoot, sPartialName, NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_ENUMERATE_SUB_KEYS | samAdditional, NULL, &hKey, NULL);
lResult = ::RegCreateKeyExW(m_hKeyRoot, sPartialName.c_str(), NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_ENUMERATE_SUB_KEYS | samAdditional, NULL, &hKey, NULL);
if (lResult != NO_ERROR) break;
::RegCloseKey(hKey);
} else if (lResult == NO_ERROR) {
@ -97,7 +83,7 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
} else
break;
if (iStartNext < 0) break;
if (iStartNext == std::wstring::npos) break;
iStart = iStartNext + 1;
}
@ -106,11 +92,11 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_CREATE );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
@ -133,7 +119,7 @@ HRESULT COpRegKeyCopy::Execute(CSession *pSession)
// Delete existing destination key first.
// Since deleting registry key is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
// Don't worry, COpRegKeyDelete::Execute() returns S_OK if key doesn't exist.
COpRegKeyDelete opDelete(m_hKeyRoot, m_sValue2);
COpRegKeyDelete opDelete(m_hKeyRoot, m_sValue2.c_str());
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -147,22 +133,22 @@ HRESULT COpRegKeyCopy::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the destination key.
pSession->m_olRollback.AddHead(new COpRegKeyDelete(m_hKeyRoot, m_sValue2));
pSession->m_olRollback.push_front(new COpRegKeyDelete(m_hKeyRoot, m_sValue2.c_str()));
}
// Copy the registry key.
lResult = CopyKeyRecursively(m_hKeyRoot, m_sValue1, m_sValue2, samAdditional);
lResult = CopyKeyRecursively(m_hKeyRoot, m_sValue1.c_str(), m_sValue2.c_str(), samAdditional);
if (lResult == NO_ERROR)
return S_OK;
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_COPY );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 4, m_sValue2 );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue1.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, m_sValue2.c_str() );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
@ -179,29 +165,23 @@ LONG COpRegKeyCopy::CopyKeyRecursively(HKEY hKeyRoot, LPCWSTR pszKeyNameSrc, LPC
{
DWORD dwSecurityDescriptorSize, dwClassLen = MAX_PATH;
SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
LPWSTR pszClass = new WCHAR[dwClassLen];
std::unique_ptr<WCHAR[]> pszClass(new WCHAR[dwClassLen]);
if (!pszClass) return ERROR_OUTOFMEMORY;
// Get source key class length and security descriptor size.
lResult = ::RegQueryInfoKeyW(hKeySrc, pszClass, &dwClassLen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwSecurityDescriptorSize, NULL);
if (lResult != NO_ERROR) {
delete [] pszClass;
return lResult;
}
pszClass[dwClassLen] = 0;
lResult = ::RegQueryInfoKeyW(hKeySrc, pszClass.get(), &dwClassLen, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwSecurityDescriptorSize, NULL);
if (lResult != NO_ERROR) return lResult;
pszClass.get()[dwClassLen] = 0;
// Get source key security descriptor.
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)(new BYTE[dwSecurityDescriptorSize]);
std::unique_ptr<BYTE[]> sd(new BYTE[dwSecurityDescriptorSize]);
if (!sd) return ERROR_OUTOFMEMORY;
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)sd.get();
lResult = ::RegGetKeySecurity(hKeySrc, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor, &dwSecurityDescriptorSize);
if (lResult != NO_ERROR) {
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
delete [] pszClass;
return lResult;
}
if (lResult != NO_ERROR) return lResult;
// Create new destination key of the same class and security.
lResult = ::RegCreateKeyExW(hKeyRoot, pszKeyNameDst, 0, pszClass, REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDst, NULL);
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
delete [] pszClass;
lResult = ::RegCreateKeyExW(hKeyRoot, pszKeyNameDst, 0, pszClass.get(), REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDst, NULL);
if (lResult != NO_ERROR) return lResult;
}
@ -214,57 +194,52 @@ LONG COpRegKeyCopy::CopyKeyRecursively(HKEY hKeySrc, HKEY hKeyDst, REGSAM samAdd
{
LONG lResult;
DWORD dwMaxSubKeyLen, dwMaxValueNameLen, dwMaxClassLen, dwMaxDataSize, dwIndex;
LPWSTR pszName, pszClass;
LPBYTE lpData;
// Query the source key.
lResult = ::RegQueryInfoKeyW(hKeySrc, NULL, NULL, NULL, NULL, &dwMaxSubKeyLen, &dwMaxClassLen, NULL, &dwMaxValueNameLen, &dwMaxDataSize, NULL, NULL);
if (lResult != NO_ERROR) return lResult;
{
// Copy values first.
dwMaxValueNameLen++;
pszName = new WCHAR[dwMaxValueNameLen];
lpData = new BYTE[dwMaxDataSize];
std::unique_ptr<WCHAR[]> pszName(new WCHAR[dwMaxValueNameLen]);
if (!pszName) return ERROR_OUTOFMEMORY;
std::unique_ptr<BYTE[]> lpData(new BYTE[dwMaxDataSize]);
if (!lpData) return ERROR_OUTOFMEMORY;
for (dwIndex = 0; ; dwIndex++) {
DWORD dwNameLen = dwMaxValueNameLen, dwType, dwValueSize = dwMaxDataSize;
// Read value.
lResult = ::RegEnumValueW(hKeySrc, dwIndex, pszName, &dwNameLen, NULL, &dwType, lpData, &dwValueSize);
if (lResult == ERROR_NO_MORE_ITEMS) {
lResult = NO_ERROR;
break;
} else if (lResult != NO_ERROR)
break;
lResult = ::RegEnumValueW(hKeySrc, dwIndex, pszName.get(), &dwNameLen, NULL, &dwType, lpData.get(), &dwValueSize);
if (lResult == ERROR_NO_MORE_ITEMS) break;
else if (lResult != NO_ERROR ) return lResult;
// Save value.
lResult = ::RegSetValueExW(hKeyDst, pszName, 0, dwType, lpData, dwValueSize);
if (lResult != NO_ERROR)
break;
}
delete [] lpData;
delete [] pszName;
lResult = ::RegSetValueExW(hKeyDst, pszName.get(), 0, dwType, lpData.get(), dwValueSize);
if (lResult != NO_ERROR) return lResult;
}
}
{
// Iterate over all subkeys and copy them.
dwMaxSubKeyLen++;
pszName = new WCHAR[dwMaxSubKeyLen];
std::unique_ptr<WCHAR[]> pszName(new WCHAR[dwMaxSubKeyLen]);
if (!pszName) return ERROR_OUTOFMEMORY;
dwMaxClassLen++;
pszClass = new WCHAR[dwMaxClassLen];
std::unique_ptr<WCHAR[]> pszClass(new WCHAR[dwMaxClassLen]);
if (!pszClass) return ERROR_OUTOFMEMORY;
for (dwIndex = 0; ; dwIndex++) {
DWORD dwNameLen = dwMaxSubKeyLen, dwClassLen = dwMaxClassLen;
HKEY hKeySrcSub, hKeyDstSub;
// Read subkey.
lResult = ::RegEnumKeyExW(hKeySrc, dwIndex, pszName, &dwNameLen, NULL, pszClass, &dwClassLen, NULL);
if (lResult == ERROR_NO_MORE_ITEMS) {
lResult = NO_ERROR;
break;
} else if (lResult != NO_ERROR)
break;
lResult = ::RegEnumKeyExW(hKeySrc, dwIndex, pszName.get(), &dwNameLen, NULL, pszClass.get(), &dwClassLen, NULL);
if (lResult == ERROR_NO_MORE_ITEMS) break;
else if (lResult != NO_ERROR ) return lResult;
// Open source subkey.
lResult = ::RegOpenKeyExW(hKeySrc, pszName, 0, READ_CONTROL | KEY_READ | samAdditional, &hKeySrcSub);
if (lResult != NO_ERROR) break;
lResult = ::RegOpenKeyExW(hKeySrc, pszName.get(), 0, READ_CONTROL | KEY_READ | samAdditional, &hKeySrcSub);
if (lResult != NO_ERROR) return lResult;
{
DWORD dwSecurityDescriptorSize;
@ -272,30 +247,27 @@ LONG COpRegKeyCopy::CopyKeyRecursively(HKEY hKeySrc, HKEY hKeyDst, REGSAM samAdd
// Get source subkey security descriptor size.
lResult = ::RegQueryInfoKeyW(hKeySrcSub, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwSecurityDescriptorSize, NULL);
if (lResult != NO_ERROR) break;
if (lResult != NO_ERROR) return lResult;
// Get source subkey security descriptor.
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)(new BYTE[dwSecurityDescriptorSize]);
std::unique_ptr<BYTE[]> sd(new BYTE[dwSecurityDescriptorSize]);
if (!sd) return ERROR_OUTOFMEMORY;
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)sd.get();
lResult = ::RegGetKeySecurity(hKeySrc, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor, &dwSecurityDescriptorSize);
if (lResult != NO_ERROR) {
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
break;
}
if (lResult != NO_ERROR) return lResult;
// Create new destination subkey of the same class and security.
lResult = ::RegCreateKeyExW(hKeyDst, pszName, 0, pszClass, REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDstSub, NULL);
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
if (lResult != NO_ERROR) break;
lResult = ::RegCreateKeyExW(hKeyDst, pszName.get(), 0, pszClass.get(), REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDstSub, NULL);
if (lResult != NO_ERROR) return lResult;
}
// Copy subkey recursively.
lResult = CopyKeyRecursively(hKeySrcSub, hKeyDstSub, samAdditional);
if (lResult != NO_ERROR) break;
if (lResult != NO_ERROR) return lResult;
}
}
delete [] pszClass;
delete [] pszName;
return lResult;
return NO_ERROR;
}
@ -322,50 +294,50 @@ HRESULT COpRegKeyDelete::Execute(CSession *pSession)
#endif
// Probe to see if the key exists.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, DELETE | samAdditional, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, DELETE | samAdditional, &hKey);
if (lResult == NO_ERROR) {
::RegCloseKey(hKey);
if (pSession->m_bRollbackEnabled) {
// Make a backup of the key first.
ATL::CAtlStringW sBackupName;
std::wstring sBackupName;
UINT uiCount = 0;
int iLength = m_sValue.GetLength();
auto iLength = m_sValue.length();
// Trim trailing backslashes.
while (iLength && m_sValue.GetAt(iLength - 1) == L'\\') iLength--;
while (iLength && m_sValue[iLength - 1] == L'\\') iLength--;
for (;;) {
HKEY hKey;
sBackupName.Format(L"%.*ls (orig %u)", iLength, (LPCWSTR)m_sValue, ++uiCount);
lResult = ::RegOpenKeyExW(m_hKeyRoot, sBackupName, 0, KEY_ENUMERATE_SUB_KEYS | samAdditional, &hKey);
HKEY hKeyTest;
sprintf(sBackupName, L"%.*ls (orig %u)", (unsigned int)iLength, m_sValue.c_str(), ++uiCount);
lResult = ::RegOpenKeyExW(m_hKeyRoot, sBackupName.c_str(), 0, KEY_ENUMERATE_SUB_KEYS | samAdditional, &hKeyTest);
if (lResult != NO_ERROR) break;
::RegCloseKey(hKey);
::RegCloseKey(hKeyTest);
}
if (lResult == ERROR_FILE_NOT_FOUND) {
// Since copying registry key is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
COpRegKeyCopy opCopy(m_hKeyRoot, m_sValue, sBackupName);
COpRegKeyCopy opCopy(m_hKeyRoot, m_sValue.c_str(), sBackupName.c_str());
HRESULT hr = opCopy.Execute(pSession);
if (FAILED(hr)) return hr;
// Order rollback action to restore the key from backup copy.
pSession->m_olRollback.AddHead(new COpRegKeyCopy(m_hKeyRoot, sBackupName, m_sValue));
pSession->m_olRollback.push_front(new COpRegKeyCopy(m_hKeyRoot, sBackupName.c_str(), m_sValue.c_str()));
// Order commit action to delete backup copy.
pSession->m_olCommit.AddTail(new COpRegKeyDelete(m_hKeyRoot, sBackupName));
pSession->m_olCommit.push_back(new COpRegKeyDelete(m_hKeyRoot, sBackupName.c_str()));
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_PROBING );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, sBackupName );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, sBackupName.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
// Delete the registry key.
lResult = DeleteKeyRecursively(m_hKeyRoot, m_sValue, samAdditional);
lResult = DeleteKeyRecursively(m_hKeyRoot, m_sValue.c_str(), samAdditional);
}
if (lResult == NO_ERROR || lResult == ERROR_FILE_NOT_FOUND)
@ -373,11 +345,11 @@ HRESULT COpRegKeyDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_DELETE );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
@ -395,20 +367,18 @@ LONG COpRegKeyDelete::DeleteKeyRecursively(HKEY hKeyRoot, LPCWSTR pszKeyName, RE
// Determine the largest subkey name.
lResult = ::RegQueryInfoKeyW(hKey, NULL, NULL, NULL, NULL, &dwMaxSubKeyLen, NULL, NULL, NULL, NULL, NULL, NULL);
if (lResult == NO_ERROR) {
LPWSTR pszSubKeyName;
// Prepare buffer to hold the subkey names (including zero terminator).
dwMaxSubKeyLen++;
pszSubKeyName = new WCHAR[dwMaxSubKeyLen];
std::unique_ptr<WCHAR[]> pszSubKeyName(new WCHAR[dwMaxSubKeyLen]);
if (pszSubKeyName) {
DWORD dwIndex;
// Iterate over all subkeys and delete them. Skip failed.
for (dwIndex = 0; ;) {
DWORD dwNameLen = dwMaxSubKeyLen;
lResult = ::RegEnumKeyExW(hKey, dwIndex, pszSubKeyName, &dwNameLen, NULL, NULL, NULL, NULL);
lResult = ::RegEnumKeyExW(hKey, dwIndex, pszSubKeyName.get(), &dwNameLen, NULL, NULL, NULL, NULL);
if (lResult == NO_ERROR) {
lResult = DeleteKeyRecursively(hKey, pszSubKeyName, samAdditional);
lResult = DeleteKeyRecursively(hKey, pszSubKeyName.get(), samAdditional);
if (lResult != NO_ERROR)
dwIndex++;
} else if (lResult == ERROR_NO_MORE_ITEMS) {
@ -417,8 +387,6 @@ LONG COpRegKeyDelete::DeleteKeyRecursively(HKEY hKeyRoot, LPCWSTR pszKeyName, RE
} else
dwIndex++;
}
delete [] pszSubKeyName;
} else
lResult = ERROR_OUTOFMEMORY;
}
@ -472,7 +440,7 @@ COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR
COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR pszValueName, DWORD dwData, int iTicks) :
m_dwType(REG_DWORD),
m_dwData(dwData),
m_binData(reinterpret_cast<LPCBYTE>(&dwData), reinterpret_cast<LPCBYTE>(&dwData + 1)),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -480,16 +448,15 @@ COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR
COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR pszValueName, LPCVOID lpData, SIZE_T nSize, int iTicks) :
m_dwType(REG_BINARY),
m_binData(reinterpret_cast<LPCBYTE>(lpData), reinterpret_cast<LPCBYTE>(lpData) + nSize),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
m_binData.SetCount(nSize);
memcpy(m_binData.GetData(), lpData, nSize);
}
COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR pszValueName, LPCWSTR pszData, int iTicks) :
m_dwType(REG_SZ),
m_sData(pszData),
m_binData(reinterpret_cast<LPCBYTE>(pszData), reinterpret_cast<LPCBYTE>(pszData + wcslen(pszData) + 1)),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -497,7 +464,7 @@ COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR
COpRegValueCreate::COpRegValueCreate(HKEY hKeyRoot, LPCWSTR pszKeyName, LPCWSTR pszValueName, DWORDLONG qwData, int iTicks) :
m_dwType(REG_QWORD),
m_qwData(qwData),
m_binData(reinterpret_cast<LPCBYTE>(&qwData), reinterpret_cast<LPCBYTE>(&qwData + 1)),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -513,7 +480,7 @@ HRESULT COpRegValueCreate::Execute(CSession *pSession)
// Delete existing value first.
// Since deleting registry value is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
// Don't worry, COpRegValueDelete::Execute() returns S_OK if key doesn't exist.
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue, m_sValueName);
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName.c_str());
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -526,41 +493,15 @@ HRESULT COpRegValueCreate::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the value.
pSession->m_olRollback.AddHead(new COpRegValueDelete(m_hKeyRoot, m_sValue, m_sValueName));
pSession->m_olRollback.push_front(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName.c_str()));
}
// Set the registry value.
switch (m_dwType) {
case REG_SZ:
case REG_EXPAND_SZ:
case REG_LINK:
lResult = ::RegSetValueExW(hKey, m_sValueName, 0, m_dwType, (const BYTE*)(LPCWSTR)m_sData, (m_sData.GetLength() + 1) * sizeof(WCHAR)); break;
break;
case REG_BINARY:
lResult = ::RegSetValueExW(hKey, m_sValueName, 0, m_dwType, m_binData.GetData(), (DWORD)m_binData.GetCount() * sizeof(BYTE)); break;
case REG_DWORD_LITTLE_ENDIAN:
case REG_DWORD_BIG_ENDIAN:
lResult = ::RegSetValueExW(hKey, m_sValueName, 0, m_dwType, (const BYTE*)&m_dwData, sizeof(DWORD)); break;
break;
case REG_MULTI_SZ:
lResult = ::RegSetValueExW(hKey, m_sValueName, 0, m_dwType, (const BYTE*)m_szData.GetData(), (DWORD)m_szData.GetCount() * sizeof(WCHAR)); break;
break;
case REG_QWORD_LITTLE_ENDIAN:
lResult = ::RegSetValueExW(hKey, m_sValueName, 0, m_dwType, (const BYTE*)&m_qwData, sizeof(DWORDLONG)); break;
break;
default:
lResult = ERROR_UNSUPPORTED_TYPE;
}
lResult = ::RegSetValueExW(hKey, m_sValueName.c_str(), 0, m_dwType, m_binData.data(), static_cast<DWORD>(m_binData.size() * sizeof(BYTE)));
::RegCloseKey(hKey);
}
@ -569,12 +510,12 @@ HRESULT COpRegValueCreate::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_SETVALUE );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName.c_str() );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
@ -598,7 +539,7 @@ HRESULT COpRegValueCopy::Execute(CSession *pSession)
// Delete existing destination value first.
// Since deleting registry value is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
// Don't worry, COpRegValueDelete::Execute() returns S_OK if key doesn't exist.
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue, m_sValueName2);
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName2.c_str());
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -611,26 +552,28 @@ HRESULT COpRegValueCopy::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
if (lResult == NO_ERROR) {
DWORD dwType, dwSize;
// Query the source registry value size.
lResult = ::RegQueryValueExW(hKey, m_sValueName1, 0, NULL, NULL, &dwSize);
lResult = ::RegQueryValueExW(hKey, m_sValueName1.c_str(), 0, NULL, NULL, &dwSize);
if (lResult == NO_ERROR) {
LPBYTE lpData = new BYTE[dwSize];
// Read the source registry value.
lResult = ::RegQueryValueExW(hKey, m_sValueName1, 0, &dwType, lpData, &dwSize);
std::unique_ptr<BYTE> lpData(new BYTE[dwSize]);
if (lpData) {
lResult = ::RegQueryValueExW(hKey, m_sValueName1.c_str(), 0, &dwType, lpData.get(), &dwSize);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the destination copy.
pSession->m_olRollback.AddHead(new COpRegValueDelete(m_hKeyRoot, m_sValue, m_sValueName2));
pSession->m_olRollback.push_front(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName2.c_str()));
}
// Store the value to destination.
lResult = ::RegSetValueExW(hKey, m_sValueName2, 0, dwType, lpData, dwSize);
lResult = ::RegSetValueExW(hKey, m_sValueName2.c_str(), 0, dwType, lpData.get(), dwSize);
}
delete [] lpData;
} else
lResult = ERROR_OUTOFMEMORY;
}
::RegCloseKey(hKey);
@ -641,13 +584,13 @@ HRESULT COpRegValueCopy::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(6);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_COPYVALUE );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName1 );
::MsiRecordSetStringW(hRecordProg, 5, m_sValueName2 );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName1.c_str() );
::MsiRecordSetStringW(hRecordProg, 5, m_sValueName2.c_str() );
::MsiRecordSetInteger(hRecordProg, 6, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
@ -675,26 +618,26 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
if (lResult == NO_ERROR) {
DWORD dwType;
// See if the value exists at all.
lResult = ::RegQueryValueExW(hKey, m_sValueName, 0, &dwType, NULL, NULL);
lResult = ::RegQueryValueExW(hKey, m_sValueName.c_str(), 0, &dwType, NULL, NULL);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Make a backup of the value first.
ATL::CAtlStringW sBackupName;
std::wstring sBackupName;
UINT uiCount = 0;
for (;;) {
sBackupName.Format(L"%ls (orig %u)", (LPCWSTR)m_sValueName, ++uiCount);
lResult = ::RegQueryValueExW(hKey, sBackupName, 0, &dwType, NULL, NULL);
sprintf(sBackupName, L"%ls (orig %u)", m_sValueName.c_str(), ++uiCount);
lResult = ::RegQueryValueExW(hKey, sBackupName.c_str(), 0, &dwType, NULL, NULL);
if (lResult != NO_ERROR) break;
}
if (lResult == ERROR_FILE_NOT_FOUND) {
// Since copying registry value is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
COpRegValueCopy opCopy(m_hKeyRoot, m_sValue, m_sValueName, sBackupName);
COpRegValueCopy opCopy(m_hKeyRoot, m_sValue.c_str(), m_sValueName.c_str(), sBackupName.c_str());
HRESULT hr = opCopy.Execute(pSession);
if (FAILED(hr)) {
::RegCloseKey(hKey);
@ -702,25 +645,25 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
}
// Order rollback action to restore the key from backup copy.
pSession->m_olRollback.AddHead(new COpRegValueCopy(m_hKeyRoot, m_sValue, sBackupName, m_sValueName));
pSession->m_olRollback.push_front(new COpRegValueCopy(m_hKeyRoot, m_sValue.c_str(), sBackupName.c_str(), m_sValueName.c_str()));
// Order commit action to delete backup copy.
pSession->m_olCommit.AddTail(new COpRegValueDelete(m_hKeyRoot, m_sValue, sBackupName));
pSession->m_olCommit.push_back(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), sBackupName.c_str()));
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_PROBINGVAL );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 3, sBackupName );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, sBackupName.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
::RegCloseKey(hKey);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}
// Delete the registry value.
lResult = ::RegDeleteValueW(hKey, m_sValueName);
lResult = ::RegDeleteValueW(hKey, m_sValueName.c_str());
}
::RegCloseKey(hKey);
@ -731,12 +674,12 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_DELETEVALUE );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName.c_str() );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(lResult);
return HRESULT_FROM_WIN32(lResult);
}
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
#pragma comment(lib, "advapi32.lib")
@ -46,7 +32,7 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG);
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG);
if (hService) {
QUERY_SERVICE_CONFIG *sc;
DWORD dwSize;
@ -62,7 +48,7 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession)
if (::ChangeServiceConfig(hService, SERVICE_NO_CHANGE, m_dwStartType, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL)) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to revert the service start change.
pSession->m_olRollback.AddHead(new COpSvcSetStart(m_sValue, sc->dwStartType));
pSession->m_olRollback.push_front(new COpSvcSetStart(m_sValue.c_str(), sc->dwStartType));
}
dwError = NO_ERROR;
} else
@ -87,10 +73,10 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_SET_START);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}
@ -164,14 +150,14 @@ HRESULT COpSvcStart::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_START | (m_bWait ? SERVICE_QUERY_STATUS : 0));
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_START | (m_bWait ? SERVICE_QUERY_STATUS : 0));
if (hService) {
// Start the service.
if (::StartService(hService, 0, NULL)) {
dwError = m_bWait ? WaitForState(pSession, hService, SERVICE_START_PENDING, SERVICE_RUNNING) : NO_ERROR;
if (dwError == NO_ERROR && pSession->m_bRollbackEnabled) {
// Order rollback action to stop the service.
pSession->m_olRollback.AddHead(new COpSvcStop(m_sValue));
pSession->m_olRollback.push_front(new COpSvcStop(m_sValue.c_str()));
}
} else {
dwError = ::GetLastError();
@ -190,10 +176,10 @@ HRESULT COpSvcStart::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_START);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}
@ -218,7 +204,7 @@ HRESULT COpSvcStop::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_STOP | (m_bWait ? SERVICE_QUERY_STATUS : 0));
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_STOP | (m_bWait ? SERVICE_QUERY_STATUS : 0));
if (hService) {
SERVICE_STATUS ss;
// Stop the service.
@ -226,7 +212,7 @@ HRESULT COpSvcStop::Execute(CSession *pSession)
dwError = m_bWait ? WaitForState(pSession, hService, SERVICE_STOP_PENDING, SERVICE_STOPPED) : NO_ERROR;
if (dwError == NO_ERROR && pSession->m_bRollbackEnabled) {
// Order rollback action to start the service.
pSession->m_olRollback.AddHead(new COpSvcStart(m_sValue));
pSession->m_olRollback.push_front(new COpSvcStart(m_sValue.c_str()));
}
} else {
dwError = ::GetLastError();
@ -245,10 +231,10 @@ HRESULT COpSvcStop::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_STOP);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
#pragma comment(lib, "mstask.lib")
#pragma comment(lib, "taskschd.lib")
@ -40,55 +26,45 @@ COpTaskCreate::COpTaskCreate(LPCWSTR pszTaskName, int iTicks) :
}
COpTaskCreate::~COpTaskCreate()
{
// Clear the password in memory.
int iLength = m_sPassword.GetLength();
::SecureZeroMemory(m_sPassword.GetBuffer(iLength), sizeof(WCHAR) * iLength);
m_sPassword.ReleaseBuffer(0);
}
HRESULT COpTaskCreate::Execute(CSession *pSession)
{
HRESULT hr;
PMSIHANDLE hRecordMsg = ::MsiCreateRecord(1);
CComPtr<ITaskService> pService;
POSITION pos;
winstd::com_obj<ITaskService> pService;
// Display our custom message in the progress bar.
::MsiRecordSetStringW(hRecordMsg, 1, m_sValue);
::MsiRecordSetStringW(hRecordMsg, 1, m_sValue.c_str());
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
{
// Delete existing task first.
// Since task deleting is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
// Don't worry, COpTaskDelete::Execute() returns S_OK if task doesn't exist.
COpTaskDelete opDelete(m_sValue);
COpTaskDelete opDelete(m_sValue.c_str());
hr = opDelete.Execute(pSession);
if (FAILED(hr)) goto finish;
}
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
CComVariant vEmpty;
CComPtr<ITaskDefinition> pTaskDefinition;
CComPtr<ITaskSettings> pTaskSettings;
CComPtr<IPrincipal> pPrincipal;
CComPtr<IActionCollection> pActionCollection;
CComPtr<IAction> pAction;
CComPtr<IIdleSettings> pIdleSettings;
CComPtr<IExecAction> pExecAction;
CComPtr<IRegistrationInfo> pRegististrationInfo;
CComPtr<ITriggerCollection> pTriggerCollection;
CComPtr<ITaskFolder> pTaskFolder;
CComPtr<IRegisteredTask> pTask;
ATL::CAtlStringW str;
winstd::variant vEmpty;
winstd::com_obj<ITaskDefinition> pTaskDefinition;
winstd::com_obj<ITaskSettings> pTaskSettings;
winstd::com_obj<IPrincipal> pPrincipal;
winstd::com_obj<IActionCollection> pActionCollection;
winstd::com_obj<IAction> pAction;
winstd::com_obj<IIdleSettings> pIdleSettings;
winstd::com_obj<IExecAction> pExecAction;
winstd::com_obj<IRegistrationInfo> pRegististrationInfo;
winstd::com_obj<ITriggerCollection> pTriggerCollection;
winstd::com_obj<ITaskFolder> pTaskFolder;
winstd::com_obj<IRegisteredTask> pTask;
std::wstring str;
UINT iTrigger;
TASK_LOGON_TYPE logonType;
CComBSTR bstrContext(L"Author");
winstd::bstr bstrContext(L"Author");
// Connect to local task service.
hr = pService->Connect(vEmpty, vEmpty, vEmpty, vEmpty);
@ -106,7 +82,7 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled && (m_dwFlags & TASK_FLAG_DISABLED) == 0) {
// The task is supposed to be enabled.
// However, we shall enable it at commit to prevent it from accidentally starting in the very installation phase.
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olCommit.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
m_dwFlags |= TASK_FLAG_DISABLED;
}
hr = pTaskSettings->put_Enabled(m_dwFlags & TASK_FLAG_DISABLED ? VARIANT_FALSE : VARIANT_TRUE); if (FAILED(hr)) goto finish;
@ -118,35 +94,28 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
// Add execute action.
hr = pActionCollection->Create(TASK_ACTION_EXEC, &pAction);
if (FAILED(hr)) goto finish;
hr = pAction.QueryInterface(&pExecAction);
hr = pAction.query_interface(&pExecAction);
if (FAILED(hr)) goto finish;
// Configure the action.
hr = pExecAction->put_Path (CComBSTR(m_sApplicationName )); if (FAILED(hr)) goto finish;
hr = pExecAction->put_Arguments (CComBSTR(m_sParameters )); if (FAILED(hr)) goto finish;
hr = pExecAction->put_WorkingDirectory(CComBSTR(m_sWorkingDirectory)); if (FAILED(hr)) goto finish;
hr = pExecAction->put_Path (winstd::bstr(m_sApplicationName )); if (FAILED(hr)) goto finish;
hr = pExecAction->put_Arguments (winstd::bstr(m_sParameters )); if (FAILED(hr)) goto finish;
hr = pExecAction->put_WorkingDirectory(winstd::bstr(m_sWorkingDirectory)); if (FAILED(hr)) goto finish;
// Set task description.
hr = pTaskDefinition->get_RegistrationInfo(&pRegististrationInfo);
if (FAILED(hr)) goto finish;
hr = pRegististrationInfo->put_Author(CComBSTR(m_sAuthor));
if (FAILED(hr)) goto finish;
hr = pRegististrationInfo->put_Description(CComBSTR(m_sComment));
if (FAILED(hr)) goto finish;
hr = pTaskDefinition->get_RegistrationInfo(&pRegististrationInfo); if (FAILED(hr)) goto finish;
hr = pRegististrationInfo->put_Author(winstd::bstr(m_sAuthor)); if (FAILED(hr)) goto finish;
hr = pRegististrationInfo->put_Description(winstd::bstr(m_sComment)); if (FAILED(hr)) goto finish;
// Configure task "flags".
if (m_dwFlags & TASK_FLAG_DELETE_WHEN_DONE) {
hr = pTaskSettings->put_DeleteExpiredTaskAfter(CComBSTR(L"PT24H"));
hr = pTaskSettings->put_DeleteExpiredTaskAfter(winstd::bstr(L"PT24H"));
if (FAILED(hr)) goto finish;
}
hr = pTaskSettings->put_Hidden(m_dwFlags & TASK_FLAG_HIDDEN ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_WakeToRun(m_dwFlags & TASK_FLAG_SYSTEM_REQUIRED ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_DisallowStartIfOnBatteries(m_dwFlags & TASK_FLAG_DONT_START_IF_ON_BATTERIES ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_StopIfGoingOnBatteries(m_dwFlags & TASK_FLAG_KILL_IF_GOING_ON_BATTERIES ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_Hidden(m_dwFlags & TASK_FLAG_HIDDEN ? VARIANT_TRUE : VARIANT_FALSE); if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_WakeToRun(m_dwFlags & TASK_FLAG_SYSTEM_REQUIRED ? VARIANT_TRUE : VARIANT_FALSE); if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_DisallowStartIfOnBatteries(m_dwFlags & TASK_FLAG_DONT_START_IF_ON_BATTERIES ? VARIANT_TRUE : VARIANT_FALSE); if (FAILED(hr)) goto finish;
hr = pTaskSettings->put_StopIfGoingOnBatteries(m_dwFlags & TASK_FLAG_KILL_IF_GOING_ON_BATTERIES ? VARIANT_TRUE : VARIANT_FALSE); if (FAILED(hr)) goto finish;
// Configure task priority.
hr = pTaskSettings->put_Priority(
@ -162,10 +131,10 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
hr = pTaskDefinition->get_Principal(&pPrincipal);
if (FAILED(hr)) goto finish;
if (m_sAccountName.IsEmpty()) {
if (m_sAccountName.empty()) {
logonType = TASK_LOGON_SERVICE_ACCOUNT;
hr = pPrincipal->put_LogonType(logonType); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(CComBSTR(L"S-1-5-18")); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(winstd::bstr(L"S-1-5-18")); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_RunLevel(TASK_RUNLEVEL_HIGHEST); if (FAILED(hr)) goto finish;
} else if (m_dwFlags & TASK_FLAG_RUN_ONLY_IF_LOGGED_ON) {
logonType = TASK_LOGON_INTERACTIVE_TOKEN;
@ -174,26 +143,24 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
} else {
logonType = TASK_LOGON_PASSWORD;
hr = pPrincipal->put_LogonType(logonType); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(CComBSTR(m_sAccountName)); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(winstd::bstr(m_sAccountName)); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_RunLevel(TASK_RUNLEVEL_HIGHEST); if (FAILED(hr)) goto finish;
}
// Connect principal and action collection.
hr = pPrincipal->put_Id(bstrContext);
if (FAILED(hr)) goto finish;
hr = pActionCollection->put_Context(bstrContext);
if (FAILED(hr)) goto finish;
hr = pPrincipal->put_Id(bstrContext); if (FAILED(hr)) goto finish;
hr = pActionCollection->put_Context(bstrContext); if (FAILED(hr)) goto finish;
// Configure idle settings.
hr = pTaskSettings->put_RunOnlyIfIdle(m_dwFlags & TASK_FLAG_START_ONLY_IF_IDLE ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
hr = pTaskSettings->get_IdleSettings(&pIdleSettings);
if (FAILED(hr)) goto finish;
str.Format(L"PT%uS", m_wIdleMinutes*60);
hr = pIdleSettings->put_IdleDuration(CComBSTR(str));
sprintf(str, L"PT%uS", m_wIdleMinutes*60);
hr = pIdleSettings->put_IdleDuration(winstd::bstr(str));
if (FAILED(hr)) goto finish;
str.Format(L"PT%uS", m_wDeadlineMinutes*60);
hr = pIdleSettings->put_WaitTimeout(CComBSTR(str));
sprintf(str, L"PT%uS", m_wDeadlineMinutes*60);
hr = pIdleSettings->put_WaitTimeout(winstd::bstr(str));
if (FAILED(hr)) goto finish;
hr = pIdleSettings->put_RestartOnIdle(m_dwFlags & TASK_FLAG_RESTART_ON_IDLE_RESUME ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
@ -201,8 +168,8 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Configure task runtime limit.
str.Format(L"PT%uS", m_dwMaxRuntimeMS != INFINITE ? (m_dwMaxRuntimeMS + 500) / 1000 : 0);
hr = pTaskSettings->put_ExecutionTimeLimit(CComBSTR(str));
sprintf(str, L"PT%uS", m_dwMaxRuntimeMS != INFINITE ? (m_dwMaxRuntimeMS + 500) / 1000 : 0);
hr = pTaskSettings->put_ExecutionTimeLimit(winstd::bstr(str));
if (FAILED(hr)) goto finish;
// Get task trigger colection.
@ -210,56 +177,57 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Add triggers.
for (pos = m_lTriggers.GetHeadPosition(), iTrigger = 0; pos; iTrigger++) {
CComPtr<ITrigger> pTrigger;
TASK_TRIGGER &ttData = m_lTriggers.GetNext(pos);
iTrigger = 0;
for (auto t = m_lTriggers.cbegin(), t_end = m_lTriggers.cend(); t != t_end; ++t, iTrigger++) {
winstd::com_obj<ITrigger> pTrigger;
const TASK_TRIGGER &ttData = *t;
switch (ttData.TriggerType) {
case TASK_TIME_TRIGGER_ONCE: {
CComPtr<ITimeTrigger> pTriggerTime;
winstd::com_obj<ITimeTrigger> pTriggerTime;
hr = pTriggerCollection->Create(TASK_TRIGGER_TIME, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerTime); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerTime->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerTime); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerTime->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_DAILY: {
CComPtr<IDailyTrigger> pTriggerDaily;
winstd::com_obj<IDailyTrigger> pTriggerDaily;
hr = pTriggerCollection->Create(TASK_TRIGGER_DAILY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerDaily); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerDaily); if (FAILED(hr)) goto finish;
hr = pTriggerDaily->put_DaysInterval(ttData.Type.Daily.DaysInterval); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerDaily->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerDaily->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_WEEKLY: {
CComPtr<IWeeklyTrigger> pTriggerWeekly;
winstd::com_obj<IWeeklyTrigger> pTriggerWeekly;
hr = pTriggerCollection->Create(TASK_TRIGGER_WEEKLY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerWeekly); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerWeekly); if (FAILED(hr)) goto finish;
hr = pTriggerWeekly->put_WeeksInterval(ttData.Type.Weekly.WeeksInterval); if (FAILED(hr)) goto finish;
hr = pTriggerWeekly->put_DaysOfWeek(ttData.Type.Weekly.rgfDaysOfTheWeek); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerWeekly->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerWeekly->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_MONTHLYDATE: {
CComPtr<IMonthlyTrigger> pTriggerMonthly;
winstd::com_obj<IMonthlyTrigger> pTriggerMonthly;
hr = pTriggerCollection->Create(TASK_TRIGGER_MONTHLY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerMonthly); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerMonthly); if (FAILED(hr)) goto finish;
hr = pTriggerMonthly->put_DaysOfMonth(ttData.Type.MonthlyDate.rgfDays); if (FAILED(hr)) goto finish;
hr = pTriggerMonthly->put_MonthsOfYear(ttData.Type.MonthlyDate.rgfMonths); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthly->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthly->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_MONTHLYDOW: {
CComPtr<IMonthlyDOWTrigger> pTriggerMonthlyDOW;
winstd::com_obj<IMonthlyDOWTrigger> pTriggerMonthlyDOW;
hr = pTriggerCollection->Create(TASK_TRIGGER_MONTHLYDOW, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerMonthlyDOW); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerMonthlyDOW); if (FAILED(hr)) goto finish;
hr = pTriggerMonthlyDOW->put_WeeksOfMonth(
ttData.Type.MonthlyDOW.wWhichWeek == TASK_FIRST_WEEK ? 0x01 :
ttData.Type.MonthlyDOW.wWhichWeek == TASK_SECOND_WEEK ? 0x02 :
@ -268,8 +236,8 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
ttData.Type.MonthlyDOW.wWhichWeek == TASK_LAST_WEEK ? 0x10 : 0x00); if (FAILED(hr)) goto finish;
hr = pTriggerMonthlyDOW->put_DaysOfWeek(ttData.Type.MonthlyDOW.rgfDaysOfTheWeek); if (FAILED(hr)) goto finish;
hr = pTriggerMonthlyDOW->put_MonthsOfYear(ttData.Type.MonthlyDOW.rgfMonths); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthlyDOW->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthlyDOW->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
@ -279,52 +247,52 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
case TASK_EVENT_TRIGGER_AT_SYSTEMSTART: {
CComPtr<IBootTrigger> pTriggerBoot;
winstd::com_obj<IBootTrigger> pTriggerBoot;
hr = pTriggerCollection->Create(TASK_TRIGGER_BOOT, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerBoot); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerBoot->put_Delay(CComBSTR(str)); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerBoot); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerBoot->put_Delay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_EVENT_TRIGGER_AT_LOGON: {
CComPtr<ILogonTrigger> pTriggerLogon;
winstd::com_obj<ILogonTrigger> pTriggerLogon;
hr = pTriggerCollection->Create(TASK_TRIGGER_LOGON, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerLogon); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerLogon->put_Delay(CComBSTR(str)); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerLogon); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerLogon->put_Delay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
break;
}
}
// Set trigger ID.
str.Format(L"%u", iTrigger);
hr = pTrigger->put_Id(CComBSTR(str));
sprintf(str, L"%u", iTrigger);
hr = pTrigger->put_Id(winstd::bstr(str));
if (FAILED(hr)) goto finish;
// Set trigger start date.
str.Format(L"%04u-%02u-%02uT%02u:%02u:00", ttData.wBeginYear, ttData.wBeginMonth, ttData.wBeginDay, ttData.wStartHour, ttData.wStartMinute);
hr = pTrigger->put_StartBoundary(CComBSTR(str));
sprintf(str, L"%04u-%02u-%02uT%02u:%02u:00", ttData.wBeginYear, ttData.wBeginMonth, ttData.wBeginDay, ttData.wStartHour, ttData.wStartMinute);
hr = pTrigger->put_StartBoundary(winstd::bstr(str));
if (FAILED(hr)) goto finish;
if (ttData.rgFlags & TASK_TRIGGER_FLAG_HAS_END_DATE) {
// Set trigger end date.
str.Format(L"%04u-%02u-%02u", ttData.wEndYear, ttData.wEndMonth, ttData.wEndDay);
hr = pTrigger->put_EndBoundary(CComBSTR(str));
sprintf(str, L"%04u-%02u-%02u", ttData.wEndYear, ttData.wEndMonth, ttData.wEndDay);
hr = pTrigger->put_EndBoundary(winstd::bstr(str));
if (FAILED(hr)) goto finish;
}
// Set trigger repetition duration and interval.
if (ttData.MinutesDuration || ttData.MinutesInterval) {
CComPtr<IRepetitionPattern> pRepetitionPattern;
winstd::com_obj<IRepetitionPattern> pRepetitionPattern;
hr = pTrigger->get_Repetition(&pRepetitionPattern);
if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.MinutesDuration);
hr = pRepetitionPattern->put_Duration(CComBSTR(str));
sprintf(str, L"PT%uM", ttData.MinutesDuration);
hr = pRepetitionPattern->put_Duration(winstd::bstr(str));
if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.MinutesInterval);
hr = pRepetitionPattern->put_Interval(CComBSTR(str));
sprintf(str, L"PT%uM", ttData.MinutesInterval);
hr = pRepetitionPattern->put_Interval(winstd::bstr(str));
if (FAILED(hr)) goto finish;
hr = pRepetitionPattern->put_StopAtDurationEnd(ttData.rgFlags & TASK_TRIGGER_FLAG_KILL_AT_DURATION_END ? VARIANT_TRUE : VARIANT_FALSE);
if (FAILED(hr)) goto finish;
@ -336,69 +304,69 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Get the task folder.
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
#ifdef _DEBUG
CComBSTR xml;
winstd::bstr xml;
hr = pTaskDefinition->get_XmlText(&xml);
#endif
// Register the task.
hr = pTaskFolder->RegisterTaskDefinition(
CComBSTR(m_sValue), // path
winstd::bstr(m_sValue), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
logonType != TASK_LOGON_SERVICE_ACCOUNT && !m_sPassword.IsEmpty() ? CComVariant(m_sPassword) : vEmpty, // password
logonType != TASK_LOGON_SERVICE_ACCOUNT && !m_sPassword.empty() ? winstd::variant(m_sPassword.c_str()) : vEmpty, // password
logonType, // logonType
vEmpty, // sddl
&pTask); // ppTask
} else {
// Windows XP or older.
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
// Get task scheduler object.
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
if (FAILED(hr)) goto finish;
// Create the new task.
hr = pTaskScheduler->NewWorkItem(m_sValue, CLSID_CTask, IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->NewWorkItem(m_sValue.c_str(), CLSID_CTask, IID_ITask, (IUnknown**)&pTask);
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the task. ITask::NewWorkItem() might made a blank task already.
pSession->m_olRollback.AddHead(new COpTaskDelete(m_sValue));
pSession->m_olRollback.push_front(new COpTaskDelete(m_sValue.c_str()));
}
if (FAILED(hr)) goto finish;
// Set its properties.
hr = pTask->SetApplicationName (m_sApplicationName ); if (FAILED(hr)) goto finish;
hr = pTask->SetParameters (m_sParameters ); if (FAILED(hr)) goto finish;
hr = pTask->SetWorkingDirectory(m_sWorkingDirectory); if (FAILED(hr)) goto finish;
hr = pTask->SetComment (m_sComment ); if (FAILED(hr)) goto finish;
hr = pTask->SetApplicationName (m_sApplicationName.c_str() ); if (FAILED(hr)) goto finish;
hr = pTask->SetParameters (m_sParameters.c_str() ); if (FAILED(hr)) goto finish;
hr = pTask->SetWorkingDirectory(m_sWorkingDirectory.c_str()); if (FAILED(hr)) goto finish;
hr = pTask->SetComment (m_sComment.c_str() ); if (FAILED(hr)) goto finish;
if (pSession->m_bRollbackEnabled && (m_dwFlags & TASK_FLAG_DISABLED) == 0) {
// The task is supposed to be enabled.
// However, we shall enable it at commit to prevent it from accidentally starting in the very installation phase.
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olCommit.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
m_dwFlags |= TASK_FLAG_DISABLED;
}
hr = pTask->SetFlags (m_dwFlags ); if (FAILED(hr)) goto finish;
hr = pTask->SetPriority (m_dwPriority ); if (FAILED(hr)) goto finish;
// Set task credentials.
hr = m_sAccountName.IsEmpty() ?
hr = m_sAccountName.empty() ?
pTask->SetAccountInformation(L"" , NULL ) :
pTask->SetAccountInformation(m_sAccountName, m_sPassword);
pTask->SetAccountInformation(m_sAccountName.c_str(), m_sPassword.c_str());
if (FAILED(hr)) goto finish;
hr = pTask->SetIdleWait (m_wIdleMinutes, m_wDeadlineMinutes); if (FAILED(hr)) goto finish;
hr = pTask->SetMaxRunTime(m_dwMaxRuntimeMS ); if (FAILED(hr)) goto finish;
// Add triggers.
for (pos = m_lTriggers.GetHeadPosition(); pos;) {
for (auto t = m_lTriggers.cbegin(), t_end = m_lTriggers.cend(); t != t_end; ++t) {
WORD wTriggerIdx;
CComPtr<ITaskTrigger> pTrigger;
TASK_TRIGGER ttData = m_lTriggers.GetNext(pos); // Don't use reference! We don't want to modify original trigger data by adding random startup delay.
winstd::com_obj<ITaskTrigger> pTrigger;
TASK_TRIGGER ttData = *t; // Don't use reference! We don't want to modify original trigger data by adding random startup delay.
hr = pTask->CreateTrigger(&wTriggerIdx, &pTrigger);
if (FAILED(hr)) goto finish;
@ -426,8 +394,8 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Convert numerical date to DMY (ULONGLONG -> FILETIME -> SYSTEMTIME).
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
ftValue.dwHighDateTime = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
::FileTimeToSystemTime(&ftValue, &stValue);
// Set new trigger date and time.
@ -443,7 +411,7 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Save the task.
CComQIPtr<IPersistFile> pTaskFile(pTask);
winstd::com_obj<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
}
@ -452,7 +420,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_CREATE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -464,7 +432,7 @@ UINT COpTaskCreate::SetFromRecord(MSIHANDLE hInstall, MSIHANDLE hRecord)
{
UINT uiResult;
int iValue;
ATL::CAtlStringW sFolder;
std::wstring sFolder;
uiResult = ::MsiRecordFormatStringW(hInstall, hRecord, 3, m_sApplicationName);
if (uiResult != NO_ERROR) return uiResult;
@ -474,11 +442,11 @@ UINT COpTaskCreate::SetFromRecord(MSIHANDLE hInstall, MSIHANDLE hRecord)
uiResult = ::MsiRecordGetStringW(hRecord, 5, sFolder);
if (uiResult != NO_ERROR) return uiResult;
uiResult = ::MsiGetTargetPathW(hInstall, sFolder, m_sWorkingDirectory);
uiResult = ::MsiGetTargetPathW(hInstall, sFolder.c_str(), m_sWorkingDirectory);
if (uiResult != NO_ERROR) return uiResult;
if (!m_sWorkingDirectory.IsEmpty() && m_sWorkingDirectory.GetAt(m_sWorkingDirectory.GetLength() - 1) == L'\\') {
if (!m_sWorkingDirectory.empty() && m_sWorkingDirectory.back() == L'\\') {
// Trim trailing backslash.
m_sWorkingDirectory.Truncate(m_sWorkingDirectory.GetLength() - 1);
m_sWorkingDirectory.resize(m_sWorkingDirectory.length() - 1);
}
uiResult = ::MsiRecordFormatStringW(hInstall, hRecord, 10, m_sAuthor);
@ -532,8 +500,8 @@ UINT COpTaskCreate::SetTriggersFromView(MSIHANDLE hView)
iValue = ::MsiRecordGetInteger(hRecord, 2);
if (iValue == MSI_NULL_INTEGER) return ERROR_INVALID_FIELD;
ullValue = ((ULONGLONG)iValue + 138426) * 864000000000;
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
ftValue.dwHighDateTime = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
if (!::FileTimeToSystemTime(&ftValue, &stValue))
return ::GetLastError();
ttData.wBeginYear = stValue.wYear;
@ -544,8 +512,8 @@ UINT COpTaskCreate::SetTriggersFromView(MSIHANDLE hView)
iValue = ::MsiRecordGetInteger(hRecord, 3);
if (iValue != MSI_NULL_INTEGER) {
ullValue = ((ULONGLONG)iValue + 138426) * 864000000000;
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
ftValue.dwHighDateTime = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
if (!::FileTimeToSystemTime(&ftValue, &stValue))
return ::GetLastError();
ttData.wEndYear = stValue.wYear;
@ -632,10 +600,8 @@ UINT COpTaskCreate::SetTriggersFromView(MSIHANDLE hView)
break;
}
m_lTriggers.AddTail(ttData);
m_lTriggers.push_back(ttData);
}
return NO_ERROR;
}
@ -652,35 +618,35 @@ COpTaskDelete::COpTaskDelete(LPCWSTR pszTaskName, int iTicks) :
HRESULT COpTaskDelete::Execute(CSession *pSession)
{
HRESULT hr;
CComPtr<ITaskService> pService;
winstd::com_obj<ITaskService> pService;
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
CComVariant vEmpty;
CComPtr<ITaskFolder> pTaskFolder;
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
// Connect to local task service.
hr = pService->Connect(vEmpty, vEmpty, vEmpty, vEmpty);
if (FAILED(hr)) goto finish;
// Get task folder.
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
if (pSession->m_bRollbackEnabled) {
CComPtr<IRegisteredTask> pTask, pTaskOrig;
CComPtr<ITaskDefinition> pTaskDefinition;
CComPtr<IPrincipal> pPrincipal;
winstd::com_obj<IRegisteredTask> pTask, pTaskOrig;
winstd::com_obj<ITaskDefinition> pTaskDefinition;
winstd::com_obj<IPrincipal> pPrincipal;
VARIANT_BOOL bEnabled;
TASK_LOGON_TYPE logonType;
CComBSTR sSSDL;
CComVariant vSSDL;
ATL::CAtlStringW sDisplayNameOrig;
winstd::bstr sSSDL;
winstd::variant vSSDL;
std::wstring sDisplayNameOrig;
UINT uiCount = 0;
// Get the source task.
hr = pTaskFolder->GetTask(CComBSTR(m_sValue), &pTask);
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue), &pTask);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) { hr = S_OK; goto finish; }
else if (FAILED(hr)) goto finish;
@ -691,7 +657,7 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
// The task is enabled.
// In case the task disabling fails halfway, try to re-enable it anyway on rollback.
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olRollback.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
// Disable it.
hr = pTask->put_Enabled(VARIANT_FALSE);
@ -712,18 +678,18 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
// Get task security descriptor.
hr = pTask->GetSecurityDescriptor(DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION | LABEL_SECURITY_INFORMATION, &sSSDL);
if (hr == HRESULT_FROM_WIN32(ERROR_PRIVILEGE_NOT_HELD)) vSSDL.Clear();
if (hr == HRESULT_FROM_WIN32(ERROR_PRIVILEGE_NOT_HELD)) ::VariantClear(&vSSDL);
else if (FAILED(hr)) goto finish;
else {
V_VT (&vSSDL) = VT_BSTR;
V_BSTR(&vSSDL) = sSSDL.Detach();
V_BSTR(&vSSDL) = sSSDL.detach();
}
// Register a backup copy of task.
do {
sDisplayNameOrig.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
sprintf(sDisplayNameOrig, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
hr = pTaskFolder->RegisterTaskDefinition(
CComBSTR(sDisplayNameOrig), // path
winstd::bstr(sDisplayNameOrig), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
@ -733,39 +699,39 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
&pTaskOrig); // ppTask
} while (hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS));
// In case the backup copy creation failed halfway, try to delete its remains anyway on rollback.
pSession->m_olRollback.AddHead(new COpTaskDelete(sDisplayNameOrig));
pSession->m_olRollback.push_front(new COpTaskDelete(sDisplayNameOrig.c_str()));
if (FAILED(hr)) goto finish;
// Order rollback action to restore from backup copy.
pSession->m_olRollback.AddHead(new COpTaskCopy(sDisplayNameOrig, m_sValue));
pSession->m_olRollback.push_front(new COpTaskCopy(sDisplayNameOrig.c_str(), m_sValue.c_str()));
// Delete it.
hr = pTaskFolder->DeleteTask(CComBSTR(m_sValue), 0);
hr = pTaskFolder->DeleteTask(winstd::bstr(m_sValue), 0);
if (FAILED(hr)) goto finish;
// Order commit action to delete backup copy.
pSession->m_olCommit.AddTail(new COpTaskDelete(sDisplayNameOrig));
pSession->m_olCommit.push_back(new COpTaskDelete(sDisplayNameOrig.c_str()));
} else {
// Delete the task.
hr = pTaskFolder->DeleteTask(CComBSTR(m_sValue), 0);
hr = pTaskFolder->DeleteTask(winstd::bstr(m_sValue), 0);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) hr = S_OK;
}
} else {
// Windows XP or older.
CComPtr<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITaskScheduler> pTaskScheduler;
// Get task scheduler object.
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
if (FAILED(hr)) goto finish;
if (pSession->m_bRollbackEnabled) {
CComPtr<ITask> pTask;
winstd::com_obj<ITask> pTask;
DWORD dwFlags;
ATL::CAtlStringW sDisplayNameOrig;
std::wstring sDisplayNameOrig;
UINT uiCount = 0;
// Load the task.
hr = pTaskScheduler->Activate(m_sValue, IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue.c_str(), IID_ITask, (IUnknown**)&pTask);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) { hr = S_OK; goto finish; }
else if (FAILED(hr)) goto finish;
@ -776,7 +742,7 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
// The task is enabled.
// In case the task disabling fails halfway, try to re-enable it anyway on rollback.
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olRollback.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
// Disable it.
dwFlags |= TASK_FLAG_DISABLED;
@ -786,31 +752,31 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
// Prepare a backup copy of task.
do {
sDisplayNameOrig.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
hr = pTaskScheduler->AddWorkItem(sDisplayNameOrig, pTask);
sprintf(sDisplayNameOrig, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
hr = pTaskScheduler->AddWorkItem(sDisplayNameOrig.c_str(), pTask);
} while (hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS));
// In case the backup copy creation failed halfway, try to delete its remains anyway on rollback.
pSession->m_olRollback.AddHead(new COpTaskDelete(sDisplayNameOrig));
pSession->m_olRollback.push_front(new COpTaskDelete(sDisplayNameOrig.c_str()));
if (FAILED(hr)) goto finish;
// Save the backup copy.
CComQIPtr<IPersistFile> pTaskFile(pTask);
winstd::com_obj<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
if (FAILED(hr)) goto finish;
// Order rollback action to restore from backup copy.
pSession->m_olRollback.AddHead(new COpTaskCopy(sDisplayNameOrig, m_sValue));
pSession->m_olRollback.push_front(new COpTaskCopy(sDisplayNameOrig.c_str(), m_sValue.c_str()));
// Delete it.
hr = pTaskScheduler->Delete(m_sValue);
hr = pTaskScheduler->Delete(m_sValue.c_str());
if (FAILED(hr)) goto finish;
// Order commit action to delete backup copy.
pSession->m_olCommit.AddTail(new COpTaskDelete(sDisplayNameOrig));
pSession->m_olCommit.push_back(new COpTaskDelete(sDisplayNameOrig.c_str()));
} else {
// Delete the task.
hr = pTaskScheduler->Delete(m_sValue);
hr = pTaskScheduler->Delete(m_sValue.c_str());
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) hr = S_OK;
}
}
@ -819,7 +785,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_DELETE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -841,14 +807,14 @@ COpTaskEnable::COpTaskEnable(LPCWSTR pszTaskName, BOOL bEnable, int iTicks) :
HRESULT COpTaskEnable::Execute(CSession *pSession)
{
HRESULT hr;
CComPtr<ITaskService> pService;
winstd::com_obj<ITaskService> pService;
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
CComVariant vEmpty;
CComPtr<ITaskFolder> pTaskFolder;
CComPtr<IRegisteredTask> pTask;
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
winstd::com_obj<IRegisteredTask> pTask;
VARIANT_BOOL bEnabled;
// Connect to local task service.
@ -856,11 +822,11 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Get task folder.
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
// Get task.
hr = pTaskFolder->GetTask(CComBSTR(m_sValue), &pTask);
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue), &pTask);
if (FAILED(hr)) goto finish;
// Get currently enabled state.
@ -872,7 +838,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled && !bEnabled) {
// The task is disabled and supposed to be enabled.
// However, we shall enable it at commit to prevent it from accidentally starting in the very installation phase.
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olCommit.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
hr = S_OK; goto finish;
} else
bEnabled = VARIANT_TRUE;
@ -880,7 +846,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled && bEnabled) {
// The task is enabled and we will disable it now.
// Order rollback to re-enable it.
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olRollback.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
}
bEnabled = VARIANT_FALSE;
}
@ -890,16 +856,16 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
} else {
// Windows XP or older.
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
DWORD dwFlags;
// Get task scheduler object.
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
if (FAILED(hr)) goto finish;
// Load the task.
hr = pTaskScheduler->Activate(m_sValue, IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue.c_str(), IID_ITask, (IUnknown**)&pTask);
if (FAILED(hr)) goto finish;
// Get task's current flags.
@ -911,7 +877,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled && (dwFlags & TASK_FLAG_DISABLED)) {
// The task is disabled and supposed to be enabled.
// However, we shall enable it at commit to prevent it from accidentally starting in the very installation phase.
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olCommit.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
hr = S_OK; goto finish;
} else
dwFlags &= ~TASK_FLAG_DISABLED;
@ -919,7 +885,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled && !(dwFlags & TASK_FLAG_DISABLED)) {
// The task is enabled and we will disable it now.
// Order rollback to re-enable it.
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
pSession->m_olRollback.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
}
dwFlags |= TASK_FLAG_DISABLED;
}
@ -929,7 +895,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Save the task.
CComQIPtr<IPersistFile> pTaskFile(pTask);
winstd::com_obj<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
if (FAILED(hr)) goto finish;
@ -939,7 +905,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_ENABLE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -960,29 +926,29 @@ COpTaskCopy::COpTaskCopy(LPCWSTR pszTaskSrc, LPCWSTR pszTaskDst, int iTicks) :
HRESULT COpTaskCopy::Execute(CSession *pSession)
{
HRESULT hr;
CComPtr<ITaskService> pService;
winstd::com_obj<ITaskService> pService;
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
CComVariant vEmpty;
CComPtr<ITaskFolder> pTaskFolder;
CComPtr<IRegisteredTask> pTask, pTaskOrig;
CComPtr<ITaskDefinition> pTaskDefinition;
CComPtr<IPrincipal> pPrincipal;
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
winstd::com_obj<IRegisteredTask> pTask, pTaskOrig;
winstd::com_obj<ITaskDefinition> pTaskDefinition;
winstd::com_obj<IPrincipal> pPrincipal;
TASK_LOGON_TYPE logonType;
CComBSTR sSSDL;
winstd::bstr sSSDL;
// Connect to local task service.
hr = pService->Connect(vEmpty, vEmpty, vEmpty, vEmpty);
if (FAILED(hr)) goto finish;
// Get task folder.
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
// Get the source task.
hr = pTaskFolder->GetTask(CComBSTR(m_sValue1), &pTask);
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue1), &pTask);
if (FAILED(hr)) goto finish;
// Get task's definition.
@ -1003,38 +969,38 @@ HRESULT COpTaskCopy::Execute(CSession *pSession)
// Register a new task.
hr = pTaskFolder->RegisterTaskDefinition(
CComBSTR(m_sValue2), // path
winstd::bstr(m_sValue2), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
vEmpty, // password
logonType, // logonType
CComVariant(sSSDL), // sddl
winstd::variant(sSSDL), // sddl
&pTaskOrig); // ppTask
if (FAILED(hr)) goto finish;
} else {
// Windows XP or older.
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
// Get task scheduler object.
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
if (FAILED(hr)) goto finish;
// Load the source task.
hr = pTaskScheduler->Activate(m_sValue1, IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue1.c_str(), IID_ITask, (IUnknown**)&pTask);
if (FAILED(hr)) goto finish;
// Add with different name.
hr = pTaskScheduler->AddWorkItem(m_sValue2, pTask);
hr = pTaskScheduler->AddWorkItem(m_sValue2.c_str(), pTask);
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the new copy. ITask::AddWorkItem() might made a blank task already.
pSession->m_olRollback.AddHead(new COpTaskDelete(m_sValue2));
pSession->m_olRollback.push_front(new COpTaskDelete(m_sValue2.c_str()));
}
if (FAILED(hr)) goto finish;
// Save the task.
CComQIPtr<IPersistFile> pTaskFile(pTask);
winstd::com_obj<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
if (FAILED(hr)) goto finish;
@ -1044,8 +1010,8 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_COPY);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2 );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}

View File

@ -1,23 +1,9 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "stdafx.h"
#include "pch.h"
namespace MSICA {
@ -55,19 +41,19 @@ HRESULT COpWLANProfileDelete::Execute(CSession *pSession)
DWORD dwFlags = 0, dwGrantedAccess = 0;
// Get profile settings as XML first.
dwError = ::pfnWlanGetProfile(hClientHandle, &m_guidInterface, m_sValue, NULL, &pszProfileXML, &dwFlags, &dwGrantedAccess);
dwError = ::pfnWlanGetProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL, &pszProfileXML, &dwFlags, &dwGrantedAccess);
if (dwError == NO_ERROR) {
// Delete the profile.
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue, NULL);
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL);
if (dwError == NO_ERROR) {
// Order rollback action to recreate it.
pSession->m_olRollback.AddHead(new COpWLANProfileSet(m_guidInterface, dwFlags, m_sValue, pszProfileXML));
pSession->m_olRollback.push_front(new COpWLANProfileSet(m_guidInterface, dwFlags, m_sValue.c_str(), pszProfileXML));
}
::pfnWlanFreeMemory(pszProfileXML);
}
} else {
// Delete the profile.
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue, NULL);
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL);
}
::pfnWlanCloseHandle(hClientHandle, NULL);
}
@ -76,14 +62,12 @@ HRESULT COpWLANProfileDelete::Execute(CSession *pSession)
return S_OK;
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
ATL::CAtlStringW sGUID;
GuidToString(&m_guidInterface, sGUID);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_WLAN_PROFILE_DELETE );
::MsiRecordSetStringW(hRecordProg, 2, sGUID );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 2, winstd::wstring_guid(m_guidInterface).c_str());
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 4, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(1);
@ -117,7 +101,7 @@ HRESULT COpWLANProfileSet::Execute(CSession *pSession)
// Delete existing profile first.
// Since deleting a profile is a complicated job (when rollback/commit support is required), and we do have an operation just for that, we use it.
// Don't worry, COpWLANProfileDelete::Execute() returns S_OK if profile doesn't exist.
COpWLANProfileDelete opDelete(m_guidInterface, m_sValue);
COpWLANProfileDelete opDelete(m_guidInterface, m_sValue.c_str());
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -125,10 +109,10 @@ HRESULT COpWLANProfileSet::Execute(CSession *pSession)
dwError = ::pfnWlanOpenHandle(2, NULL, &dwNegotiatedVersion, &hClientHandle);
if (dwError == NO_ERROR) {
// Set the profile.
dwError = ::pfnWlanSetProfile(hClientHandle, &m_guidInterface, m_dwFlags, m_sProfileXML, NULL, TRUE, NULL, &wlrc);
dwError = ::pfnWlanSetProfile(hClientHandle, &m_guidInterface, m_dwFlags, m_sProfileXML.c_str(), NULL, TRUE, NULL, &wlrc);
if (dwError == NO_ERROR && pSession->m_bRollbackEnabled) {
// Order rollback action to delete it.
pSession->m_olRollback.AddHead(new COpWLANProfileDelete(m_guidInterface, m_sValue));
pSession->m_olRollback.push_front(new COpWLANProfileDelete(m_guidInterface, m_sValue.c_str()));
}
::pfnWlanCloseHandle(hClientHandle, NULL);
}
@ -137,22 +121,20 @@ HRESULT COpWLANProfileSet::Execute(CSession *pSession)
return S_OK;
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
ATL::CAtlStringW sGUID, sReason;
DWORD dwSize = 1024, dwResult;
LPWSTR szBuffer = sReason.GetBuffer(dwSize);
GuidToString(&m_guidInterface, sGUID);
dwResult = ::pfnWlanReasonCodeToString(wlrc, dwSize, szBuffer, NULL);
sReason.ReleaseBuffer(dwSize);
if (dwResult != NO_ERROR) sReason.Format(L"0x%x", wlrc);
std::wstring sReason;
std::unique_ptr<WCHAR[]> szBuffer(new WCHAR[1024]);
if (szBuffer && ::pfnWlanReasonCodeToString(wlrc, 1024, szBuffer.get(), NULL) == NO_ERROR)
sReason.assign(szBuffer.get(), wcsnlen(szBuffer.get(), 1024));
else
sprintf(sReason, L"0x%x", wlrc);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_WLAN_PROFILE_SET);
::MsiRecordSetStringW(hRecordProg, 2, sGUID );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, sReason );
::MsiRecordSetStringW(hRecordProg, 2, winstd::wstring_guid(m_guidInterface).c_str());
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, sReason.c_str() );
::MsiRecordSetInteger(hRecordProg, 5, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return AtlHresultFromWin32(dwError);
return HRESULT_FROM_WIN32(dwError);
}
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(1);

6
src/pch.cpp Normal file
View File

@ -0,0 +1,6 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#include "pch.h"

View File

@ -1,36 +1,19 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
*/
#pragma once
#include <MSICALib.h>
#include <atlex/atlcrypt.h>
#include <atlex/atlwin.h>
#include <atlbase.h>
#include <atlfile.h>
#include <atlstr.h>
#include <WinStd/COM.h>
#include <WinStd/Crypt.h>
#include <msi.h>
#include <msiquery.h>
#include <mstask.h>
#include <shlwapi.h>
#include <taskschd.h>
#include <wlanapi.h>

View File

@ -1,20 +0,0 @@
/*
Copyright 1991-2016 Amebis
This file is part of MSICA.
MSICA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MSICA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MSICA. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"