How to edit Windows Phone Emulator Image hosts file? - in-app-purchase

I am developing a Windows Phone App and i wanted to test In-app Purchases functionality in my app.
Microsoft Provides a webservice to test IAP but since the os automatically connects to Windows Phone Store, there's no way to test if the application is handling the IAP properly
How can this be done?

I Found this while preparing my environment for this purpose:
There is a folder in the computer where you can find the .vhd files of the Virtual Machines used to emulate Windows Phone.
C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images
Here you can find all the Emulator Images:
Remove Read Only Attribute from the VHD file you want to edit:
Mount VHD file (Windows 8 or above is done by simply double clicking the file or opening it with explorer)
After doing so you should see 5 extra partitions
2 of those partitions are system partitions
you can identify them because they have between 15% and 40% free space
From those 2 partitions the one we care about is the partition witch contains Users Folder.
Now we must go to the following path:
YourDriveLetter:\Windows\System32\DRIVERS\ETC
in this file we must set the mapping
yourmachineip marketplaceedgeservice.windowsphone.com
192.168.1.109 marketplaceedgeservice.windowsphone.com
Save the file and eject the first partition
Now you're done with configuring the Mapping
this of course is useless if you haven't configured your machine to use the WebService provided by Microsoft to test IAP

Related

VirtualStore for delphi application

I use opendialog to load file to application path . is there any way to load the file to %userprofile% > AppData > Local > VirtualStore > Program Files > MyApplication Folder, it is because users should not see the the loaded file
Windows will automatically show applications the "VirtualStore" files for old applications. This is done to try and make sure that old applications build before UAC continue to run correctly. To turn off this behavior you need to add a application manifest to your program. This will make windows turn off the VirtualStore behavior both for files and registry entries.
Here is a good page that describes what is happening in detail:
http://www.codeproject.com/Articles/17968/Making-Your-Application-UAC-Aware
The manifest is an XML resource file that can be embedded into the application. In terms of UAC, this serves 2 purposes. Firstly it tells the operating system that the application has been designed with UAC in mind, and that it therefore should not attempt to virtualize any folders or registry settings. If the application still attempts to access protected resources after making its declaration, then these requests will simply fail rather than virtualize. The other thing it does is allow the application to state the privilege level at which it needs to run, and whether it requires elevation.
There are several questions already on StackOverflow that deal with creating and adding an application manifest to Delphi 7 projects. Here is one link to get you started:
Delphi 7 vista / windows 7 manifest
Once you tell windows that you know about the new version of Windows via the manifest you will need to make sure that you are playing by the new rules and don't write data back to any of the protected locations.

Windows 10 IoT Raspberry Pi 2: Autostart published Application

I'm starting making experience with the Raspberry Pi 2 Development with Windows 10 and I was wondering how can I configurate the Raspberry Pi 2 to autostart my own published application, I developed in Visual Studio? And furthermore: How can I set up time & Region on my device?
Thank you so much for all helpfull and well meant answers.
Use IotStartup.exe by Power shell.
IotStartup list -> Find out your app name.
IotStartup add [YourApp] -> Add App init startup.
Reboot.
I was looking at how to do this myself this evening. What I found was that you can edit the Pi's startup through Powershell on your PC and tell it what app to load.
Setting startup app:
Use the startup editor to configure startup apps on your Windows IoT Core device. Run Startup with any of the following options:
Startup /d displays the list of startup apps.
Startup /a [name] [path] adds an app with name name located at path path to the list of startup tasks.
Startup /r [name] removes an app with name name from the list of startup tasks.
For further help, try startup.exe /?
http://ms-iot.github.io/content/win10/tools/CommandLineUtils.htm
As far as region settings, you can do that while loading up the default screen on the Pi. When you get to the Windows screen, there is a gear icon in the lower right that will bring you there. Unfortunately, there isn't a real time clock built into the Raspberry Pi, so you'd have to add one (hardware) or pull it from the internet.
Something to be warned about.
At the current version, by default Visual Studio generates a random package name for your application, regardless your Project Name. My project's name was HelloWorld but it generated a totally different package name.
The name is a random guid and it is being deployed by that name. You can change that name at Project Properties screen. In this example the package name goes as 7e3bb987-a1b9-4a67-9750492af7c7.
When I remotely connect and run iotstartup list I see that my package is there with that guid name.
I spent some time to find which app is mine, so I wanted to give heads up to others who might encounter the same. Just rename your Package Name to whatever you want and you'll be fine.
The world's easiest way to accomplish this is the following order:
open your browser
Go to > http://your_RPI2_IP:8080/AppXManager.htm
deploy your App from Visual Studio 2015 with configurations as seen here
3.1 to get this screen go to: project --> Properties --> Right click --> Open
4 after succesfull deployment select your startup app in the webManager and your RPI2 restarts

How to test reading of files in Blackberry Ripple Emulator

I am attempting to build an app that needs to read .epub files on a Blackberry using WebWorks. However, using the Ripple Emulator I'm able to access the directory structure in blackberry.io.dir but I wanted to make a file available to be read so I can test the loading of a file.
I assume the folders like file:///SDCard are not physical folders but is there anyway I can copy a file from my local machine to this folder so I can begin testing.
I tried using local:/// but this is not returning anything.
It depends on what OS you're on but this answer talks about Mac OS: Where does PERSISTENT file system storage store with chrome?

Why does my program say "folder does not exist" when run on Windows 2008?

We have a Delphi program whose task is like a service program. It watches a particular folder for a certain period, and it works great on Windows XP and 2003, but on Windows 2008r2 64bit, when it wants to create an automatic folder, it will show this message:
The ... folder does not exist. The file may have been moved or deleted.
This message causes the program to halt, which is not good; it should not be interrupted.
What can I do about this?
P.S.: I really don't have any idea whether to post my problem in Stack Overflow or Server Fault, so I've guessed it should be here.
It's likely the VirtualStore, if you're trying to store beneath Program Files (either one). See my writeup:
http://www.clipboardextender.com/off-topic/vista-program-files-hide-and-seek
You've left out the ... folder name. While that's understandable, it wouldn't happen to have anything to do with program files (which on x64 will be split in 2 directories) would it?
Windows Server 2008 is able to use 'virtual' file pathes. That means: 'what you see is not what you get'. The Windows Explorer just shows you the 'display' name. Check the file path with cmd.exe, if the path you are trying to use does realy exist.
The reason is of cause the File Virtualization (see for example http://msdn.microsoft.com/en-us/library/bb756960.aspx and http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx).
Because we on stackoverflow.com and not on serverfault.com I want add to all other answers that you can use Wow64DisableWow64FsRedirection, Wow64RevertWow64FsRedirection and Wow64EnableWow64FsRedirection functions (see http://msdn.microsoft.com/en-us/library/aa365743.aspx) to control the File Virtualization in your program. An example of the usage of this functions in C# you can find here http://www.pinvoke.net/default.aspx/kernel32.wow64disablewow64fsredirection.
You'll need to tell us the exact path and how do you go about constructing it. It can be as simple as the app not using env variable expansion but assuming that user's folders are where they were before.
Path virtualization (there are 2 kids actually) that people mentioned will hit you only if your app is trying to mess with system folders.
More puzzling problem will hit you if you are not expanding env vars like APPDATA, LOCALAPPDATA etc. and not expecting that there's more of them on Win7 and 2k8. Not only that default paths of user's files changed but some of them can also be on network shares - for the same user. So if you were running based on expectation that all user's stuff will be at definite paths under say %USERPROFILE% you can get hit by several surprises. Also notice %ProgramData% .
Fastest way to find out - open cmd.exe, run set and if you see some paths that you are constructing in alternative ways, take notice that you need to start expanding env vars for them. Then open cmd.exe as a 32-bit app and check set again. You can also pick them up via Process Explorer from some running 32-bit or 64-bit app.
Switching your app to 64-bit build will resolve most of virtualization issues but not the env var expansion. Also if your app is touching system folders you need to request elevated run from the code or even better make the manifest and declare it there. Then OS will yell at user up front if his UAC is on and your app will avoid that 2nd virtualization. BTW, virtualization is controllable via group policies so it might be present on some boxes and missing on others.

IDAPI , BdeAdmin and Windows 7

After many months of postponing it, this week, I finally started using a new Windows 7 Professional PC for actual development (which is 90% still done in Delphi 7 with some of these programs still using the Borland IDAPI to access Paradox files). The previous development pc was still an XP-one.
Every thing works except for one thing: somehow the settings of the IDAPI and BdeAdmin configuration files are messed up or they are read/written in different locations. To be more precise, it looks like two configuration files are active.
It must have something to do with rights or settings being read/written in the wrong folder or registry setting, but after searching for it for a couple of hours, I give up.
Anyone had any problems with this, before ? And if so, hopefully, has any one solved this problem ?
Thx for any thoughts/solutions ...
My guess is it has something to do with the fact that Vista and Windows 7 don't allow programs to change files under the C:\Program Files folder. They create a copy of those changed files in a virtual store, the process is known as virtualization. The copies end up in the hidden appdata folder of the user account and can be found in the Local\VirtualStore\Program Files folder. The structure in that folder reflects the one in the actual Program Files folder.
Programs that access their files in the Program Files folder using a "hardcoded" path, will always get the original - unchanged - file contents.
Solution: running the apps in a virtual XP system or upgrading the apps is probably your best bet.
You could try to run the apps elevated. That is: right click them and choose Run as Administrator. Please note that it isn't enough to be logged in as an administrator. Even administrators run all processes unelevated by default. Instead of right-clicking, you can also create a shortcut and set the Run as administrator for the shortcut - the checkbox for this is on the compatibility tab of the properties dialog. No guarantees though that this will alleviate the problem.
Since IIRC D7 setup allows you to configure paths in multiple ways, maybe simply do a reinstall outside "program files"?
Afaik this solves several vista/w7 problems.

Resources