Compare commits

..

No commits in common. "master" and "ver/1.0" have entirely different histories.

24 changed files with 1880 additions and 2358 deletions

2
.gitignore vendored
View File

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

Binary file not shown.

View File

@ -1,5 +1,9 @@
@echo off
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
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

View File

@ -1,5 +1,9 @@
@echo off
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
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

View File

@ -1,37 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29728.190
MinimumVisualStudioVersion = 10.0.40219.1
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
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

48
build/MSICALib.props Normal file
View File

@ -0,0 +1,48 @@
<?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,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.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>
@ -13,10 +9,6 @@
<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>
@ -28,52 +20,62 @@
</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 Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<UseDebugLibraries>true</UseDebugLibraries>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Release'">
<WholeProgramOptimization>true</WholeProgramOptimization>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Platform)'=='ARM64'">
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<UseOfAtl>Static</UseOfAtl>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\include\$(Platform).props" Condition="exists('..\..\..\include\$(Platform).props')" />
<Import Project="..\..\..\include\$(Configuration).props" Condition="exists('..\..\..\include\$(Configuration).props')" />
<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" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>..\..\..\output\$(Platform).$(Configuration)\</OutDir>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
</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" />
@ -82,14 +84,21 @@
<ClCompile Include="..\src\OpTS.cpp" />
<ClCompile Include="..\src\OpReg.cpp" />
<ClCompile Include="..\src\OpWLAN.cpp" />
<ClCompile Include="..\src\pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
<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>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\MSICALib.h" />
<ClInclude Include="..\src\pch.h" />
<ClInclude Include="..\src\stdafx.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\locale\sl_SI.po" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -9,6 +9,10 @@
<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">
@ -20,7 +24,7 @@
<ClCompile Include="..\src\OpTS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pch.cpp">
<ClCompile Include="..\src\stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\OpReg.cpp">
@ -40,8 +44,13 @@
<ClInclude Include="..\include\MSICALib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\pch.h">
<ClInclude Include="..\src\stdafx.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

View File

@ -1,226 +0,0 @@
#, 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 ""

View File

@ -1,218 +0,0 @@
#
#, 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 ""

View File

@ -1,270 +0,0 @@
# 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."

View File

@ -1,218 +0,0 @@
#
#, 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,165 +1,51 @@
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: MSICALib\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-19 08:58+0200\n"
"POT-Creation-Date: 2016-03-14 17:15+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Simon Rozman <simon@rozman.si>, 2018\n"
"Language-Team: Slovenian (Slovenia) (https://www.transifex.com/amebis/teams/91600/sl_SI/)\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"
"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-Poedit-KeywordsList: __\n"
"X-Poedit-SearchPath-0: MSIBuild\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __\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-SearchPath-0: MSIBuild\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 ""
"Pri odpiranju namestitvenega paketa je prišlo do napake. Obrnite se na svojo"
" tehnično službo."
# 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: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
#: 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
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_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."
#: 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 pisanju v datoteko seznama opravil »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: 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 ""
"Pri branju iz datoteke seznama opravil »[2]« je prišlo do napake [3]. "
"Obrnite se na svojo tehnično službo."
#: 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 ""
"Pri nastavljanju parametra »[2]« je prišlo do napake [3]. Obrnite se na "
"svojo tehnično službo."
#: 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 "
"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: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 ""
"Pri premikanju datoteke »[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: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 ""
"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 nameščanju digitalnega potrdila v shrambo »[2]« je prišlo do napake [3]."
" Obrnite se na svojo tehnično službo."
#: 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 ""
"Pri odstranjevanju digitalnega potrdila iz shrambe »[2]« je prišlo do napake"
" [3]. Obrnite se na svojo tehnično službo."
#: 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
#: 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."
@ -167,30 +53,178 @@ 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
#: 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_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
#: 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_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
#: 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
msgid ""
"Error [3] writing to \"[2]\" task list file. Please, contact your support "
"personnel."
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
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.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
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.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
msgid ""
"Error [4] moving \"[2]\" file to \"[3]\". Please, contact your support "
"personnel."
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
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.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
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."
#: 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
msgid ""
"Error installing WLAN profiles, because WLAN is not installed. Please, "
"install Wireless LAN Service Windows feature, or contact your support "
@ -200,10 +234,19 @@ msgstr ""
"Namestite Windowsov del Wireless LAN Service, ali se obrnite na svojo "
"tehnično službo."
#: 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
#: 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
msgid ""
"Error opening WLAN handle, because WLAN AutoConfig service is not started. "
"Please, enable and start WLAN AutoConfig service, or contact your support "
@ -213,55 +256,13 @@ msgstr ""
"ni zagnana. Omogočite in zaženite storitev WLAN AutoConfig, ali se obrnite "
"na svojo tehnično službo."
#: 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
#: 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
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,12 +1,25 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
#pragma comment(lib, "msi.lib")
#pragma comment(lib, "shlwapi.lib")
namespace MSICA {
@ -20,10 +33,6 @@ COperation::COperation(int iTicks) :
{
}
COperation::~COperation()
{
}
////////////////////////////////////////////////////////////////////////////
// COpTypeSingleString
@ -80,42 +89,65 @@ HRESULT COpRollbackEnable::Execute(CSession *pSession)
// COpList
////////////////////////////////////////////////////////////////////////////
COpList::COpList(int iTicks) : COperation(iTicks)
COpList::COpList(int iTicks) :
COperation(iTicks),
ATL::CAtlList<COperation*>(sizeof(COperation*))
{
}
DWORD COpList::LoadFromFile(LPCTSTR pszFileName)
void COpList::Free()
{
CStream fSequence(CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL));
if (!fSequence)
return GetLastError();
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;
// Load operation sequence.
if (!(fSequence >> *this))
return GetLastError();
return NO_ERROR;
return fSequence >> *this;
}
DWORD COpList::SaveToFile(LPCTSTR pszFileName) const
HRESULT COpList::SaveToFile(LPCTSTR pszFileName) const
{
CStream fSequence(CreateFile(pszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL));
if (!fSequence)
return GetLastError();
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;
// Save execute sequence to file.
DWORD dwResult = (fSequence << *this) ? NO_ERROR : GetLastError();
fSequence.free();
hr = fSequence << *this;
fSequence.Close();
if (dwResult != NO_ERROR) ::DeleteFile(pszFileName);
return dwResult;
if (FAILED(hr)) ::DeleteFile(pszFileName);
return hr;
}
HRESULT COpList::Execute(CSession *pSession)
{
POSITION pos;
HRESULT hr;
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
@ -129,8 +161,8 @@ HRESULT COpList::Execute(CSession *pSession)
::MsiRecordSetInteger(hRecordProg, 1, 2);
::MsiRecordSetInteger(hRecordProg, 3, 0);
for (auto op = cbegin(), op_end = cend(); op != op_end; ++op) {
COperation *pOp = op->get();
for (pos = GetHeadPosition(); pos;) {
COperation *pOp = GetNext(pos);
hr = pOp->Execute(pSession);
if (!pSession->m_bContinueOnError && FAILED(hr)) {
@ -141,7 +173,7 @@ HRESULT COpList::Execute(CSession *pSession)
::MsiRecordSetInteger(hRecordProg, 2, pOp->m_iTicks);
if (::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_PROGRESS, hRecordProg) == IDCANCEL)
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
}
::MsiRecordSetInteger(hRecordProg, 2, m_iTicks);
@ -163,41 +195,48 @@ 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;
DWORD dwResult;
winstd::tstring sSequenceFilename;
ATL::CAtlString sSequenceFilename;
ATL::CAtlFile fSequence;
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.
{
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));
LPTSTR szBuffer = sSequenceFilename.GetBuffer(MAX_PATH);
::GetTempPath(MAX_PATH, szBuffer);
::GetTempFileName(szBuffer, _T("MSICA"), 0, szBuffer);
sSequenceFilename.ReleaseBuffer();
}
// Save execute sequence to file.
dwResult = olExecute.SaveToFile(sSequenceFilename.c_str());
if (dwResult == NO_ERROR) {
hr = olExecute.SaveToFile(sSequenceFilename);
if (SUCCEEDED(hr)) {
// Store sequence script file names to properties for deferred custiom actions.
uiResult = ::MsiSetProperty(hInstall, szActionExecute, sSequenceFilename.c_str());
uiResult = ::MsiSetProperty(hInstall, szActionExecute, sSequenceFilename);
if (uiResult == NO_ERROR) {
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename.c_str());
winstd::tstring sSequenceFilename2;
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename);
ATL::CAtlString sSequenceFilename2;
sprintf(sSequenceFilename2, _T("%.*ls-rb%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionRollback, sSequenceFilename2.c_str());
sSequenceFilename2.Format(_T("%.*ls-rb%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionRollback, sSequenceFilename2);
if (uiResult == NO_ERROR) {
sprintf(sSequenceFilename2, _T("%.*ls-cm%ls"), (unsigned int)(pszExtension - sSequenceFilename.c_str()), sSequenceFilename.c_str(), pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionCommit, sSequenceFilename2.c_str());
sSequenceFilename2.Format(_T("%.*ls-cm%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
uiResult = ::MsiSetProperty(hInstall, szActionCommit, sSequenceFilename2);
if (uiResult != NO_ERROR) {
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_PROPERTY_SET);
::MsiRecordSetString (hRecordProg, 2, szActionCommit );
@ -216,12 +255,12 @@ UINT SaveSequence(MSIHANDLE hInstall, LPCTSTR szActionExecute, LPCTSTR szActionC
::MsiRecordSetInteger(hRecordProg, 3, uiResult );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
if (uiResult != NO_ERROR) ::DeleteFile(sSequenceFilename.c_str());
if (uiResult != NO_ERROR) ::DeleteFile(sSequenceFilename);
} else {
uiResult = ERROR_INSTALL_SCRIPT_WRITE;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -232,10 +271,9 @@ UINT SaveSequence(MSIHANDLE hInstall, LPCTSTR szActionExecute, LPCTSTR szActionC
UINT ExecuteSequence(MSIHANDLE hInstall)
{
UINT uiResult;
DWORD dwResult;
HRESULT hr;
winstd::com_initializer com_init(NULL);
winstd::tstring sSequenceFilename;
BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL));
ATL::CAtlString sSequenceFilename;
uiResult = ::MsiGetProperty(hInstall, _T("CustomActionData"), sSequenceFilename);
if (uiResult == NO_ERROR) {
@ -243,8 +281,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
BOOL bIsCleanup = ::MsiGetMode(hInstall, MSIRUNMODE_COMMIT) || ::MsiGetMode(hInstall, MSIRUNMODE_ROLLBACK);
// Load operation sequence.
dwResult = lstOperations.LoadFromFile(sSequenceFilename.c_str());
if (dwResult == NO_ERROR) {
hr = lstOperations.LoadFromFile(sSequenceFilename);
if (SUCCEEDED(hr)) {
MSICA::CSession session;
session.m_hInstall = hInstall;
@ -257,42 +295,43 @@ 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.c_str());
winstd::tstring sSequenceFilenameCM, sSequenceFilenameRB;
LPCTSTR pszExtension = ::PathFindExtension(sSequenceFilename);
ATL::CAtlString sSequenceFilenameCM, sSequenceFilenameRB;
HRESULT hr;
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);
sSequenceFilenameRB.Format(_T("%.*ls-rb%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
sSequenceFilenameCM.Format(_T("%.*ls-cm%ls"), pszExtension - (LPCTSTR)sSequenceFilename, (LPCTSTR)sSequenceFilename, pszExtension);
// After commit, delete rollback file. After rollback, delete commit file.
session.m_olCommit.push_back(new MSICA::COpFileDelete(
session.m_olCommit.AddTail(new MSICA::COpFileDelete(
#ifdef _UNICODE
sSequenceFilenameRB.c_str()
sSequenceFilenameRB
#else
std::wstring(sSequenceFilenameRB)
ATL::CAtlStringW(sSequenceFilenameRB)
#endif
));
session.m_olRollback.push_back(new MSICA::COpFileDelete(
session.m_olRollback.AddTail(new MSICA::COpFileDelete(
#ifdef _UNICODE
sSequenceFilenameCM.c_str()
sSequenceFilenameCM
#else
std::wstring(sSequenceFilenameCM)
ATL::CAtlStringW(sSequenceFilenameCM)
#endif
));
// Save commit file first.
dwResult = session.m_olCommit.SaveToFile(sSequenceFilenameCM.c_str());
if (dwResult == NO_ERROR) {
hr = session.m_olCommit.SaveToFile(sSequenceFilenameCM);
if (SUCCEEDED(hr)) {
// Save rollback file next.
dwResult = session.m_olRollback.SaveToFile(sSequenceFilenameRB.c_str());
if (dwResult == NO_ERROR) {
hr = session.m_olRollback.SaveToFile(sSequenceFilenameRB);
if (SUCCEEDED(hr)) {
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.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameRB);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
} else {
@ -300,8 +339,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
uiResult = ERROR_INSTALL_SCRIPT_WRITE;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameCM.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilenameCM);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -310,7 +349,7 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
session.m_bContinueOnError = TRUE;
session.m_bRollbackEnabled = FALSE;
session.m_olRollback.Execute(&session);
::DeleteFile(sSequenceFilenameRB.c_str());
::DeleteFile(sSequenceFilenameRB);
}
} else {
// No cleanup after cleanup support.
@ -322,8 +361,8 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
uiResult = HRESULT_CODE(hr);
}
::DeleteFile(sSequenceFilename.c_str());
} else if (dwResult == ERROR_FILE_NOT_FOUND && bIsCleanup) {
::DeleteFile(sSequenceFilename);
} else if (hr == HRESULT_FROM_WIN32(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.
@ -333,14 +372,17 @@ UINT ExecuteSequence(MSIHANDLE hInstall)
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
uiResult = ERROR_INSTALL_SCRIPT_READ;
::MsiRecordSetInteger(hRecordProg, 1, uiResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename.c_str());
::MsiRecordSetInteger(hRecordProg, 3, dwResult );
::MsiRecordSetString (hRecordProg, 2, sSequenceFilename);
::MsiRecordSetInteger(hRecordProg, 3, hr );
::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,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
#pragma comment(lib, "crypt32.lib")
@ -27,9 +41,10 @@ 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);
}
@ -48,25 +63,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.c_str());
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue);
if (hCertStore) {
// Create certificate context.
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.data(), static_cast<DWORD>(m_binCert.size()));
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.GetData(), (DWORD)(m_binCert.GetCount()));
if (pCertContext) {
PMSIHANDLE hRecordMsg = ::MsiCreateRecord(1);
std::wstring sCertName;
ATL::CAtlStringW sCertName;
// Display our custom message in the progress bar.
::CertGetNameStringW(pCertContext, CERT_NAME_FRIENDLY_DISPLAY_TYPE, 0, NULL, sCertName);
::MsiRecordSetStringW(hRecordMsg, 1, sCertName.c_str());
::MsiRecordSetStringW(hRecordMsg, 1, sCertName);
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
return AtlHresultFromWin32(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.push_front(new COpCertRemove(m_binCert.data(), m_binCert.size(), m_sValue.c_str(), m_dwEncodingType, m_dwFlags));
pSession->m_olRollback.AddHead(new COpCertRemove(m_binCert.GetData(), m_binCert.GetCount(), m_sValue, m_dwEncodingType, m_dwFlags));
}
dwError = NO_ERROR;
} else {
@ -88,10 +103,10 @@ HRESULT COpCertInstall::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_CERT_INSTALL);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}
@ -111,20 +126,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.c_str());
hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_W, m_dwEncodingType, NULL, m_dwFlags, m_sValue);
if (hCertStore) {
// Create certificate context.
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.data(), static_cast<DWORD>(m_binCert.size()));
PCCERT_CONTEXT pCertContext = ::CertCreateCertificateContext(m_dwEncodingType, m_binCert.GetData(), (DWORD)(m_binCert.GetCount()));
if (pCertContext) {
PMSIHANDLE hRecordMsg = ::MsiCreateRecord(1);
std::wstring sCertName;
ATL::CAtlStringW 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.c_str());
::MsiRecordSetStringW(hRecordMsg, 1, sCertName);
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
return AtlHresultFromWin32(ERROR_INSTALL_USEREXIT);
pCertContextExisting = ::CertFindCertificateInStore(hCertStore, m_dwEncodingType, 0, CERT_FIND_EXISTING, pCertContext, NULL);
if (pCertContextExisting) {
@ -132,7 +147,7 @@ HRESULT COpCertRemove::Execute(CSession *pSession)
if (::CertDeleteCertificateFromStore(pCertContextExisting)) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to reinstall the certificate.
pSession->m_olRollback.push_front(new COpCertInstall(m_binCert.data(), m_binCert.size(), m_sValue.c_str(), m_dwEncodingType, m_dwFlags));
pSession->m_olRollback.AddHead(new COpCertInstall(m_binCert.GetData(), m_binCert.GetCount(), m_sValue, m_dwEncodingType, m_dwFlags));
}
dwError = NO_ERROR;
} else {
@ -155,10 +170,10 @@ HRESULT COpCertRemove::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_CERT_REMOVE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}

View File

@ -1,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
namespace MSICA {
@ -23,24 +37,24 @@ HRESULT COpFileDelete::Execute(CSession *pSession)
DWORD dwError;
if (pSession->m_bRollbackEnabled) {
std::wstring sBackupName;
ATL::CAtlStringW sBackupName;
UINT uiCount = 0;
do {
// Rename the file to make a backup.
sprintf(sBackupName, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
dwError = ::MoveFileW(m_sValue.c_str(), sBackupName.c_str()) ? NO_ERROR : ::GetLastError();
sBackupName.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
dwError = ::MoveFileW(m_sValue, sBackupName) ? NO_ERROR : ::GetLastError();
} while (dwError == ERROR_ALREADY_EXISTS);
if (dwError == NO_ERROR) {
// Order rollback action to restore from backup copy.
pSession->m_olRollback.push_front(new COpFileMove(sBackupName.c_str(), m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpFileMove(sBackupName, m_sValue));
// Order commit action to delete backup copy.
pSession->m_olCommit.push_back(new COpFileDelete(sBackupName.c_str()));
pSession->m_olCommit.AddTail(new COpFileDelete(sBackupName));
}
} else {
// Delete the file.
dwError = ::DeleteFileW(m_sValue.c_str()) ? NO_ERROR : ::GetLastError();
dwError = ::DeleteFileW(m_sValue) ? NO_ERROR : ::GetLastError();
}
if (dwError == NO_ERROR || dwError == ERROR_FILE_NOT_FOUND)
@ -48,10 +62,10 @@ HRESULT COpFileDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_FILE_DELETE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}
@ -71,22 +85,22 @@ HRESULT COpFileMove::Execute(CSession *pSession)
DWORD dwError;
// Move the file.
dwError = ::MoveFileW(m_sValue1.c_str(), m_sValue2.c_str()) ? NO_ERROR : ::GetLastError();
dwError = ::MoveFileW(m_sValue1, m_sValue2) ? NO_ERROR : ::GetLastError();
if (dwError == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to move it back.
pSession->m_olRollback.push_front(new COpFileMove(m_sValue2.c_str(), m_sValue1.c_str()));
pSession->m_olRollback.AddHead(new COpFileMove(m_sValue2, m_sValue1));
}
return S_OK;
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_FILE_MOVE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2 );
::MsiRecordSetInteger(hRecordProg, 4, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}

View File

@ -1,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
namespace MSICA {
@ -44,8 +58,8 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
{
LONG lResult;
REGSAM samAdditional = 0;
std::wstring sPartialName;
size_t iStart = 0;
ATL::CAtlStringW sPartialName;
int iStart = 0;
#ifndef _WIN64
if (IsWow64Process()) {
@ -57,24 +71,24 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
for (;;) {
HKEY hKey;
size_t iStartNext = m_sValue.find(L'\\', iStart);
if (iStartNext != std::wstring::npos)
sPartialName.assign(m_sValue.c_str(), iStartNext);
int iStartNext = m_sValue.Find(L'\\', iStart);
if (iStartNext >= 0)
sPartialName.SetString(m_sValue, iStartNext);
else
sPartialName = m_sValue;
// Try to open the key, to see if it exists.
lResult = ::RegOpenKeyExW(m_hKeyRoot, sPartialName.c_str(), 0, KEY_ENUMERATE_SUB_KEYS | samAdditional, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, sPartialName, 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.push_front(new COpRegKeyDelete(m_hKeyRoot, sPartialName.c_str()));
pSession->m_olRollback.AddHead(new COpRegKeyDelete(m_hKeyRoot, sPartialName));
}
// Create the key.
lResult = ::RegCreateKeyExW(m_hKeyRoot, sPartialName.c_str(), NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_ENUMERATE_SUB_KEYS | samAdditional, NULL, &hKey, NULL);
lResult = ::RegCreateKeyExW(m_hKeyRoot, sPartialName, 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) {
@ -83,7 +97,7 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
} else
break;
if (iStartNext == std::wstring::npos) break;
if (iStartNext < 0) break;
iStart = iStartNext + 1;
}
@ -92,11 +106,11 @@ HRESULT COpRegKeyCreate::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_CREATE );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
@ -119,7 +133,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.c_str());
COpRegKeyDelete opDelete(m_hKeyRoot, m_sValue2);
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -133,22 +147,22 @@ HRESULT COpRegKeyCopy::Execute(CSession *pSession)
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the destination key.
pSession->m_olRollback.push_front(new COpRegKeyDelete(m_hKeyRoot, m_sValue2.c_str()));
pSession->m_olRollback.AddHead(new COpRegKeyDelete(m_hKeyRoot, m_sValue2));
}
// Copy the registry key.
lResult = CopyKeyRecursively(m_hKeyRoot, m_sValue1.c_str(), m_sValue2.c_str(), samAdditional);
lResult = CopyKeyRecursively(m_hKeyRoot, m_sValue1, m_sValue2, samAdditional);
if (lResult == NO_ERROR)
return S_OK;
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_COPY );
::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, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 4, m_sValue2 );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
@ -165,23 +179,29 @@ LONG COpRegKeyCopy::CopyKeyRecursively(HKEY hKeyRoot, LPCWSTR pszKeyNameSrc, LPC
{
DWORD dwSecurityDescriptorSize, dwClassLen = MAX_PATH;
SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) };
std::unique_ptr<WCHAR[]> pszClass(new WCHAR[dwClassLen]);
if (!pszClass) return ERROR_OUTOFMEMORY;
LPWSTR pszClass = new WCHAR[dwClassLen];
// Get source key class length and security descriptor size.
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;
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;
// Get source key security descriptor.
std::unique_ptr<BYTE[]> sd(new BYTE[dwSecurityDescriptorSize]);
if (!sd) return ERROR_OUTOFMEMORY;
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)sd.get();
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)(new BYTE[dwSecurityDescriptorSize]);
lResult = ::RegGetKeySecurity(hKeySrc, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor, &dwSecurityDescriptorSize);
if (lResult != NO_ERROR) return lResult;
if (lResult != NO_ERROR) {
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
delete [] pszClass;
return lResult;
}
// Create new destination key of the same class and security.
lResult = ::RegCreateKeyExW(hKeyRoot, pszKeyNameDst, 0, pszClass.get(), REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDst, NULL);
lResult = ::RegCreateKeyExW(hKeyRoot, pszKeyNameDst, 0, pszClass, REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDst, NULL);
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
delete [] pszClass;
if (lResult != NO_ERROR) return lResult;
}
@ -194,52 +214,57 @@ 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++;
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;
pszName = new WCHAR[dwMaxValueNameLen];
lpData = new BYTE[dwMaxDataSize];
for (dwIndex = 0; ; dwIndex++) {
DWORD dwNameLen = dwMaxValueNameLen, dwType, dwValueSize = dwMaxDataSize;
// Read value.
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;
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;
// Save value.
lResult = ::RegSetValueExW(hKeyDst, pszName.get(), 0, dwType, lpData.get(), dwValueSize);
lResult = ::RegSetValueExW(hKeyDst, pszName, 0, dwType, lpData, dwValueSize);
if (lResult != NO_ERROR)
break;
}
delete [] lpData;
delete [] pszName;
if (lResult != NO_ERROR) return lResult;
}
}
{
// Iterate over all subkeys and copy them.
dwMaxSubKeyLen++;
std::unique_ptr<WCHAR[]> pszName(new WCHAR[dwMaxSubKeyLen]);
if (!pszName) return ERROR_OUTOFMEMORY;
pszName = new WCHAR[dwMaxSubKeyLen];
dwMaxClassLen++;
std::unique_ptr<WCHAR[]> pszClass(new WCHAR[dwMaxClassLen]);
if (!pszClass) return ERROR_OUTOFMEMORY;
pszClass = new WCHAR[dwMaxClassLen];
for (dwIndex = 0; ; dwIndex++) {
DWORD dwNameLen = dwMaxSubKeyLen, dwClassLen = dwMaxClassLen;
HKEY hKeySrcSub, hKeyDstSub;
// Read subkey.
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;
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;
// Open source subkey.
lResult = ::RegOpenKeyExW(hKeySrc, pszName.get(), 0, READ_CONTROL | KEY_READ | samAdditional, &hKeySrcSub);
if (lResult != NO_ERROR) return lResult;
lResult = ::RegOpenKeyExW(hKeySrc, pszName, 0, READ_CONTROL | KEY_READ | samAdditional, &hKeySrcSub);
if (lResult != NO_ERROR) break;
{
DWORD dwSecurityDescriptorSize;
@ -247,27 +272,30 @@ 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) return lResult;
if (lResult != NO_ERROR) break;
// Get source subkey security descriptor.
std::unique_ptr<BYTE[]> sd(new BYTE[dwSecurityDescriptorSize]);
if (!sd) return ERROR_OUTOFMEMORY;
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)sd.get();
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR)(new BYTE[dwSecurityDescriptorSize]);
lResult = ::RegGetKeySecurity(hKeySrc, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor, &dwSecurityDescriptorSize);
if (lResult != NO_ERROR) return lResult;
if (lResult != NO_ERROR) {
delete [] (LPBYTE)(sa.lpSecurityDescriptor);
break;
}
// Create new destination subkey of the same class and security.
lResult = ::RegCreateKeyExW(hKeyDst, pszName.get(), 0, pszClass.get(), REG_OPTION_NON_VOLATILE, KEY_WRITE | samAdditional, &sa, &hKeyDstSub, NULL);
if (lResult != NO_ERROR) return lResult;
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;
}
// Copy subkey recursively.
lResult = CopyKeyRecursively(hKeySrcSub, hKeyDstSub, samAdditional);
if (lResult != NO_ERROR) return lResult;
}
if (lResult != NO_ERROR) break;
}
delete [] pszClass;
delete [] pszName;
return NO_ERROR;
return lResult;
}
@ -294,50 +322,50 @@ HRESULT COpRegKeyDelete::Execute(CSession *pSession)
#endif
// Probe to see if the key exists.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, DELETE | samAdditional, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, DELETE | samAdditional, &hKey);
if (lResult == NO_ERROR) {
::RegCloseKey(hKey);
if (pSession->m_bRollbackEnabled) {
// Make a backup of the key first.
std::wstring sBackupName;
ATL::CAtlStringW sBackupName;
UINT uiCount = 0;
auto iLength = m_sValue.length();
int iLength = m_sValue.GetLength();
// Trim trailing backslashes.
while (iLength && m_sValue[iLength - 1] == L'\\') iLength--;
while (iLength && m_sValue.GetAt(iLength - 1) == L'\\') iLength--;
for (;;) {
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);
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);
if (lResult != NO_ERROR) break;
::RegCloseKey(hKeyTest);
::RegCloseKey(hKey);
}
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.c_str(), sBackupName.c_str());
COpRegKeyCopy opCopy(m_hKeyRoot, m_sValue, sBackupName);
HRESULT hr = opCopy.Execute(pSession);
if (FAILED(hr)) return hr;
// Order rollback action to restore the key from backup copy.
pSession->m_olRollback.push_front(new COpRegKeyCopy(m_hKeyRoot, sBackupName.c_str(), m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpRegKeyCopy(m_hKeyRoot, sBackupName, m_sValue));
// Order commit action to delete backup copy.
pSession->m_olCommit.push_back(new COpRegKeyDelete(m_hKeyRoot, sBackupName.c_str()));
pSession->m_olCommit.AddTail(new COpRegKeyDelete(m_hKeyRoot, sBackupName));
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_PROBING );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, sBackupName.c_str() );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, sBackupName );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
// Delete the registry key.
lResult = DeleteKeyRecursively(m_hKeyRoot, m_sValue.c_str(), samAdditional);
lResult = DeleteKeyRecursively(m_hKeyRoot, m_sValue, samAdditional);
}
if (lResult == NO_ERROR || lResult == ERROR_FILE_NOT_FOUND)
@ -345,11 +373,11 @@ HRESULT COpRegKeyDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_DELETE );
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
@ -367,18 +395,20 @@ 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++;
std::unique_ptr<WCHAR[]> pszSubKeyName(new WCHAR[dwMaxSubKeyLen]);
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.get(), &dwNameLen, NULL, NULL, NULL, NULL);
lResult = ::RegEnumKeyExW(hKey, dwIndex, pszSubKeyName, &dwNameLen, NULL, NULL, NULL, NULL);
if (lResult == NO_ERROR) {
lResult = DeleteKeyRecursively(hKey, pszSubKeyName.get(), samAdditional);
lResult = DeleteKeyRecursively(hKey, pszSubKeyName, samAdditional);
if (lResult != NO_ERROR)
dwIndex++;
} else if (lResult == ERROR_NO_MORE_ITEMS) {
@ -387,6 +417,8 @@ LONG COpRegKeyDelete::DeleteKeyRecursively(HKEY hKeyRoot, LPCWSTR pszKeyName, RE
} else
dwIndex++;
}
delete [] pszSubKeyName;
} else
lResult = ERROR_OUTOFMEMORY;
}
@ -440,7 +472,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_binData(reinterpret_cast<LPCBYTE>(&dwData), reinterpret_cast<LPCBYTE>(&dwData + 1)),
m_dwData(dwData),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -448,15 +480,16 @@ 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_binData(reinterpret_cast<LPCBYTE>(pszData), reinterpret_cast<LPCBYTE>(pszData + wcslen(pszData) + 1)),
m_sData(pszData),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -464,7 +497,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_binData(reinterpret_cast<LPCBYTE>(&qwData), reinterpret_cast<LPCBYTE>(&qwData + 1)),
m_qwData(qwData),
COpRegValueSingle(hKeyRoot, pszKeyName, pszValueName, iTicks)
{
}
@ -480,7 +513,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.c_str(), m_sValueName.c_str());
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue, m_sValueName);
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -493,15 +526,41 @@ HRESULT COpRegValueCreate::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the value.
pSession->m_olRollback.push_front(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName.c_str()));
pSession->m_olRollback.AddHead(new COpRegValueDelete(m_hKeyRoot, m_sValue, m_sValueName));
}
// Set the registry value.
lResult = ::RegSetValueExW(hKey, m_sValueName.c_str(), 0, m_dwType, m_binData.data(), static_cast<DWORD>(m_binData.size() * sizeof(BYTE)));
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;
}
::RegCloseKey(hKey);
}
@ -510,12 +569,12 @@ HRESULT COpRegValueCreate::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_SETVALUE);
::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, 2, (UINT)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
@ -539,7 +598,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.c_str(), m_sValueName2.c_str());
COpRegValueDelete opDelete(m_hKeyRoot, m_sValue, m_sValueName2);
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -552,28 +611,26 @@ HRESULT COpRegValueCopy::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
if (lResult == NO_ERROR) {
DWORD dwType, dwSize;
// Query the source registry value size.
lResult = ::RegQueryValueExW(hKey, m_sValueName1.c_str(), 0, NULL, NULL, &dwSize);
lResult = ::RegQueryValueExW(hKey, m_sValueName1, 0, NULL, NULL, &dwSize);
if (lResult == NO_ERROR) {
LPBYTE lpData = new BYTE[dwSize];
// Read the source registry value.
std::unique_ptr<BYTE> lpData(new BYTE[dwSize]);
if (lpData) {
lResult = ::RegQueryValueExW(hKey, m_sValueName1.c_str(), 0, &dwType, lpData.get(), &dwSize);
lResult = ::RegQueryValueExW(hKey, m_sValueName1, 0, &dwType, lpData, &dwSize);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the destination copy.
pSession->m_olRollback.push_front(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), m_sValueName2.c_str()));
pSession->m_olRollback.AddHead(new COpRegValueDelete(m_hKeyRoot, m_sValue, m_sValueName2));
}
// Store the value to destination.
lResult = ::RegSetValueExW(hKey, m_sValueName2.c_str(), 0, dwType, lpData.get(), dwSize);
lResult = ::RegSetValueExW(hKey, m_sValueName2, 0, dwType, lpData, dwSize);
}
} else
lResult = ERROR_OUTOFMEMORY;
delete [] lpData;
}
::RegCloseKey(hKey);
@ -584,13 +641,13 @@ HRESULT COpRegValueCopy::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(6);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_COPYVALUE);
::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, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName1 );
::MsiRecordSetStringW(hRecordProg, 5, m_sValueName2 );
::MsiRecordSetInteger(hRecordProg, 6, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
@ -618,26 +675,26 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
#endif
// Open the key.
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue.c_str(), 0, sam, &hKey);
lResult = ::RegOpenKeyExW(m_hKeyRoot, m_sValue, 0, sam, &hKey);
if (lResult == NO_ERROR) {
DWORD dwType;
// See if the value exists at all.
lResult = ::RegQueryValueExW(hKey, m_sValueName.c_str(), 0, &dwType, NULL, NULL);
lResult = ::RegQueryValueExW(hKey, m_sValueName, 0, &dwType, NULL, NULL);
if (lResult == NO_ERROR) {
if (pSession->m_bRollbackEnabled) {
// Make a backup of the value first.
std::wstring sBackupName;
ATL::CAtlStringW sBackupName;
UINT uiCount = 0;
for (;;) {
sprintf(sBackupName, L"%ls (orig %u)", m_sValueName.c_str(), ++uiCount);
lResult = ::RegQueryValueExW(hKey, sBackupName.c_str(), 0, &dwType, NULL, NULL);
sBackupName.Format(L"%ls (orig %u)", (LPCWSTR)m_sValueName, ++uiCount);
lResult = ::RegQueryValueExW(hKey, sBackupName, 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.c_str(), m_sValueName.c_str(), sBackupName.c_str());
COpRegValueCopy opCopy(m_hKeyRoot, m_sValue, m_sValueName, sBackupName);
HRESULT hr = opCopy.Execute(pSession);
if (FAILED(hr)) {
::RegCloseKey(hKey);
@ -645,25 +702,25 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
}
// Order rollback action to restore the key from backup copy.
pSession->m_olRollback.push_front(new COpRegValueCopy(m_hKeyRoot, m_sValue.c_str(), sBackupName.c_str(), m_sValueName.c_str()));
pSession->m_olRollback.AddHead(new COpRegValueCopy(m_hKeyRoot, m_sValue, sBackupName, m_sValueName));
// Order commit action to delete backup copy.
pSession->m_olCommit.push_back(new COpRegValueDelete(m_hKeyRoot, m_sValue.c_str(), sBackupName.c_str()));
pSession->m_olCommit.AddTail(new COpRegValueDelete(m_hKeyRoot, m_sValue, sBackupName));
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_PROBINGVAL);
::MsiRecordSetInteger(hRecordProg, 2, (int)(UINT_PTR)m_hKeyRoot & 0x7fffffff);
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, sBackupName.c_str() );
::MsiRecordSetInteger(hRecordProg, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 3, sBackupName );
::MsiRecordSetInteger(hRecordProg, 4, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
::RegCloseKey(hKey);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}
// Delete the registry value.
lResult = ::RegDeleteValueW(hKey, m_sValueName.c_str());
lResult = ::RegDeleteValueW(hKey, m_sValueName);
}
::RegCloseKey(hKey);
@ -674,12 +731,12 @@ HRESULT COpRegValueDelete::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_REGKEY_DELETEVALUE);
::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, 2, (UINT)m_hKeyRoot & 0x7fffffff );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, m_sValueName );
::MsiRecordSetInteger(hRecordProg, 5, lResult );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(lResult);
return AtlHresultFromWin32(lResult);
}
}

View File

@ -1,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
#pragma comment(lib, "advapi32.lib")
@ -32,7 +46,7 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG);
hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG);
if (hService) {
QUERY_SERVICE_CONFIG *sc;
DWORD dwSize;
@ -48,7 +62,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.push_front(new COpSvcSetStart(m_sValue.c_str(), sc->dwStartType));
pSession->m_olRollback.AddHead(new COpSvcSetStart(m_sValue, sc->dwStartType));
}
dwError = NO_ERROR;
} else
@ -73,10 +87,10 @@ HRESULT COpSvcSetStart::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_SET_START);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}
@ -150,14 +164,14 @@ HRESULT COpSvcStart::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_START | (m_bWait ? SERVICE_QUERY_STATUS : 0));
hService = ::OpenServiceW(hSCM, m_sValue, 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.push_front(new COpSvcStop(m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpSvcStop(m_sValue));
}
} else {
dwError = ::GetLastError();
@ -176,10 +190,10 @@ HRESULT COpSvcStart::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_START);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}
@ -204,7 +218,7 @@ HRESULT COpSvcStop::Execute(CSession *pSession)
SC_HANDLE hService;
// Open the specified service.
hService = ::OpenServiceW(hSCM, m_sValue.c_str(), SERVICE_STOP | (m_bWait ? SERVICE_QUERY_STATUS : 0));
hService = ::OpenServiceW(hSCM, m_sValue, SERVICE_STOP | (m_bWait ? SERVICE_QUERY_STATUS : 0));
if (hService) {
SERVICE_STATUS ss;
// Stop the service.
@ -212,7 +226,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.push_front(new COpSvcStart(m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpSvcStart(m_sValue));
}
} else {
dwError = ::GetLastError();
@ -231,10 +245,10 @@ HRESULT COpSvcStop::Execute(CSession *pSession)
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_SVC_STOP);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
}

View File

@ -1,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
#pragma comment(lib, "mstask.lib")
#pragma comment(lib, "taskschd.lib")
@ -26,45 +40,55 @@ 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);
winstd::com_obj<ITaskService> pService;
CComPtr<ITaskService> pService;
POSITION pos;
// Display our custom message in the progress bar.
::MsiRecordSetStringW(hRecordMsg, 1, m_sValue.c_str());
::MsiRecordSetStringW(hRecordMsg, 1, m_sValue);
if (MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ACTIONDATA, hRecordMsg) == IDCANCEL)
return HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT);
return AtlHresultFromWin32(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.c_str());
COpTaskDelete opDelete(m_sValue);
hr = opDelete.Execute(pSession);
if (FAILED(hr)) goto finish;
}
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
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;
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;
UINT iTrigger;
TASK_LOGON_TYPE logonType;
winstd::bstr bstrContext(L"Author");
CComBSTR bstrContext(L"Author");
// Connect to local task service.
hr = pService->Connect(vEmpty, vEmpty, vEmpty, vEmpty);
@ -82,7 +106,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.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
m_dwFlags |= TASK_FLAG_DISABLED;
}
hr = pTaskSettings->put_Enabled(m_dwFlags & TASK_FLAG_DISABLED ? VARIANT_FALSE : VARIANT_TRUE); if (FAILED(hr)) goto finish;
@ -94,28 +118,35 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
// Add execute action.
hr = pActionCollection->Create(TASK_ACTION_EXEC, &pAction);
if (FAILED(hr)) goto finish;
hr = pAction.query_interface(&pExecAction);
hr = pAction.QueryInterface(&pExecAction);
if (FAILED(hr)) goto finish;
// Configure the action.
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;
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;
// Set task description.
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;
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;
// Configure task "flags".
if (m_dwFlags & TASK_FLAG_DELETE_WHEN_DONE) {
hr = pTaskSettings->put_DeleteExpiredTaskAfter(winstd::bstr(L"PT24H"));
hr = pTaskSettings->put_DeleteExpiredTaskAfter(CComBSTR(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(
@ -131,10 +162,10 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
hr = pTaskDefinition->get_Principal(&pPrincipal);
if (FAILED(hr)) goto finish;
if (m_sAccountName.empty()) {
if (m_sAccountName.IsEmpty()) {
logonType = TASK_LOGON_SERVICE_ACCOUNT;
hr = pPrincipal->put_LogonType(logonType); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(winstd::bstr(L"S-1-5-18")); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(CComBSTR(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;
@ -143,24 +174,26 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
} else {
logonType = TASK_LOGON_PASSWORD;
hr = pPrincipal->put_LogonType(logonType); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(winstd::bstr(m_sAccountName)); if (FAILED(hr)) goto finish;
hr = pPrincipal->put_UserId(CComBSTR(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;
sprintf(str, L"PT%uS", m_wIdleMinutes*60);
hr = pIdleSettings->put_IdleDuration(winstd::bstr(str));
str.Format(L"PT%uS", m_wIdleMinutes*60);
hr = pIdleSettings->put_IdleDuration(CComBSTR(str));
if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uS", m_wDeadlineMinutes*60);
hr = pIdleSettings->put_WaitTimeout(winstd::bstr(str));
str.Format(L"PT%uS", m_wDeadlineMinutes*60);
hr = pIdleSettings->put_WaitTimeout(CComBSTR(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;
@ -168,8 +201,8 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Configure task runtime limit.
sprintf(str, L"PT%uS", m_dwMaxRuntimeMS != INFINITE ? (m_dwMaxRuntimeMS + 500) / 1000 : 0);
hr = pTaskSettings->put_ExecutionTimeLimit(winstd::bstr(str));
str.Format(L"PT%uS", m_dwMaxRuntimeMS != INFINITE ? (m_dwMaxRuntimeMS + 500) / 1000 : 0);
hr = pTaskSettings->put_ExecutionTimeLimit(CComBSTR(str));
if (FAILED(hr)) goto finish;
// Get task trigger colection.
@ -177,57 +210,56 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Add triggers.
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;
for (pos = m_lTriggers.GetHeadPosition(), iTrigger = 0; pos; iTrigger++) {
CComPtr<ITrigger> pTrigger;
TASK_TRIGGER &ttData = m_lTriggers.GetNext(pos);
switch (ttData.TriggerType) {
case TASK_TIME_TRIGGER_ONCE: {
winstd::com_obj<ITimeTrigger> pTriggerTime;
CComPtr<ITimeTrigger> pTriggerTime;
hr = pTriggerCollection->Create(TASK_TRIGGER_TIME, &pTrigger); 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;
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;
break;
}
case TASK_TIME_TRIGGER_DAILY: {
winstd::com_obj<IDailyTrigger> pTriggerDaily;
CComPtr<IDailyTrigger> pTriggerDaily;
hr = pTriggerCollection->Create(TASK_TRIGGER_DAILY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerDaily); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&pTriggerDaily); if (FAILED(hr)) goto finish;
hr = pTriggerDaily->put_DaysInterval(ttData.Type.Daily.DaysInterval); if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerDaily->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerDaily->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_WEEKLY: {
winstd::com_obj<IWeeklyTrigger> pTriggerWeekly;
CComPtr<IWeeklyTrigger> pTriggerWeekly;
hr = pTriggerCollection->Create(TASK_TRIGGER_WEEKLY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerWeekly); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&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;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerWeekly->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerWeekly->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_MONTHLYDATE: {
winstd::com_obj<IMonthlyTrigger> pTriggerMonthly;
CComPtr<IMonthlyTrigger> pTriggerMonthly;
hr = pTriggerCollection->Create(TASK_TRIGGER_MONTHLY, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerMonthly); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&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;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthly->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthly->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
break;
}
case TASK_TIME_TRIGGER_MONTHLYDOW: {
winstd::com_obj<IMonthlyDOWTrigger> pTriggerMonthlyDOW;
CComPtr<IMonthlyDOWTrigger> pTriggerMonthlyDOW;
hr = pTriggerCollection->Create(TASK_TRIGGER_MONTHLYDOW, &pTrigger); if (FAILED(hr)) goto finish;
hr = pTrigger.query_interface(&pTriggerMonthlyDOW); if (FAILED(hr)) goto finish;
hr = pTrigger.QueryInterface(&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 :
@ -236,8 +268,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;
sprintf(str, L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthlyDOW->put_RandomDelay(winstd::bstr(str)); if (FAILED(hr)) goto finish;
str.Format(L"PT%uM", ttData.wRandomMinutesInterval);
hr = pTriggerMonthlyDOW->put_RandomDelay(CComBSTR(str)); if (FAILED(hr)) goto finish;
break;
}
@ -247,52 +279,52 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
case TASK_EVENT_TRIGGER_AT_SYSTEMSTART: {
winstd::com_obj<IBootTrigger> pTriggerBoot;
CComPtr<IBootTrigger> pTriggerBoot;
hr = pTriggerCollection->Create(TASK_TRIGGER_BOOT, &pTrigger); 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;
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;
break;
}
case TASK_EVENT_TRIGGER_AT_LOGON: {
winstd::com_obj<ILogonTrigger> pTriggerLogon;
CComPtr<ILogonTrigger> pTriggerLogon;
hr = pTriggerCollection->Create(TASK_TRIGGER_LOGON, &pTrigger); 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;
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;
break;
}
}
// Set trigger ID.
sprintf(str, L"%u", iTrigger);
hr = pTrigger->put_Id(winstd::bstr(str));
str.Format(L"%u", iTrigger);
hr = pTrigger->put_Id(CComBSTR(str));
if (FAILED(hr)) goto finish;
// Set trigger start date.
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));
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));
if (FAILED(hr)) goto finish;
if (ttData.rgFlags & TASK_TRIGGER_FLAG_HAS_END_DATE) {
// Set trigger end date.
sprintf(str, L"%04u-%02u-%02u", ttData.wEndYear, ttData.wEndMonth, ttData.wEndDay);
hr = pTrigger->put_EndBoundary(winstd::bstr(str));
str.Format(L"%04u-%02u-%02u", ttData.wEndYear, ttData.wEndMonth, ttData.wEndDay);
hr = pTrigger->put_EndBoundary(CComBSTR(str));
if (FAILED(hr)) goto finish;
}
// Set trigger repetition duration and interval.
if (ttData.MinutesDuration || ttData.MinutesInterval) {
winstd::com_obj<IRepetitionPattern> pRepetitionPattern;
CComPtr<IRepetitionPattern> pRepetitionPattern;
hr = pTrigger->get_Repetition(&pRepetitionPattern);
if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.MinutesDuration);
hr = pRepetitionPattern->put_Duration(winstd::bstr(str));
str.Format(L"PT%uM", ttData.MinutesDuration);
hr = pRepetitionPattern->put_Duration(CComBSTR(str));
if (FAILED(hr)) goto finish;
sprintf(str, L"PT%uM", ttData.MinutesInterval);
hr = pRepetitionPattern->put_Interval(winstd::bstr(str));
str.Format(L"PT%uM", ttData.MinutesInterval);
hr = pRepetitionPattern->put_Interval(CComBSTR(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;
@ -304,69 +336,69 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Get the task folder.
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
#ifdef _DEBUG
winstd::bstr xml;
CComBSTR xml;
hr = pTaskDefinition->get_XmlText(&xml);
#endif
// Register the task.
hr = pTaskFolder->RegisterTaskDefinition(
winstd::bstr(m_sValue), // path
CComBSTR(m_sValue), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
logonType != TASK_LOGON_SERVICE_ACCOUNT && !m_sPassword.empty() ? winstd::variant(m_sPassword.c_str()) : vEmpty, // password
logonType != TASK_LOGON_SERVICE_ACCOUNT && !m_sPassword.IsEmpty() ? CComVariant(m_sPassword) : vEmpty, // password
logonType, // logonType
vEmpty, // sddl
&pTask); // ppTask
} else {
// Windows XP or older.
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
// Get task scheduler object.
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
if (FAILED(hr)) goto finish;
// Create the new task.
hr = pTaskScheduler->NewWorkItem(m_sValue.c_str(), CLSID_CTask, IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->NewWorkItem(m_sValue, 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.push_front(new COpTaskDelete(m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpTaskDelete(m_sValue));
}
if (FAILED(hr)) goto finish;
// Set its properties.
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;
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;
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.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, 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.empty() ?
hr = m_sAccountName.IsEmpty() ?
pTask->SetAccountInformation(L"", NULL ) :
pTask->SetAccountInformation(m_sAccountName.c_str(), m_sPassword.c_str());
pTask->SetAccountInformation(m_sAccountName, m_sPassword);
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 (auto t = m_lTriggers.cbegin(), t_end = m_lTriggers.cend(); t != t_end; ++t) {
for (pos = m_lTriggers.GetHeadPosition(); pos;) {
WORD wTriggerIdx;
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.
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.
hr = pTask->CreateTrigger(&wTriggerIdx, &pTrigger);
if (FAILED(hr)) goto finish;
@ -394,8 +426,8 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Convert numerical date to DMY (ULONGLONG -> FILETIME -> SYSTEMTIME).
ftValue.dwHighDateTime = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
::FileTimeToSystemTime(&ftValue, &stValue);
// Set new trigger date and time.
@ -411,7 +443,7 @@ HRESULT COpTaskCreate::Execute(CSession *pSession)
}
// Save the task.
winstd::com_obj<IPersistFile> pTaskFile(pTask);
CComQIPtr<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
}
@ -420,7 +452,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_CREATE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -432,7 +464,7 @@ UINT COpTaskCreate::SetFromRecord(MSIHANDLE hInstall, MSIHANDLE hRecord)
{
UINT uiResult;
int iValue;
std::wstring sFolder;
ATL::CAtlStringW sFolder;
uiResult = ::MsiRecordFormatStringW(hInstall, hRecord, 3, m_sApplicationName);
if (uiResult != NO_ERROR) return uiResult;
@ -442,11 +474,11 @@ UINT COpTaskCreate::SetFromRecord(MSIHANDLE hInstall, MSIHANDLE hRecord)
uiResult = ::MsiRecordGetStringW(hRecord, 5, sFolder);
if (uiResult != NO_ERROR) return uiResult;
uiResult = ::MsiGetTargetPathW(hInstall, sFolder.c_str(), m_sWorkingDirectory);
uiResult = ::MsiGetTargetPathW(hInstall, sFolder, m_sWorkingDirectory);
if (uiResult != NO_ERROR) return uiResult;
if (!m_sWorkingDirectory.empty() && m_sWorkingDirectory.back() == L'\\') {
if (!m_sWorkingDirectory.IsEmpty() && m_sWorkingDirectory.GetAt(m_sWorkingDirectory.GetLength() - 1) == L'\\') {
// Trim trailing backslash.
m_sWorkingDirectory.resize(m_sWorkingDirectory.length() - 1);
m_sWorkingDirectory.Truncate(m_sWorkingDirectory.GetLength() - 1);
}
uiResult = ::MsiRecordFormatStringW(hInstall, hRecord, 10, m_sAuthor);
@ -500,8 +532,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 = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
if (!::FileTimeToSystemTime(&ftValue, &stValue))
return ::GetLastError();
ttData.wBeginYear = stValue.wYear;
@ -512,8 +544,8 @@ UINT COpTaskCreate::SetTriggersFromView(MSIHANDLE hView)
iValue = ::MsiRecordGetInteger(hRecord, 3);
if (iValue != MSI_NULL_INTEGER) {
ullValue = ((ULONGLONG)iValue + 138426) * 864000000000;
ftValue.dwHighDateTime = static_cast<DWORD>((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = static_cast<DWORD>( ullValue & 0xffffffff);
ftValue.dwHighDateTime = (DWORD)((ullValue >> 32) & 0xffffffff);
ftValue.dwLowDateTime = (DWORD)( ullValue & 0xffffffff);
if (!::FileTimeToSystemTime(&ftValue, &stValue))
return ::GetLastError();
ttData.wEndYear = stValue.wYear;
@ -600,8 +632,10 @@ UINT COpTaskCreate::SetTriggersFromView(MSIHANDLE hView)
break;
}
m_lTriggers.push_back(ttData);
m_lTriggers.AddTail(ttData);
}
return NO_ERROR;
}
@ -618,35 +652,35 @@ COpTaskDelete::COpTaskDelete(LPCWSTR pszTaskName, int iTicks) :
HRESULT COpTaskDelete::Execute(CSession *pSession)
{
HRESULT hr;
winstd::com_obj<ITaskService> pService;
CComPtr<ITaskService> pService;
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
CComVariant vEmpty;
CComPtr<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(winstd::bstr(L"\\"), &pTaskFolder);
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
if (pSession->m_bRollbackEnabled) {
winstd::com_obj<IRegisteredTask> pTask, pTaskOrig;
winstd::com_obj<ITaskDefinition> pTaskDefinition;
winstd::com_obj<IPrincipal> pPrincipal;
CComPtr<IRegisteredTask> pTask, pTaskOrig;
CComPtr<ITaskDefinition> pTaskDefinition;
CComPtr<IPrincipal> pPrincipal;
VARIANT_BOOL bEnabled;
TASK_LOGON_TYPE logonType;
winstd::bstr sSSDL;
winstd::variant vSSDL;
std::wstring sDisplayNameOrig;
CComBSTR sSSDL;
CComVariant vSSDL;
ATL::CAtlStringW sDisplayNameOrig;
UINT uiCount = 0;
// Get the source task.
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue), &pTask);
hr = pTaskFolder->GetTask(CComBSTR(m_sValue), &pTask);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) { hr = S_OK; goto finish; }
else if (FAILED(hr)) goto finish;
@ -657,7 +691,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.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
// Disable it.
hr = pTask->put_Enabled(VARIANT_FALSE);
@ -678,18 +712,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)) ::VariantClear(&vSSDL);
if (hr == HRESULT_FROM_WIN32(ERROR_PRIVILEGE_NOT_HELD)) vSSDL.Clear();
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 {
sprintf(sDisplayNameOrig, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
sDisplayNameOrig.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
hr = pTaskFolder->RegisterTaskDefinition(
winstd::bstr(sDisplayNameOrig), // path
CComBSTR(sDisplayNameOrig), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
@ -699,39 +733,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.push_front(new COpTaskDelete(sDisplayNameOrig.c_str()));
pSession->m_olRollback.AddHead(new COpTaskDelete(sDisplayNameOrig));
if (FAILED(hr)) goto finish;
// Order rollback action to restore from backup copy.
pSession->m_olRollback.push_front(new COpTaskCopy(sDisplayNameOrig.c_str(), m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpTaskCopy(sDisplayNameOrig, m_sValue));
// Delete it.
hr = pTaskFolder->DeleteTask(winstd::bstr(m_sValue), 0);
hr = pTaskFolder->DeleteTask(CComBSTR(m_sValue), 0);
if (FAILED(hr)) goto finish;
// Order commit action to delete backup copy.
pSession->m_olCommit.push_back(new COpTaskDelete(sDisplayNameOrig.c_str()));
pSession->m_olCommit.AddTail(new COpTaskDelete(sDisplayNameOrig));
} else {
// Delete the task.
hr = pTaskFolder->DeleteTask(winstd::bstr(m_sValue), 0);
hr = pTaskFolder->DeleteTask(CComBSTR(m_sValue), 0);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) hr = S_OK;
}
} else {
// Windows XP or older.
winstd::com_obj<ITaskScheduler> pTaskScheduler;
CComPtr<ITaskScheduler> pTaskScheduler;
// Get task scheduler object.
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
if (FAILED(hr)) goto finish;
if (pSession->m_bRollbackEnabled) {
winstd::com_obj<ITask> pTask;
CComPtr<ITask> pTask;
DWORD dwFlags;
std::wstring sDisplayNameOrig;
ATL::CAtlStringW sDisplayNameOrig;
UINT uiCount = 0;
// Load the task.
hr = pTaskScheduler->Activate(m_sValue.c_str(), IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue, IID_ITask, (IUnknown**)&pTask);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) { hr = S_OK; goto finish; }
else if (FAILED(hr)) goto finish;
@ -742,7 +776,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.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
// Disable it.
dwFlags |= TASK_FLAG_DISABLED;
@ -752,31 +786,31 @@ HRESULT COpTaskDelete::Execute(CSession *pSession)
// Prepare a backup copy of task.
do {
sprintf(sDisplayNameOrig, L"%ls (orig %u)", m_sValue.c_str(), ++uiCount);
hr = pTaskScheduler->AddWorkItem(sDisplayNameOrig.c_str(), pTask);
sDisplayNameOrig.Format(L"%ls (orig %u)", (LPCWSTR)m_sValue, ++uiCount);
hr = pTaskScheduler->AddWorkItem(sDisplayNameOrig, 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.push_front(new COpTaskDelete(sDisplayNameOrig.c_str()));
pSession->m_olRollback.AddHead(new COpTaskDelete(sDisplayNameOrig));
if (FAILED(hr)) goto finish;
// Save the backup copy.
winstd::com_obj<IPersistFile> pTaskFile(pTask);
CComQIPtr<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.push_front(new COpTaskCopy(sDisplayNameOrig.c_str(), m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpTaskCopy(sDisplayNameOrig, m_sValue));
// Delete it.
hr = pTaskScheduler->Delete(m_sValue.c_str());
hr = pTaskScheduler->Delete(m_sValue);
if (FAILED(hr)) goto finish;
// Order commit action to delete backup copy.
pSession->m_olCommit.push_back(new COpTaskDelete(sDisplayNameOrig.c_str()));
pSession->m_olCommit.AddTail(new COpTaskDelete(sDisplayNameOrig));
} else {
// Delete the task.
hr = pTaskScheduler->Delete(m_sValue.c_str());
hr = pTaskScheduler->Delete(m_sValue);
if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) hr = S_OK;
}
}
@ -785,7 +819,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_DELETE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -807,14 +841,14 @@ COpTaskEnable::COpTaskEnable(LPCWSTR pszTaskName, BOOL bEnable, int iTicks) :
HRESULT COpTaskEnable::Execute(CSession *pSession)
{
HRESULT hr;
winstd::com_obj<ITaskService> pService;
CComPtr<ITaskService> pService;
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
winstd::com_obj<IRegisteredTask> pTask;
CComVariant vEmpty;
CComPtr<ITaskFolder> pTaskFolder;
CComPtr<IRegisteredTask> pTask;
VARIANT_BOOL bEnabled;
// Connect to local task service.
@ -822,11 +856,11 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Get task folder.
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
// Get task.
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue), &pTask);
hr = pTaskFolder->GetTask(CComBSTR(m_sValue), &pTask);
if (FAILED(hr)) goto finish;
// Get currently enabled state.
@ -838,7 +872,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.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
hr = S_OK; goto finish;
} else
bEnabled = VARIANT_TRUE;
@ -846,7 +880,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.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
}
bEnabled = VARIANT_FALSE;
}
@ -856,16 +890,16 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
} else {
// Windows XP or older.
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
DWORD dwFlags;
// Get task scheduler object.
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
if (FAILED(hr)) goto finish;
// Load the task.
hr = pTaskScheduler->Activate(m_sValue.c_str(), IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue, IID_ITask, (IUnknown**)&pTask);
if (FAILED(hr)) goto finish;
// Get task's current flags.
@ -877,7 +911,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.push_back(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olCommit.AddTail(new COpTaskEnable(m_sValue, TRUE));
hr = S_OK; goto finish;
} else
dwFlags &= ~TASK_FLAG_DISABLED;
@ -885,7 +919,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.push_front(new COpTaskEnable(m_sValue.c_str(), TRUE));
pSession->m_olRollback.AddHead(new COpTaskEnable(m_sValue, TRUE));
}
dwFlags |= TASK_FLAG_DISABLED;
}
@ -895,7 +929,7 @@ HRESULT COpTaskEnable::Execute(CSession *pSession)
if (FAILED(hr)) goto finish;
// Save the task.
winstd::com_obj<IPersistFile> pTaskFile(pTask);
CComQIPtr<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
if (FAILED(hr)) goto finish;
@ -905,7 +939,7 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(3);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_ENABLE);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue );
::MsiRecordSetInteger(hRecordProg, 3, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}
@ -926,29 +960,29 @@ COpTaskCopy::COpTaskCopy(LPCWSTR pszTaskSrc, LPCWSTR pszTaskDst, int iTicks) :
HRESULT COpTaskCopy::Execute(CSession *pSession)
{
HRESULT hr;
winstd::com_obj<ITaskService> pService;
CComPtr<ITaskService> pService;
hr = CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, pService);
hr = pService.CoCreateInstance(CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER);
if (SUCCEEDED(hr)) {
// Windows Vista or newer.
winstd::variant vEmpty;
winstd::com_obj<ITaskFolder> pTaskFolder;
winstd::com_obj<IRegisteredTask> pTask, pTaskOrig;
winstd::com_obj<ITaskDefinition> pTaskDefinition;
winstd::com_obj<IPrincipal> pPrincipal;
CComVariant vEmpty;
CComPtr<ITaskFolder> pTaskFolder;
CComPtr<IRegisteredTask> pTask, pTaskOrig;
CComPtr<ITaskDefinition> pTaskDefinition;
CComPtr<IPrincipal> pPrincipal;
TASK_LOGON_TYPE logonType;
winstd::bstr sSSDL;
CComBSTR sSSDL;
// Connect to local task service.
hr = pService->Connect(vEmpty, vEmpty, vEmpty, vEmpty);
if (FAILED(hr)) goto finish;
// Get task folder.
hr = pService->GetFolder(winstd::bstr(L"\\"), &pTaskFolder);
hr = pService->GetFolder(CComBSTR(L"\\"), &pTaskFolder);
if (FAILED(hr)) goto finish;
// Get the source task.
hr = pTaskFolder->GetTask(winstd::bstr(m_sValue1), &pTask);
hr = pTaskFolder->GetTask(CComBSTR(m_sValue1), &pTask);
if (FAILED(hr)) goto finish;
// Get task's definition.
@ -969,38 +1003,38 @@ HRESULT COpTaskCopy::Execute(CSession *pSession)
// Register a new task.
hr = pTaskFolder->RegisterTaskDefinition(
winstd::bstr(m_sValue2), // path
CComBSTR(m_sValue2), // path
pTaskDefinition, // pDefinition
TASK_CREATE, // flags
vEmpty, // userId
vEmpty, // password
logonType, // logonType
winstd::variant(sSSDL), // sddl
CComVariant(sSSDL), // sddl
&pTaskOrig); // ppTask
if (FAILED(hr)) goto finish;
} else {
// Windows XP or older.
winstd::com_obj<ITaskScheduler> pTaskScheduler;
winstd::com_obj<ITask> pTask;
CComPtr<ITaskScheduler> pTaskScheduler;
CComPtr<ITask> pTask;
// Get task scheduler object.
hr = CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL, pTaskScheduler);
hr = pTaskScheduler.CoCreateInstance(CLSID_CTaskScheduler, NULL, CLSCTX_ALL);
if (FAILED(hr)) goto finish;
// Load the source task.
hr = pTaskScheduler->Activate(m_sValue1.c_str(), IID_ITask, (IUnknown**)&pTask);
hr = pTaskScheduler->Activate(m_sValue1, IID_ITask, (IUnknown**)&pTask);
if (FAILED(hr)) goto finish;
// Add with different name.
hr = pTaskScheduler->AddWorkItem(m_sValue2.c_str(), pTask);
hr = pTaskScheduler->AddWorkItem(m_sValue2, pTask);
if (pSession->m_bRollbackEnabled) {
// Order rollback action to delete the new copy. ITask::AddWorkItem() might made a blank task already.
pSession->m_olRollback.push_front(new COpTaskDelete(m_sValue2.c_str()));
pSession->m_olRollback.AddHead(new COpTaskDelete(m_sValue2));
}
if (FAILED(hr)) goto finish;
// Save the task.
winstd::com_obj<IPersistFile> pTaskFile(pTask);
CComQIPtr<IPersistFile> pTaskFile(pTask);
if (!pTaskFile) { hr = E_NOINTERFACE; goto finish; }
hr = pTaskFile->Save(NULL, TRUE);
if (FAILED(hr)) goto finish;
@ -1010,8 +1044,8 @@ finish:
if (FAILED(hr)) {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(4);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_TASK_COPY);
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1.c_str() );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, m_sValue1 );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue2 );
::MsiRecordSetInteger(hRecordProg, 4, hr );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
}

View File

@ -1,9 +1,23 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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 "pch.h"
#include "stdafx.h"
namespace MSICA {
@ -41,19 +55,19 @@ HRESULT COpWLANProfileDelete::Execute(CSession *pSession)
DWORD dwFlags = 0, dwGrantedAccess = 0;
// Get profile settings as XML first.
dwError = ::pfnWlanGetProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL, &pszProfileXML, &dwFlags, &dwGrantedAccess);
dwError = ::pfnWlanGetProfile(hClientHandle, &m_guidInterface, m_sValue, NULL, &pszProfileXML, &dwFlags, &dwGrantedAccess);
if (dwError == NO_ERROR) {
// Delete the profile.
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL);
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue, NULL);
if (dwError == NO_ERROR) {
// Order rollback action to recreate it.
pSession->m_olRollback.push_front(new COpWLANProfileSet(m_guidInterface, dwFlags, m_sValue.c_str(), pszProfileXML));
pSession->m_olRollback.AddHead(new COpWLANProfileSet(m_guidInterface, dwFlags, m_sValue, pszProfileXML));
}
::pfnWlanFreeMemory(pszProfileXML);
}
} else {
// Delete the profile.
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue.c_str(), NULL);
dwError = ::pfnWlanDeleteProfile(hClientHandle, &m_guidInterface, m_sValue, NULL);
}
::pfnWlanCloseHandle(hClientHandle, NULL);
}
@ -62,12 +76,14 @@ 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, winstd::wstring_guid(m_guidInterface).c_str());
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, sGUID );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetInteger(hRecordProg, 4, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(1);
@ -101,7 +117,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.c_str());
COpWLANProfileDelete opDelete(m_guidInterface, m_sValue);
HRESULT hr = opDelete.Execute(pSession);
if (FAILED(hr)) return hr;
}
@ -109,10 +125,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.c_str(), NULL, TRUE, NULL, &wlrc);
dwError = ::pfnWlanSetProfile(hClientHandle, &m_guidInterface, m_dwFlags, m_sProfileXML, NULL, TRUE, NULL, &wlrc);
if (dwError == NO_ERROR && pSession->m_bRollbackEnabled) {
// Order rollback action to delete it.
pSession->m_olRollback.push_front(new COpWLANProfileDelete(m_guidInterface, m_sValue.c_str()));
pSession->m_olRollback.AddHead(new COpWLANProfileDelete(m_guidInterface, m_sValue));
}
::pfnWlanCloseHandle(hClientHandle, NULL);
}
@ -121,20 +137,22 @@ HRESULT COpWLANProfileSet::Execute(CSession *pSession)
return S_OK;
else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(5);
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);
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);
::MsiRecordSetInteger(hRecordProg, 1, ERROR_INSTALL_WLAN_PROFILE_SET);
::MsiRecordSetStringW(hRecordProg, 2, winstd::wstring_guid(m_guidInterface).c_str());
::MsiRecordSetStringW(hRecordProg, 3, m_sValue.c_str() );
::MsiRecordSetStringW(hRecordProg, 4, sReason.c_str() );
::MsiRecordSetStringW(hRecordProg, 2, sGUID );
::MsiRecordSetStringW(hRecordProg, 3, m_sValue );
::MsiRecordSetStringW(hRecordProg, 4, sReason );
::MsiRecordSetInteger(hRecordProg, 5, dwError );
::MsiProcessMessage(pSession->m_hInstall, INSTALLMESSAGE_ERROR, hRecordProg);
return HRESULT_FROM_WIN32(dwError);
return AtlHresultFromWin32(dwError);
}
} else {
PMSIHANDLE hRecordProg = ::MsiCreateRecord(1);

View File

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

20
src/stdafx.cpp Normal file
View File

@ -0,0 +1,20 @@
/*
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"

View File

@ -1,19 +1,36 @@
/*
SPDX-License-Identifier: GPL-3.0-or-later
Copyright © 1991-2022 Amebis
/*
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/>.
*/
#pragma once
#include <MSICALib.h>
#include <WinStd/COM.h>
#include <WinStd/Crypt.h>
#include <atlex/atlcrypt.h>
#include <atlex/atlwin.h>
#include <atlbase.h>
#include <atlfile.h>
#include <atlstr.h>
#include <msi.h>
#include <msiquery.h>
#include <mstask.h>
#include <shlwapi.h>
#include <taskschd.h>
#include <wlanapi.h>