how to add symbian^3 UID? - symbian

My application is only targeted for Nokia N8 . Can some one please tell me how to add support for Nokia N8 only and displays error if other handsets try to install it. If someone can place the working code and name of the file that needs to be updated. i would be much obliged.
Many thanks in return.

What you are after is detailed in this document. In your package (PKG) file:
#{"DeviceSpecificApp"},(0x20000001),1,0,0
[0x20029A73], 0, 0, 0, {"Nokia N8 UID"}
Where 0x20000001 is your app UID.
If the resulting SIS is installed to any device other than the N8, the user will get a warning "Application not compatible with phone. Continue anyway?"

OK, if it is QT only then you can also do this without hacking the .PRO file. In your .PRO:
symbian {
supported_platforms = "; Application that only supports N8" \
"[0x20029A73],0,0,0,{\"Nokia N8 UID\"}"
# Remove the default platform dependencies
default_deployment.pkg_prerules -= pkg_platform_dependencies
packageheader = "$${LITERAL_HASH}{\"MyAppName\"}, \
(0x20000000), 0, 10, 0, TYPE=SA"
# Add in the new platform dependencies
sisInformation.pkg_prerules = packageheader supported_platforms
}
DEPLOYMENT += sisInformation
Obviously you will need to replace '0x20000000' with your app UID, change the app name and put in the right platform UID

Related

Scrapy spidermon exceptions

I'm trying to setup the basic suite of spidermon monitors as described here I did a quick Google search and also found this. So I made a quick monitors.py, then copy and pasted the code in there.
I then proceeded to do this:
SPIDERMON_ENABLED = True
SPIDERMON_SPIDER_CLOSE_MONITORS = (
'spidermon.contrib.scrapy.monitors.SpiderCloseMonitorSuite',
)
in my settings.py in the scrapy project.
It keeps raising this error:
spidermon.exceptions.NotConfigured: You should specify a minimum number of items to check against
Which I believe I've done (SPIDERMON_MIN_ITEMS = 10 # "SPIDERMON_MIN_ITEMS" - at the top of the file).
What am I doing wrong? I just want to setup the pre-defined monitors and then optimize them later.
Spidermon couldn't find a valid value for SPIDERMON_MIN_ITEMS in the settings. This must be an integer value bigger than zero otherwise it'll throw the error described. SPIDERMON_ADD_FIELD_COVERAGE set is also mandatory in order to use all the monitors available in this MonitorSuite.
In order to run the built-in close MonitorSuite SpiderCloseMonitorSuite from Spidermon project, please confirm if the settings.py file - located in the root directory of your scrapy project - have the variables below:
EXTENSIONS = {
'spidermon.contrib.scrapy.extensions.Spidermon': 500,
}
SPIDERMON_ENABLED = True
SPIDERMON_MIN_ITEMS = 10
SPIDERMON_ADD_FIELD_COVERAGE = True
SPIDERMON_SPIDER_CLOSE_MONITORS = (
'spidermon.contrib.scrapy.monitors.SpiderCloseMonitorSuite',
)

Install driver using InstallShield(USB device)

1) I am trying to register the Dll in Installshield based on the Hardware Info(USB\VID_12C1).
-> I want to know the device ID of the USB device connected to PC.
Then I want to fetch the USB device info into separate file.
-> From installshield I will pass the USB vendor ID to text file
and fetch the USB info.
-> Whether it is possible to do it in Installshield.
The following is the way I am trying to get the device ID:
szProgram = WINDIR ^ "temp" ^ "New" ^ "devcon.exe";
szCmdLine = " hwids *";
nvResult = LaunchAppAndWait(szProgram, szCmdLine, LAAW_OPTION_WAIT);
if (nvResult = 0) then
MessageBox ("ERROR: application created sucfuly", INFORMATION);
else
MessageBox ("ERROR: application", INFORMATION);
endif;
-> While installing the Installer trying to execute "devcon.exe hwids *"
through LaunchAppandwait Api. It will list the number of devices connected
to my PC. I want to save the device list in text file.
ISSUE: -> Unable to store the result in text file.
Please provide some ideas to store the device list into file and fetch
the required device list.
As far as I understand correctly you would like to know if certain device available on the system. For this purpose I would suggest to have a look on DevCon Find command, instead of getting entire list of devices. For example:
devcon find *USB\VID_046D*
If you insist to get the entire list of devices, and want to get it into the file you may look at this answer: Capturing stdOutput and stdError from LaunchApplication. Basically the simplest way is reditecting output into file. For example:
szProgram = WINDIR ^ "temp" ^ "New" ^ "devcon.exe";
szCmdLine = " hwids * > c:\temp\New\hardware.txt";
And in order to parse the file content you would need to get the file content. You may use GetLine or ListReadFromFile functions. The following would be example: OpenFile Example

STATUS_ACCESS_DENIED with CallNtPowerInformation()

I'm trying to get the current processor speeds/throttlings through CallNtPowerInformation() with the ProcessorInformation input:
SYSTEM_INFO systemInfo;
GetSystemInfo( &systemInfo );
numProcessors = (unsigned char)systemInfo.dwNumberOfProcessors;
powerInformations = new PROCESSOR_POWER_INFORMATION[numProcessors];
long status = CallNtPowerInformation( ProcessorInformation, NULL, 0, powerInformations, numProcessors*sizeof(PROCESSOR_POWER_INFORMATION) );
Unfortunately, status is always equal to STATUS_ACCESS_DENIED. I can't find any documentation on why this would be, can anyone point me to some reasons why I would not be able to get the current processor information?
This is running on Windows 8, on a Surface Pro (using Desktop APIs), and I've tried starting VS2012 with elevated permissions to no effect.
It turns out that if I run this code in a Console application, it works, but if I run it inside of a Metro application, it fails. I will ask a new question on how to execute code like this inside of a windows store app.

How can I get stacktrace for Adobe AIR global runtime errors in non-debug mode?

The new version AIR gives us the ability to globally capture run time errors and handle them. The problem is that it doesn't have the stacktrace or any helpful information about the error other than the error id and error message and name. For example it may tell me that a null pointer exception has happened but it will not tell me where or which method or anything. The debug version of the runtime gives us all of that but when the app is deployed to customers it is not running on the debug version so none of the useful information is available. I was wondering if this group has any suggestions on how to enable better logging of errors in an AIR app for better supportability of the product. Any suggestions?
I have a little hack to get line numbers too. :)
make a listener to get uncaught errors. I do it in my main class:
private function addedToStageHandler(event:Event):void {
loaderInfo.uncaughtErrorEvents.addEventListener( UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler );
}
for example my listener with error.getStackTrace():
private function uncaughtErrorHandler( event:UncaughtErrorEvent ):void
{
var errorText:String;
var stack:String;
if( event.error is Error )
{
errorText = (event.error as Error).message;
stack = (event.error as Error).getStackTrace();
if(stack != null){
errorText += stack;
}
} else if( event.error is ErrorEvent )
{
errorText = (event.error as ErrorEvent).text;
} else
{
errorText = event.text;
}
event.preventDefault();
Alert.show( errorText + " " + event.error, "Error" );
}
Add additional compiler argument: -compiler.verbose-stacktraces=true
Create the release build.
now the little hack:
Mac:
Go to the installation location where you have your .app file. Right click and choose show package content. Navigate to Contents ▸ Resources ▸ META-INF ▸ AIR. There you can find a file called hash. Duplicate the hash file and rename it to debug. Open the debug file with some text editor and remove the content. Done now you get the stack trace + line numbers.
Windows:
Browse to its install directory in a file explorer. Navigate to {app-folder}▸META-INF▸AIR▸. Here you can find a file called hash. Duplicate the hash file and rename it to debug. Open the debug file with some text editor and remove the content. Done now you get the stack trace + line numbers.
If you can't find the hash file, just create an empty file without file extension and call it debug.
Tested with Air 3.6!
No way until new version of AIR supports it. It doesn't now because of performance issues, rendering global handler almost useless. I'm waiting for it too, because alternative is logging everything yourself, and this is very time consuming.
The compiler option:
compiler.verbose-stacktraces=true
should embed stack information even in a non-debug build.
About the compiler option.
I develop with IntelliJ IDEA 14. In my build options i have also "Generate debuggable SWF". Maybe thats the reason why its working. Check my attachment.
Grettings

Executable directory where application is running from?

I need to get the path (not the executable) where my application is running from:
System.AppDomain.CurrentDomain.BaseDirectory()
When I run the above statement with & "/images/image.jpg" on my local machine it works fine but when I install the application on another machine it says it cannot find the file and there is a lot of extra path information some.
I just need the directory of where the app is running. I am coding in VB.NET with Visual Studio 2008.
Thanks!
This is the first post on google so I thought I'd post different ways that are available and how they compare. Unfortunately I can't figure out how to create a table here, so it's an image. The code for each is below the image using fully qualified names.
My.Application.Info.DirectoryPath
Environment.CurrentDirectory
System.Windows.Forms.Application.StartupPath
AppDomain.CurrentDomain.BaseDirectory
System.Reflection.Assembly.GetExecutingAssembly.Location
System.Reflection.Assembly.GetExecutingAssembly.CodeBase
New System.UriBuilder(System.Reflection.Assembly.GetExecutingAssembly.CodeBase)
Path.GetDirectoryName(Uri.UnescapeDataString((New System.UriBuilder(System.Reflection.Assembly.GetExecutingAssembly.CodeBase).Path)))
Uri.UnescapeDataString((New System.UriBuilder(System.Reflection.Assembly.GetExecutingAssembly.CodeBase).Path))
---
Edit October 18, 2021:
Sigh... None of the above work if using net5.0 or net6.0 and publishing app as single-file bundle. Best I got now is:
// This will give you the directory but not the assembly
string basedir = AppContext.BaseDirectory;
// Before you package the app as a single file bundle, you will get the dll.
// But after you publish it, you'll get the exe.
string pathToExecutable = Environment.GetCommandLineArgs()[0].Replace(".dll", ".exe");
Dim strPath As String = System.IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
Taken from HOW TO: Determine the Executing Application's Path (MSDN)
I needed to know this and came here, before I remembered the Environment class.
In case anyone else had this issue, just use this: Environment.CurrentDirectory.
Example:
Dim dataDirectory As String = String.Format("{0}\Data\", Environment.CurrentDirectory)
When run from Visual Studio in debug mode yeilds:
C:\Development\solution folder\application folder\bin\debug
This is the exact behaviour I needed, and its simple and straightforward enough.
Dim P As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
P = New Uri(P).LocalPath
You could use the static StartupPath property of the Application class.
You can write the following:
Path.Combine(Path.GetParentDirectory(GetType(MyClass).Assembly.Location), "Images\image.jpg")