Misha Koshelev wrote:
All actual script implementation is left (for the next patch) in the call_script function.
Patches should attempt to be atomic changes that compile and pass all tests without another patch needing to be applied on top. I suggest you implement automation.c and the associated header file in patch 2 and combine this patch with the rest of patch 3.
+static UINT HANDLE_CustomType37_38(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
+{
...
- if (GetTempFileNameW(fmt, f1, 0, tmp_file) == 0)
...
- info = do_msidbCustomActionTypeScript( package, type, tmp_file, NULL, action );
- return wait_thread_handle( info );
+}
+static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
+{
...
- r = store_binary_to_temp(package, source, tmp_file);
...
- info = do_msidbCustomActionTypeScript( package, type, tmp_file, target, action );
- return wait_thread_handle( info );
+}
+static UINT HANDLE_CustomType21_22(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
+{
...
- info = do_msidbCustomActionTypeScript( package, type, file->TargetPath, target, action );
- return wait_thread_handle( info );
+}
+static UINT HANDLE_CustomType53_54(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
+{
...
- if (GetTempFileNameW(fmt, f1, 0, tmp_file) == 0)
...
- info = do_msidbCustomActionTypeScript( package, type, tmp_file, NULL, action );
- return wait_thread_handle( info );
+}
It would seem simpler here to just open the file here for the one case that has an external file and just pass in the LPWSTR script for all cases.