cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LKM_N4EN
Level 6

Custom Action Sequence to Modify Files Content During Installation

I have some data files need to be modified after copying into target machine. For this, i create two custom action.

The first custom action is to run the installscript that will modify the content of the files after copying into targetdir. The second custom action is to remove the files during uninstallation.

Here i try with two types of first custom action (InstallDataFiles):
1.
Return Processing : Synchronous(ignores exit code)
In-script Execution : Immediate Execution
Execution Scheduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After InstallFinalized
Install Exec Condition : &feauture_name=3 AND NOT Installed

Admin UI Sequence :
Admin Exec Sequence :
Admin Exec Condition :
MSI type number : 65536

> As result, the installsript is not run. The last dialog displayed during installation showing "The wizard was interrupted before [ProductName] could be completely installed. Your system has not been modified....". The same dialog displayed when I run the wizard for uninstallation.
> Somehow, I found that the files is in the installed in target machine, but not modified.
> The dialog shows that the installation not complete, but why the files is installed and I could run uninstall in later time.

2.
Return Processing : Synchronous(ignores exit code)
In-script Execution : Deferred Execution in System Context
Execution Scheduling : Always execute
Use 64bit : no
Install UI sequence :

Install Exec Sequence : After Install Files
Install Exec Condition : &feauture_name=3 AND NOT Installed

Admin UI Sequence :
Admin Exec Sequence :
Admin Exec Condition :
MSI type number : 68608

> Same end dialog display during installation, but the files is not installed in target machine.
> I think this should be more appropriate sequence for the custom action. However, the installation is not succeed.

Please tell me how could I create the custom action to modify the files content after files copied into target machine. I am pretty sure that the installscript has no problem, as I could run it in another setup before.

Thanks in advance.
Labels (1)
0 Kudos
(7) Replies
RobertDickau
Flexera Alumni

The first thing to keep in mind is that files aren't copied or deleted until deferred execution, so you might change your actions from immediate (when MSI is creating its to-do list) to deferred (when it's carrying out its to-do list)...
0 Kudos
LKM_N4EN
Level 6

Thanks RobertDickau for reply.
You could see that in my second custom action, I am using:
- In-script Execution : Deferred Execution in System Context

This still not working..

I am wondering how could this error occur. So I try to just call the same custom action, but this time the installscript only showing an information messagebox. Again, the same error happened.
0 Kudos
LKM_N4EN
Level 6

The problem is with any custom action I created.
For testing, I create new project with one feature and one component and no files. Then I have one installscript function just to call "Messagebox (szMsg, INFORMATION)". This function call using a new installscript custom action with immediate execution after installFinalize.

Again, the same error. Here is the log file, please have a look and discuss.
InstallShield 9:51:38: CallScriptFunctionFromMsiCA() ends
Action ended 9:51:38: NewCustomAction1. Return value 3.
Action ended 9:51:38: INSTALL. Return value 3.
MSI (s) (50:AC) [09:51:38:702]: MainEngineThread is returning 1603
MSI (s) (50:24) [09:51:38:702]: Destroying RemoteAPI object.
MSI (s) (50:14) [09:51:38:734]: Custom Action Manager thread ending.
MSI (c) (94:B0) [09:51:38:734]: Back from server. Return value: 1603
MSI (c) (94:B0) [09:51:38:734]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (94:B0) [09:51:38:734]: PROPERTY CHANGE: Deleting SECONDSEQUENCE property. Its current value is '1'.
Action ended 9:51:38: ExecuteAction. Return value 3.
MSI (c) (94:B0) [09:51:38:734]: Doing action: SetupCompleteError
Action start 9:51:38: SetupCompleteError.
Action ended 9:51:39: SetupCompleteError. Return value 2.
Action ended 9:51:40: INSTALL. Return value 3.
=== Logging stopped: 9/9/2008 9:51:40 ===
MSI (c) (94:B0) [09:51:40:015]: Note: 1: 1708
MSI (c) (94:B0) [09:51:40:015]: Product: customaction-test -- Installation operation failed.

MSI (c) (94:B0) [09:51:40:015]: Grabbed execution mutex.
MSI (c) (94:B0) [09:51:40:015]: Cleaning up uninstalled install packages, if any exist
MSI (c) (94:B0) [09:51:40:015]: MainEngineThread is returning 1603
0 Kudos
LKM_N4EN
Level 6

The problem solved now.. It is because I passed the incorrect argument to the installscript function 😮 😮 😮

But my Install Exec Condition seems not correct. I want to remove the files when feature2 is uninstall, so I put the condition:
Install Exec Condition : !feauture2=3 AND Remove="ALL"

However, the custom action is not launched during uninstallation.
0 Kudos
RobertDickau
Flexera Alumni

Keep in mind that property names are case sensitive: perhaps try REMOVE="ALL" instead of Remove="ALL"? And if you care only about a feature being uninstalled, perhaps leave out the REMOVE part and just use something like:

(&YourFeature=2) AND (!YourFeature=3)
0 Kudos
LKM_N4EN
Level 6

Hi RobertDickau, you really help me a lot. The exec condition now is working as what I want after change it to (&YourFeature=2) AND (!YourFeature=3).

Thanks a lot.:D
0 Kudos
clintontull
Level 3

Im trying to get a custom action to run at active setup.
My custom action is a vbs file.

install exec sequence - AfterPublishProduct
Install Exec Condition - Not Installed

Stub path for Active setup in registry it does run but the CA is not executing at active setup.

the StubPath Reg key for active setup is - msiexec.exe /fauvs [ProductCode] /qn

How can i get this to run the custom action at logon.

I think i resolved this now.
I used a custom action of Not Installed OR Installed
0 Kudos