/build/static/layout/Breadcrumb_cap_w.png

how to call scripts right before end of installation

Hello,
I'm new to packaging and could use your help.
I want to call a script (cacls for changing file permissions) right before the end of an installation. This question comes from a previous post from "oliver" about changing file permissions. From that post, I think that a cacls script is the best solution for me to change file permissions but I don't know how to add one to a package.
This is an example of the script I'd like to run:
"cacls "c:\Program Files\newpackage" /e /g everyone:f"
and I found this quote on another website:
"You can place this in a Wisescript and call it in the Execute Deferred section just before InstallFinalise."
Can someone tell me more specifically how to do this? I can't seem to figure it out on my own.

Thanks

0 Comments   [ + ] Show comments

Answers (4)

Posted by: jbonbright 19 years ago
Senior Yellow Belt
0
This is assuming you're using Wise Package Studio 4.x or 5.x:

In Windows Installer Editor (WIE), opened to the WSI you want to add the Wise script to, go into the MSI Script part of the editor (your other choices are Installation Expert and Setup Editor.) Click on the Execute Deferred tab and scroll down to the very bottom. Drag the "Run WiseScript from Installation" action to just above the last remark on this page, the one right above "InstallFinalize." You'll see a dialog box with two tabs; unless you're doing something different than the way I do it, you won't need to do anything on the "Properties" tab, so just stay on the "Details" tab. Type in something descriptive in the "Custom Action Name" field if you want, doesn't matter what, then click on the "Options" button. Click on "Browse for WiseScript" and select your Wise script. Finally, add any necesary commands in the "Command Line" field, though I usually don't do that, instead I let the Wise script take care of that. Click "OK."

You can also do a "Run WiseScript from Installed Files" if you prefer, though that of course entails leaving the Wise script EXE on your target machine. It will also create a component that you should remove the key path for.

If that single cacls command line is all you need to run, you could also just choose "Execute Program from Installation" (or, again, "...Installed Files"), then put the cacls switches, etc. in the "Command Line" field in the dialog box.
Posted by: cdorhout 19 years ago
Senior Yellow Belt
0
Awesome!! That worked. Thanks! Although now...
When I try to package the wise script .exe into my package (b/c I don't want to have to rely on a mapped drive to a server somewhere), I get this error: Internal Error 2919
On Google, I find that this error refers to not having a cab file with the exe.
I get this as soon as I add the permissions.exe into a folder in my package, can you not do that?

You stated that you don't package your wisescipts into the msi, how do you point to them? We deploy software via GPO, so we don't have any drive mappings when the software is being installed at boot.

Thanks for your help!!!
Posted by: jbonbright 19 years ago
Senior Yellow Belt
0
If you do the "Run WiseScript from Installation," you shouldn't need to add the permissions.exe as part of the package. When you select that action and browse for the EXE (which can be anywhere), it should add the EXE to the MSI package when you go to compile.

If you chose "Run WiseScript from Installed Files," you WOULD have to add the file as part of the package. Like the example above, your permissions.EXE WiseScript would be incorporated into the MSI at compile time, but unlike above doing this would also copy the permissions.exe script to the target system, then execute it from there. I've used that option many times too and have not seen your particular error at any time.
Posted by: cdorhout 19 years ago
Senior Yellow Belt
0
Ok, I didn't realize that Wise would add the exe automatically when compiled. That makes sense now.

Well thank you for your help. You helped me out very very much.
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