Quick question really, I have a new SCR file to replace an existing one. I have created a vbs script to check to see if the file exist then deletes the old one. Then the MSI installs the new one, done and dusted.
Question is that the VBS script runs when I uninstall it, where do i put the script in the MSI Script section so it does not run when uninstalling.

Also I would like the script to check to see if the OS is NT or XP then puts the new SCR in the correct place ie.
C:\Windows\System32 for XP
C:\WINNT\System32 for NT

At the moment I have two IF statements that put it in either directory

Cheers all
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Quick question really, I have a new SCR file to replace an existing one. I have created a vbs script to check to see if the file exist then deletes the old one.
Why not use RemoveFile with InstallMode=msidbRemoveFileInstallModeOnInstall to remove any existing instead of a vbscript?

Question is that the VBS script runs when I uninstall it, where do i put the script in the MSI Script section so it does not run when uninstalling.
Use a condition of NOT Installed to only execute the CA during install.

Also I would like the script to check to see if the OS is NT or XP then puts the new SCR in the correct place ie.
Use SystemFolder as Component.Directory_
Answered 08/06/2008 by: AngelD
Red Belt

Please log in to comment
0
Hi,

Regarding the script to find whether the operating system is Windows XP or NT, you can read the value from the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName by using the objShell.RegRead() method. Either you can fetch this value and populate in a property to control the installation of the file or you can specify hardcoding. Your choice.

Regarding the uninstall problem, you can use the If NOT Installed condition to make sure that the VBScript based custom action executes only while installing.

Tip: In case you wish to execute a custom action only while uninstallation, use the condition If REMOVE=ALL then .... ;-)

regards,
Tushar
Answered 08/07/2008 by: matrixtushar
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity