summaryrefslogtreecommitdiff
path: root/win/packaging
diff options
context:
space:
mode:
Diffstat (limited to 'win/packaging')
-rw-r--r--win/packaging/CMakeLists.txt1
-rw-r--r--win/packaging/ca/CMakeLists.txt16
-rw-r--r--win/packaging/ca/CustomAction.cpp87
-rw-r--r--win/packaging/create_msi.cmake.in3
-rw-r--r--win/packaging/extra.wxs.in9
-rw-r--r--win/packaging/mysql_server.wxs.in8
6 files changed, 113 insertions, 11 deletions
diff --git a/win/packaging/CMakeLists.txt b/win/packaging/CMakeLists.txt
index 795732e946b..0b5e2f98f16 100644
--- a/win/packaging/CMakeLists.txt
+++ b/win/packaging/CMakeLists.txt
@@ -24,6 +24,7 @@ FIND_PATH(WIX_DIR heat.exe
"$ENV{ProgramFiles}/Windows Installer XML v3/bin"
"$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
"$ENV{ProgramFiles}/Windows Installer XML v3.6/bin"
+ "$ENV{WIX}/bin"
)
SET(CPACK_WIX_PACKAGE_BASE_NAME "MariaDB")
diff --git a/win/packaging/ca/CMakeLists.txt b/win/packaging/ca/CMakeLists.txt
index 7dd30123587..940e9e3a7d1 100644
--- a/win/packaging/ca/CMakeLists.txt
+++ b/win/packaging/ca/CMakeLists.txt
@@ -22,28 +22,40 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(WIX_ARCH_SUFFIX "_x64")
+ SET(WIX36_ARCH_SUFFIX "x64")
ELSE()
SET(WIX_ARCH_SUFFIX)
+ SET(WIX36_ARCH_SUFFIX "x86")
ENDIF()
IF(MSVC_VERSION EQUAL 1400)
SET(WIX35_MSVC_SUFFIX "_2005")
ELSEIF(MSVC_VERSION EQUAL 1500)
SET(WIX35_MSVC_SUFFIX "_2008")
+ SET(WIX36_MSVC_SUFFIX "VS2008")
ELSEIF(MSVC_VERSION EQUAL 1600)
SET(WIX35_MSVC_SUFFIX "_2010")
+ SET(WIX36_MSVC_SUFFIX "VS2010")
ELSE()
# When next VS is out, add the correct version here
MESSAGE(FATAL_ERROR "Unknown VS version")
ENDIF()
+INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/inc)
FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
- HINTS ${WIX_DIR}/../SDK/lib)
+ wcautil
+ PATHS
+ ${WIX_DIR}/../SDK/lib
+ ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX})
FIND_LIBRARY(WIX_DUTIL_LIBRARY
NAMES dutil${WIX_ARCH_SUFFIX} dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
- PATHS ${WIX_DIR}/../SDK/lib)
+ dutil
+ PATHS
+ ${WIX_DIR}/../SDK/lib
+ ${WIX_DIR}/../SDK/${WIX36_MSVC_SUFFIX}/lib/${WIX36_ARCH_SUFFIX}
+ )
ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index ed26dd45a94..50b39adc0b1 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -73,6 +73,82 @@ LExit:
return WcaFinalize(er);
}
+/*
+ Escape command line parameter fpr pass to CreateProcess().
+
+ We assume out has enough space to include encoded string
+ 2*wcslen(in) is enough.
+
+ It is assumed that called will add double quotation marks before and after
+ the string.
+*/
+static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
+{
+ const wchar_t special_chars[]=L" \t\n\v\"";
+ bool needs_escaping= false;
+ size_t pos;
+
+ for(int i=0; i< sizeof(special_chars) -1; i++)
+ {
+ if (wcschr(in, special_chars[i]))
+ {
+ needs_escaping = true;
+ break;
+ }
+ }
+
+ if(!needs_escaping)
+ {
+ wcscpy_s(out, buflen, in);
+ return;
+ }
+
+ pos= 0;
+ for(int i = 0 ; ; i++)
+ {
+ size_t n_backslashes = 0;
+ wchar_t c;
+ while (in[i] == L'\\')
+ {
+ i++;
+ n_backslashes++;
+ }
+
+ c= in[i];
+ if (c == 0)
+ {
+ /*
+ Escape all backslashes, but let the terminating double quotation mark
+ that caller adds be interpreted as a metacharacter.
+ */
+ for(size_t j= 0; j < 2*n_backslashes;j++)
+ {
+ out[pos++]=L'\\';
+ }
+ break;
+ }
+ else if (c == L'"')
+ {
+ /*
+ Escape all backslashes and the following double quotation mark.
+ */
+ for(size_t j= 0; j < 2*n_backslashes + 1; j++)
+ {
+ out[pos++]=L'\\';
+ }
+ out[pos++]= L'"';
+ }
+ else
+ {
+ /* Backslashes aren't special here. */
+ for (size_t j=0; j < n_backslashes; j++)
+ out[pos++] = L'\\';
+
+ out[pos++]= c;
+ }
+ }
+ out[pos++]= 0;
+}
/*
Check for if directory is empty during install,
sets "<PROPERTY>_NOT_EMPTY" otherise
@@ -462,6 +538,8 @@ unsigned long long GetMaxBufferSize(unsigned long long totalPhys)
return totalPhys;
#endif
}
+
+
/*
Checks SERVICENAME, PORT and BUFFERSIZE parameters
*/
@@ -470,6 +548,8 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
wchar_t ServiceName[MAX_PATH]={0};
wchar_t SkipNetworking[MAX_PATH]={0};
wchar_t QuickConfig[MAX_PATH]={0};
+ wchar_t Password[MAX_PATH]={0};
+ wchar_t EscapedPassword[2*MAX_PATH+2];
wchar_t Port[6];
wchar_t BufferPoolSize[16];
DWORD PortLen=6;
@@ -512,8 +592,13 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
}
}
- DWORD SkipNetworkingLen= MAX_PATH;
+ DWORD PasswordLen= MAX_PATH;
+ MsiGetPropertyW (hInstall, L"PASSWORD", Password, &PasswordLen);
+ EscapeCommandLine(Password, EscapedPassword,
+ sizeof(EscapedPassword)/sizeof(EscapedPassword[0]));
+ MsiSetPropertyW(hInstall,L"ESCAPEDPASSWORD",EscapedPassword);
+ DWORD SkipNetworkingLen= MAX_PATH;
MsiGetPropertyW(hInstall, L"SKIPNETWORKING", SkipNetworking,
&SkipNetworkingLen);
MsiGetPropertyW(hInstall, L"PORT", Port, &PortLen);
diff --git a/win/packaging/create_msi.cmake.in b/win/packaging/create_msi.cmake.in
index d02791d3b9f..a8ca35906e8 100644
--- a/win/packaging/create_msi.cmake.in
+++ b/win/packaging/create_msi.cmake.in
@@ -8,6 +8,7 @@ SET(VERSION "@VERSION@")
SET(MAJOR_VERSION "@MAJOR_VERSION@")
SET(MINOR_VERSION "@MINOR_VERSION@")
SET(PATCH_VERSION "@PATCH_VERSION@")
+SET(TINY_VERSION "@TINY_VERSION@")
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
SET(MANUFACTURER "@MANUFACTURER@")
SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
@@ -421,7 +422,7 @@ EXECUTE_PROCESS(
EXECUTE_PROCESS(
COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
- -ext WixFirewallExtension
+ -ext WixFirewallExtension -sice:ICE61
mysql_server.wixobj extra.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
${EXTRA_LIGHT_ARGS}
)
diff --git a/win/packaging/extra.wxs.in b/win/packaging/extra.wxs.in
index 37b12575328..d4adc959333 100644
--- a/win/packaging/extra.wxs.in
+++ b/win/packaging/extra.wxs.in
@@ -34,6 +34,7 @@
<!-- Root password -->
<Property Id="PASSWORD" Hidden="yes" Secure="yes" />
+ <Property Id="ESCAPEDPASSWORD" Hidden="yes" Secure="yes" />
<!-- Database port -->
<Property Id="PORT" Value="3306" Secure="yes"/>
<!-- Whether to allow remote access for root user -->
@@ -233,7 +234,7 @@
</Control>
<Control Id="CheckBoxModifyRootPassword" Type="CheckBox" X="8" Y="62" Width="222" Height="18" Property="ModifyRootPassword" CheckBoxValue="1" TabSkip="no">
- <Text>{\Font1}Modify root password</Text>
+ <Text>{\Font1}Modify password for database user 'root'</Text>
<Publish Property="PASSWORD" >NOT ModifyRootPassword</Publish>
<Publish Property="RootPasswordConfirm">NOT ModifyRootPassword</Publish>
<Publish Property="ALLOWREMOTEROOTACCESS">NOT ModifyRootPassword</Publish>
@@ -255,7 +256,7 @@
</Control>
<Control Id="CheckBoxALLOWREMOTEROOTACCESS" Type="CheckBox" X="23" Y="122" Width="196" Height="18" Property="ALLOWREMOTEROOTACCESS"
CheckBoxValue="--allow-remote-root-access" TabSkip="no">
- <Text>{\Font1}Enable root access from remote machines</Text>
+ <Text>{\Font1}Enable access from remote machines for 'root' user</Text>
<Condition Action="enable">ModifyRootPassword</Condition>
<Condition Action="disable">NOT ModifyRootPassword</Condition>
</Control>
@@ -668,7 +669,7 @@
<CustomAction Id='PresetDatabaseProperties' BinaryKey='wixca.dll' DllEntry='PresetDatabaseProperties' />
<CustomAction Id="CreateDatabaseCommand" Property="CreateDatabase"
Value=
- "&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[PASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER]"
+ "&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; --port=[PORT] &quot;--password=[ESCAPEDPASSWORD]&quot; &quot;--datadir=[DATADIR]\&quot; [SKIPNETWORKING] [ALLOWREMOTEROOTACCESS] [DEFAULTUSER]"
Execute="immediate"
HideTarget="yes"
/>
@@ -703,7 +704,7 @@
<![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
</Custom>
<Custom Action="ErrorDataDirNotEmpty" After="CheckDataDirectoryEmpty" >DATADIRNOTEMPTY</Custom>
-
+ <Custom Action="CheckDatabaseProperties" Before="CreateDatabaseCommand">SERVICENAME</Custom>
<Custom Action="CreateDatabaseCommand" After="CostFinalize" >
<![CDATA[&DBInstance=3 AND NOT !DBInstance=3 AND OLDERVERSIONBEINGUPGRADED=""]]>
</Custom>
diff --git a/win/packaging/mysql_server.wxs.in b/win/packaging/mysql_server.wxs.in
index 82c17d7577c..79fde801cf5 100644
--- a/win/packaging/mysql_server.wxs.in
+++ b/win/packaging/mysql_server.wxs.in
@@ -4,7 +4,7 @@
Id="*"
UpgradeCode="@CPACK_WIX_UPGRADE_CODE@"
Name="@CPACK_WIX_PACKAGE_NAME@"
- Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
+ Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@"
Language="1033"
Manufacturer="@MANUFACTURER@">
@@ -26,14 +26,16 @@
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
IncludeMinimum="yes"
- Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
+ Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@"
+ IncludeMaximum="yes"
Property="OLDERVERSIONBEINGUPGRADED"
MigrateFeatures="yes"
/>
<?endif?>
<UpgradeVersion
- Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@"
Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.999"
+ IncludeMinimum="no"
OnlyDetect="yes"
Property="NEWERVERSIONDETECTED" />
</Upgrade>