I'm using the following code to remove the read-only attribute from a group of ini files across multiple subfolders. This is done in my script, OnFirstUIAfter specifically:
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Attrib syntax for Vista installations?
Started by
irongun324
, Jul 30 2012 22:15
4 replies to this topic
Posted 30 July 2012 - 22:15
CODE |
//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); MessageBox(szMessage, INFORMATION); endif; |
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,
Trey
Posted 31 July 2012 - 11:43
If it were a syntax change in Vista, then it wouldn't work from the cmd prompt eitehr, right?
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?
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?
Stefan Krüger
InstallSite.org twitter facebook
Posted 31 July 2012 - 19:48
I do see the window flash, but it's fast enough I can't resolve any messages before it's gone. Is there a way to have it hold the cmd window open? One of my concerns with syntax was that I can type it properly manually, but the installscript was formatting something just a hair off.
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.
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
Not sure if you could redirect the output to a file.
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?
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?
Stefan Krüger
InstallSite.org twitter facebook
Posted 05 August 2012 - 13:47
If you're referring to the debugger in InstallShield, I tried but other factors of my installation don't work on the PC that has IS. I was going to make a demo build just for this and try then.
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.
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.