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
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)
Please log in to answer
Posted by:
AngelD
16 years ago
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_
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
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
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.
so that the conversation will remain readable.