Link to home
Start Free TrialLog in
Avatar of DistillingExperts
DistillingExperts

asked on

InstallShield support needed

From the ism file:

1. How to generate a script to execute a .bat file before starting the installation?
2. How to check for the existence of a folder if it doesn't exist, create it?
3. How to make the installation give full access to a folder?

Thank you in advance.
Avatar of David_Hagerman
David_Hagerman
Flag of South Africa image

Try this command in a batch file.

runas /u:machine_name\administrator /p:password /sa "c:\program\program.bat"

This line will kick off the bat file with local administrator rights. - please replace machine_name with the machine name you are running the batch on. For multiple machine create a domain account with the specific rights to the specific folder.

To create the folder use the following command
c:
cd test
mkdir %DATE%
move c:\test\DATA\*.* c:\test\%DATE%

you can substitute the date with any variable you like eg. folder name.. Let me know if this helps?

.Dave
Avatar of DistillingExperts
DistillingExperts

ASKER

I would need to know in InstallShield the steps on how to run the batch files.
if exist "c:\foldername" (
dir c:
) else mkdir "c:\newfolder"
This will create the folder if it does not exist.
What would be the step-by-step in InstallShield in order to create this script? I don't know how to create scripts.
I created it in Install Script but didn't work:
function OnBegin()
begin
     if exist "c:\foldername" (
            dir c:
       ) else mkdir "c:\newfolder"

end;
I don't know installshield, but that will work from the command line.
I am going to try to bump this thread for you
I managed to do it through InstallShield. Create a InstallScript (MyFuction). Create a Custom Actions associated with MyFunction. In Sequences/ Execute insert the Custom Action. The code to generate the folder is:
function OnBegin()
begin
      CreateDir("C:\\Folder");
end;
Now I need itens 1 and 3:
1. How to generate a script to execute a .bat file before starting the installation?
3. How to make the installation give full access to a folder?

ASKER CERTIFIED SOLUTION
Avatar of David_Hagerman
David_Hagerman
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you. It helped.