I change $APPDATA$ to reference our application specific folder:
Code: Select all
Get Common Folder Location System->Application Data Directory into APPDATA
Set Variable APPDATA to $APPDATA$MedEvolve
Here's the CREATE FOLDER code snippet:
Code: Select all
if Variable SUCCESS not Equals ERROR
if Variable SUCCESS not Equals CANCEL
MessageBox: ProgramData, $APPDATA$
Create Folder $APPDATA$
end
end
Here's the DLL code snippet:
Code: Select all
MessageBox: ProgramData, $APPDATA$
Set Variable DIRRESULT to
Call DLL Function $WINSYSDIR$\kernel32.dll->CreateDirectoryA (get result into variable DIRRESULT)
MessageBox: DirResult, $DIRRESULT$
In both scenarios, the message box contains the expected folder name:
C:\ProgramData\MedEvolve
I'm using 9R2 and testing in Windows 8.1. I have not tested in earlier versions of Windows because I need this to work in all versions.
To further complicate testing, when I run the install via the IDE, I often see this message:
---------------------------
Windows Installer Error Notification
---------------------------
The following error occured while applying changes to system:
This installation is forbidden by system policy. Contact your system administrator
Please review your installation commands.
---------------------------
I have no idea why this occurs. The installer never gives this error when I run it outside of the IDE. My Windows account has admin rights. I've set Windows 8 UAC settings as low as I can. The installer is configured to Always Elevate. Note this is not the configuration that I want to use in the end, but rather where I am while troubleshooting this issue and trying to find a solution. If I open an elevated command prompt, I can MD C:\ProgramData\MedEvolve and successfully create the folder.
Any suggestions?