06-11-2015 01:46 PM - edited 06-11-2015 01:50 PM
So I've got a functioning VI that works just fine in Windows 7. However when I created an installer and installed it onto a target XP PC I get a "Choose file to write" pop up during execution - something I didn't get in Windows 7. I've attached the VI. Any ideas?
EDIT: The pop-up comes after the while loop.
06-11-2015 02:24 PM
I suspect that Windows XP might not recognize your Path, which you have specified as "%userprofile%\desktop". I'm trying to fire up an XP machine now to test this out ...
Bob Schor
06-11-2015 02:33 PM
Nope, it may be more subtle than that. There is a %USERPROFILE% in Windows XP (I don't think capitalization matters). I tried (from a command prompt) the command -- dir %userprofile% -- and got an error message. Then I recall that the User Profiles in XP are stored in the folder Documents and Settings, while in Windows 7, they are in Users. So I tried -- dir "%userprofile%" -- and it worked.
Not sure why embedded spaces matter for the File Dialog function, but if it is calling on Windows, it might make a difference ...
Do let us know if this fixes your problem!
Bob Schor
06-11-2015 02:35 PM - edited 06-11-2015 02:38 PM
^I just tried that command in a run window and it worked. Also, the first dialogue I get in the VI points to the default directory of desktop successfully. So I think it's reading the path fine.
EDIT: I just saw your second response, I will get back to you.
06-11-2015 04:14 PM - edited 06-11-2015 04:16 PM
Unfortunately adding the quatation marks did not work. I feel like it's picking up the path fine, but somewhere after the loop it's messing up. As expected, everything is working in Windows 7.
06-11-2015 04:44 PM - edited 06-11-2015 04:47 PM
I'm pretty sure the problem is with this part of the code (see attachment). I've added indicators for the paths and they seem to be fine. But for whatever reasons it works in 7, but not in XP. Is it possible that XP doesn't like the filename I'm using? Here is an example of one: "pressure_data_2015-06-11 2 40 46 PM.txt"
06-11-2015 05:20 PM
I don't know of a reason that name would be "bad", but I suppose anything iis possible. Something you might try is to simply create the name "Test.txt", no spaces, in your code and see what that does. Do you know about the Diagram Disable structure (on the Structure palette)? You can drag a box around the code that creates the file name, it will "grey out" (Disabled), and you can put "Test.txt" in the Enabled side. To undo, be sure the original code is "visible" and choose "Remove Diagram Disable" (right-click the diagram first ...).
BS
06-12-2015 11:34 AM
Fixed it! Turns out using the Date String block with "%c" on Windows 7 uses "-", but on XP (for whatever reason) it uses "/". And of course the "/" character isn't allowed in a filename, hence the pop up. I just replaced the character with a "-".