This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- CustomAction InstallScript to Move MSI Log File?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 05, 2018
11:10 AM
CustomAction InstallScript to Move MSI Log File?
I am trying to move the MSI log file to our installation folder. I must be missing something simple but it just wont work for me. The following action is what I am using.
Ultimately we are trying to grab the MSI log, copy it and rename it. I also couldn't get the RenameFile working either (as it supports renaming and moving on the fly) but figured copying it to the path is step one. The two variables about come back proper:
export prototype MSILogCopy(HWND);
function MSILogCopy(hMSI)
NUMBER nvSize;
STRING sMSILogNewLocation, sMSILogFile, sMSILogFileLocation;
begin
SdShowMsg("Please wait while setup copies MSI install log...", TRUE); // TURN ON INSTALL'S STATUS MESSAGE
MsiGetProperty(ISMSI_HANDLE, "MsiLogFileLocation", sMSILogFileLocation, nvSize);
MessageBox(sMSILogFileLocation,WARNING);
sMSILogNewLocation = INSTALLDIR ^ "Logs";
MessageBox(sMSILogNewLocation,WARNING);
if (XCopyFile (sMSILogFileLocation, sMSILogNewLocation, COMP_NORMAL) < 0) then
MessageBox ("XCopyFile failed", INFORMATION);
else
MessageBox ("Program files successfully copied.", INFORMATION);
endif;
SdShowMsg("", FALSE); // TURN OFF INSTALL'S STATUS MESSAGE
end;
Ultimately we are trying to grab the MSI log, copy it and rename it. I also couldn't get the RenameFile working either (as it supports renaming and moving on the fly) but figured copying it to the path is step one. The two variables about come back proper:
sMSILogFileLocation = C:\Users\xxx\AppData\Local\Temp\2\MSIxxx.LOG
sMSILogNewLocation = C:\Program Files\AIR\Logs
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 05, 2018
11:28 AM
when changing the code over to:
I get: The system cannot find the file specified. However the file is present C:\Users\i63764\AppData\Local\Temp\2\MSI78ed6.LOG.
export prototype MSILogCopy(HWND);
function MSILogCopy(hMSI)
NUMBER nReturn, nvSize;
STRING sMSILogNewLocation, sMSILogFile, sMSILogFileLocation;
begin
SdShowMsg("Please wait while setup copies MSI install log...", TRUE); // TURN ON INSTALL'S STATUS MESSAGE
MsiGetProperty(ISMSI_HANDLE, "MsiLogFileLocation", sMSILogFileLocation, nvSize);
MessageBox(sMSILogFileLocation,WARNING);
sMSILogNewLocation = INSTALLDIR ^ "Logs";
MessageBox(sMSILogNewLocation,WARNING);
nReturn = XCopyFile (sMSILogFileLocation, sMSILogNewLocation, COMP_NORMAL);
if (nReturn < 0) then
MessageBox(FormatMessage(nReturn), INFORMATION);
endif;
SdShowMsg("", FALSE); // TURN OFF INSTALL'S STATUS MESSAGE
end;
I get: The system cannot find the file specified. However the file is present C:\Users\i63764\AppData\Local\Temp\2\MSI78ed6.LOG.
