Attrib syntax for Vista installations?
Posted 30 July 2012 - 22:15
//Remove Read Only attribute from .ini file
szExeCmd = WINSYSDIR ^ "attrib.exe";
szNewDir = "<DIR>\\*.ini";
szCmdLine = "-r \"" + szNewDir + "\" /s";
// ^^ note above adding the quotes to the directory name so that if there are spaces in the directory name it will still be handled!!
nResult = LaunchAppAndWait(szExeCmd, szCmdLine, LAAW_OPTION_WAIT);
if (nResult < 0) then
Sprintf(szMessage, "Could not execute attrib.exe on the UI\ directory and files.\nAfter installation, remove the READ-ONLY attribute from %s\nand all of the files and subdirectories below it.\nContinuing with the installation.", szNewDir);
I've since lost my source of the above, but it worked great on XP destination PCs, and now is not working on Vista Enterprise PCs. I am running under an Administrator account, and can manually use attrib from a cmd prompt, and can create a batch file to do this, but the InstallScript version doesn't work anymore. Thoughts? Is there a syntax change in Vista now?
Thanks in advance,
Posted 31 July 2012 - 11:43
Does your LaunchAppAnWait get launched at all (do you see the command window)? Can you see the output from attrib in the command window?
Does it work if you turn off User Acount Control?
Posted 31 July 2012 - 19:48
I can double check on UAC in the meantime.
EDIT: UAC already disabled. I thought that might be the case (as we do not get confirmation prompts) but checked anyway.
Edited by irongun324, 31 July 2012 - 20:24.
Posted 05 August 2012 - 11:51
Or (for testing) launch a .bat file instead, which you can have pause so you can see the output.
Did you use the debugger to see the actual strings? Or a MessageBox?
Posted 05 August 2012 - 13:47
I also thought about launching a .bat file, but I know a bat works (via double-click) unless it's some odd permissions issue in IS. Don't know yet. Will try both things when I'm back at work.