/build/static/layout/Breadcrumb_cap_w.png

Screensaver

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

Answers (2)

Posted by: AngelD 16 years ago
Red Belt
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_
Posted by: matrixtushar 16 years ago
Purple Belt
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ