Installing or Copying Files Depending on the Drive Availability Using WiseScript Editor

Installing or Copying Files Depending on the Drive Availability Using WiseScript Editor
WiseUser's picture

Scenario: If D drive is present then the application should install in D drive instead of the primary active drive.

Solution: This can be done using the system search function in Wise Package Studio.

Step 1: We can set a variable VARDIR to Null in properties section.

Step 2: In System Search choose search type : File \ Directory, Property Name as VARDIR, Search Value as D:\.

Step 3: Write a Set directory Custom action that sets the installdir to the install dir, say D:\apps\CATS and set the condition as VARDIR<> NULL.

VARDIR variable gets the value as D:\ when D drive is present and writable, hence the application will install the files to the said drive D:\apps\CATS.

If it returns NULL, meaning the D drive is absent, then the install dir will be the primary drive. That will be c:\ in most of the cases.

3.59524
Average: 3.6 (42 votes)