Windows 10 IoT Raspberry Pi 2: Autostart published Application - iot

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

Related

Error 1001 when installing custom Windows Service

I wrote a windows service that runs on Framework 4.0 and running in VS 2015.
I also created a setup project (free Installshield version).
My service did not show under services.msc after I installed it, so according to some other posts I had to mark the Primary Output in InstallShield as 'Installer Class', but when I do that I get Error 1001 when I run the setup.exe.
This post states that "Error code 1001 ALWAYS means a failure in the Installer class custom action." and that I should not use Custom Actions. I'm not using any custom actions at the moment.
Most of the solution on this site have instructions for Installshield 2010, and the steps does not work for 2015.
The error appears on both my dev machine as well as all client machines.
Any suggestions?
EDIT:
The event viewer displays "Failed to create restore point (Process = C:\Windows\system32\msiexec.exe /V; Description = Installed My App Name.; Error = 0x80070422).
I had this exact same issue. Suddenly after upgrading to VisualStudio 2013 and the newer InstallShield LE and building my installation packages they would fail with the cryptic 1001 error.
Definitive Answer
I found the definitive answer. You can no longer have the checkbox for "installer class" selected in InstallShieldLE. You must uncheck that item.
In order to open this dialog box, go to Specify Application Data > Files and right click on your Primary Output and select Properties.
Previously, You Had To Have It Selected: Now It Must Not Be Selected
Previously (Visual Studio 2012 and before you had to have that item selected or the service installation would fail. This is quite terrible.
Now, you have to go to following tree item in the InstallShield LE project and double-click the Services node:
After that the Services item appears on the left (have I mentioned what a terrible UX and UI this entire thing is?) and right click it so you can add the service.
Choose the menu item which appears to add the service and you'll get a form which allows you to set up the installer details.
Once you do that and rebuild your MSI will work and this will resolve the 1001 error.
This was all a terrible waste of time that the original InstallShield Devs could've resolved. Unfortunate.
If you have .NET 4.6 installed on your build machine, you'll need the 2015 version of the limited edition to avoid a versioning bug with InstallShield's support for Installer Classes. (There are many causes for a 1001 error, so this is not a guaranteed fix.) Note that InstallShield 2015 Limited Edition does not support the community edition of Visual Studio.
Hopefully this will help some of you encountering the Error 1001 when trying to install a .NET Windows Service using InstallShield 2015 LE installer project with the Primary Output set as an Installer.
It's a known bug when .NET 4.6 is installed on Windows 10.
https://flexeracommunity.force.com/customer/articles/en_US/ISSUE/HOTFIX-Install-Fails-With-Error-1001-When-a-NET-Installer-Class-Component-is-Present-in-InstallShield-2015-SP1
Since i cant comment yet i will just reply with an answer to your own accepted answer. I know it has been a while since you asked the question but here goes.
If you want auto start after install you can go to step 3. Configure the Target System. Choose the Services tab. Right click Services and add Service. You should be able to locate any service in your Primary Output. Once added you can select different settings related to auto start and so on. Hope it helps you.
On a side note, i am still looking for the answer to my 1001.
This error occurs when targeted .NET framework is not installed.
If you are targeting the same development machine then please check if that service (EXE) is already running on that machine or not (It should not running).
I found something to get rid of the problem, but it does create a new question, albeit a much simpler and less critical one.
What caused my problem is that I had to remove the following code from my ServiceInstaller's AfterInstall:
new ServiceController(ServiceInstaller.ServiceName).Start();
This was added to auto start my service once it has been installed. For now I will just manually start the service.
I am using VS 2012 with InstallShield LE 2015 targeting .NET 4.5 and I have to uncheck the "Installer class" for it to work.
After some digging I found out that the installer fails with that error when it tries to remove the service (associated with whatever you are installing) - AND (the service) is not there anymore.
My use case scenario - Start install from MVS2015 of a complex solution that comprises also a windows service.
When you change the version of the solution, the installer stops in its tracks finding that the your app was installed before and can not uninstall it as it is a different version. It pops up a dialog box stating this and exits .... BUT IT HAS UNINSTALLED the service.
Now trying to install or uninstall fails with the error 1001 because windows doesn't find the service to uninstall it.
If somebody has a better solution please post it, but my solution is to use sc command line utility. sc is a utility that can be used to manipulate services from the command line (type sc for help). So i use sc to add the service (by name), and then I can do uninstall, or install as usual. Is compulsory to have a valid bin path in command - but ANY valid path will be accepted.
sc <server> create [service name] [binPath= ] <option1> <option2>...
Example:
sc create MyService binPath= C:\Windows\explorer.exe
[SC] CreateService SUCCESS

Multi-Device Hybrid Apps for Visual Studio: ripple emulator doesn't start

I have the same problem like Fabio in this post. Unfortunately I can't add answer. I know that problem can be connected with white space in my user name. Can I change path from "c:\users\forename surname...", to "c:\users\forenamesurname..." ?
To change your username, I suggest creating a new user with the desired name. As far as dependencies are concerned, in case you used the Multi-Device Hybrid Apps installer for all your dependencies, here are the changes to be made:
Create a new user and login
Go to Control Panel -> Programs and Features
Uninstall Android SDK
Download the Android SDK again from here.
Install it choosing "Install for all users on this machine"
Install the following packages in the Android SDK manager:
Open your system Environment Settings:
Change the ADT_HOME to: "C:\Program Files (x86)\Android\android-sdk" (or if you chose a custom install directory)
Everything should run as expected now.
Yes, renaming your profile folder should work. Be sure to update any environment variables and paths accordingly.

How to edit Windows Phone Emulator Image hosts file?

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

BlackBerry Simulator not reflecting code changes - needs restart for every change

I am using BlackBerry SDK 5.0.0.36 on eclipse
whenever i am doing any changes i need to restart the simulator
i want to run simulator only once and dont wanna restart it again n again for little changes
i refer to this thread in stackoverflow.com -> "View changes without restarting Blackberry simulator?"
i follow the given procedure in above thread but still my simulator not making it
i also tried it in BlackBerry SDK 6.0 and 7.1 . . .but i am still fighting with same problem
As Mister Smith says, this functionality is not highly reliable. Sometimes it works, and sometimes not.
However, one fixable problem that I encounter somewhat often is that permissions on the JDE plugin folders get restricted so that the BlackBerry simulator cannot write out the proper files to perform hot swapping.
I can often fix this in Windows explorer by going to the root folder for Eclipse (you could probably just go to the JDE plugin folder, if you're concerned about opening up permissions too much). In Windows Explorer, right-click and select Properties. I then uncheck the Read-only checkbox. Then, use the Security tab and make sure that your user account has Full control for that directory, and all of its subdirectories.
I will usually also just transfer ownership of the entire Eclipse directory tree to my user account (e.g. HOSTNAME\username). Do that with the Advanced button on the Security tab.
Also, have a look at this question/answer and this BlackBerry support forum thread on the topic of hot swap file permissions

XNA 4.0 ClickOnce game does not run after installation

Okay, I have been looking all over to solve this problem before I actually broke down and decided to finally ask for my psecific problem. I am using ClickOnce installation and when I use the setup.exe to install nothing runs, not even on my personal computer that I know has all of the proper libraries and such. I'm not sure what I am doing wrong so it is difficult to explain the problem.
I have included dotNetFramework4.0 client x86 x64 , xna redistributable 4.0 and windows installer 3.1 along with my game and I have it set to install all of that with setup , also I have it set to download prereqs from same location as application. I've tried it on three separate computers , one that does not have XNA or VS C# installed and the same problem occurs.
Here is the problem , after I install the game nothing runs, I try clicking on the ClickOnce application file (the one with my game's icon image) and again nothing happens. The thing that really bugs me is that there isn't any errors or crashes or anything , it's almost like clicking on the desktop screen. (I looked at the properties of the "shortcut" that was installed with the game and the file size of the shortcut is like 300 bytes. Isn't that really small? I was thinking maybe there is a problem with a startup executable? I'm not sure though.)
I've tried tweaking some stuff in the Publish section of my project , such as un-checking the box that says "use .deploy extension files" (I don't know why, I've been grasping at straws here) I've been looking into some other installers such as NSIS but I don't know how to compile a list of files to include in other installers and I feel like that won't solve the problem anyway because I've gotten ClickOnce to work with me before.
On one computer there was an error report that said something about 'deployment and application do not have matching security zones.'
Game.application resulted in exception. Following failure messages were detected:
+ Deployment and application do not have matching security zones.
It's getting late so if I need to provide more information let me know.
ClickOnce can be a fickle thing. There are times that I've had errors occur that could only be solved by recreating an entire Windows user profile. Because there are so many different options for ClickOnce, it's going to be hard for me to diagnose your exact issue, so I can only offer what options I used to successfully install via ClickOnce.
Publishing Folder: local folder
Installation Folder URL: blank
Install Mode: offline
Application Files
Make sure the Publish Status of your game files is set to Include (Auto)
Make sure the Publish Status of the XNA libraries is set to Prerequisite (Auto)
Click Prerequisites
Microsoft .NET Framework 4 Client Profile
Microsoft XNA Framework Redistributable 4.0
Windows Installer 3.1
Do not check for updates
Everything else default under Options (publisher/suite name shouldn't affect anything)
Specify the version number
Publish Now
Install the game through the setup.exe provided in the publish location. I always distribute every file that is publishes. However, you can clean up old versions in the "Application Files" folder if you don't want the history to be distributed.
You can double check the "Application Files" folder to see if your version got published correctly (look at the files that were deployed and see if they match your project contents).

Resources