REGISTER_SAFE_SCRIPTFUNCTION(get_time, &Utility::GetTime);
REGISTER_SAFE_SCRIPTFUNCTION(basename, &Utility::BaseName);
REGISTER_SAFE_SCRIPTFUNCTION(dirname, &Utility::DirName);
-#ifdef _WIN32
REGISTER_SAFE_SCRIPTFUNCTION(msi_get_component_path, &ScriptUtils::MsiGetComponentPathShim);
-#endif /* _WIN32 */
String ScriptUtils::CastString(const Value& value)
{
BOOST_THROW_EXCEPTION(std::runtime_error("Assertion failed"));
}
-#ifdef _WIN32
String ScriptUtils::MsiGetComponentPathShim(const String& component)
{
+#ifdef _WIN32
TCHAR productCode[39];
if (MsiGetProductCode(component.CStr(), productCode) != ERROR_SUCCESS)
return "";
path[0] = '\0';
MsiGetComponentPath(productCode, component.CStr(), path, &szPath);
return path;
-}
+#else /* _WIN32 */
+ return String();
#endif /* _WIN32 */
+}
static DynamicObject::Ptr GetObject(const Type::Ptr& type, const String& name);
static Array::Ptr GetObjects(const Type::Ptr& type);
static void Assert(const Value& arg);
-#ifdef _WIN32
static String MsiGetComponentPathShim(const String& component);
-#endif /* _WIN32 */
private:
ScriptUtils(void);