I would like to force my targetDir directory installation usign QT Installer Framework v. 3.0.
Currently this is my config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>QSSWeb2Board</Name>
<Version>1.0.0</Version>
<Title>QSSWeb2Board</Title>
<Publisher>BQ Educacion</Publisher>
<ProductURL>https://bitbloq.bq.com</ProductURL>
<InstallerWindowIcon>bitbloq</InstallerWindowIcon>
<InstallerApplicationIcon>bitbloq</InstallerApplicationIcon>
<Logo>bitbloq.png</Logo>
<StartMenuDir>Bitbloq</StartMenuDir>
<TargetDir>C:/QSSWeb2Board</TargetDir>
</Installer>
It works well, but I can modify the target dir on the installer. I would like to set a fixed value that cannot be modified.
Self-solution:
On the installer script, adding this line:
currentPage.TargetDirectoryLineEdit.enabled = false;
Try to use installer.setDefaultPageVisible(QInstaller.TargetDirectory, false)
as in http://doc.qt.io/qtinstallerframework/qt-installer-framework-systeminfo-packages-root-meta-installscript-qs.html . Since the default page for the choice of the install directory will not be shown thus, the install directory path will not be modified.
Related
I tried using Dotpeek and ILSpy.Net to decompile (my own code), they failed.
Do I need special obfuscation on distributed binaries of .Net Core 3 self-contained single executable ?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
The single-file exe is really an unmanaged wrapper and ILSpy doesn't support decompiling this. But when you run the exe, it unwraps its contents to a temp folder. So you can find the managed dll there and decompile it using ILSpy.
To find the temp folder, you can use any tool that shows locations of assemblies loaded by a process. SysInternals Process Monitor (procmon) is a good one.
You can setup procmon to filter by your exe name, and when you launch your exe, procmon should show some events for assemblies being loaded from a temp folder:
You can browse to that folder and find your managed dll there. And you can decompile using ILSpy from that location.
I wrote a blog entry: https://eersonmez.blogspot.com/2020/02/ilspy-decompiling-net-core-self.html
I wrote a small dotnet tool after I stumbled upon this question and couldn't find a lightweight tool myself other than ILSpy.
You can install it using the following dotnet command: dotnet tool install -g sfextract.
After installing it, run it using the following command: sfextract application.exe -o output-dir
The bundle format for .NET 5.0 (bundle version 2) is identical to previous versions. .NET 6.0 (bundle version 6) has an additional field for each file entry containing the compressed size, since single-file applications can now be compressed using gzip by setting EnableCompressionInSingleFile to true.
https://www.nuget.org/packages/sfextract/
https://github.com/Droppers/SingleFileExtractor
Update 07/2022: .Net 5 single-file does not automatically unpack to the same temporary location as before. to force it to be unpacked you would need to add the following:
in the project file add these properties (according to theseMicrosoft docs):
<PublishSingleFile>true</PublishSingleFile>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
Add an environment variable DOTNET_BUNDLE_EXTRACT_BASE_DIR with the location you want the files extracted to.
Update: One of the announcements made regarding .Net 5 states that the way single-file executables will be made would change, so this method will not work for them.
I wanted to add on #Eren Ersönmez's answer, that while ILSpy DotPeek don't support this at the time, since the self-contained single file is just a wrapper that contains all your DLLs and gets extracted on runtime, simply knowing where it is extracted to can save you using ProcMon or ProExp or windbg.
If you use windows you can go to c:\Users\{Local Username}\AppData\local\temp\.net\{Name of executable}
which should lead to somewhere similar to
c:\Users\alenros\AppData\Local\Temp.net\MyTestApplication
Launch your exe, and a folder with the same name will be created in that location.
The folder will contain randomly named folders. open the latest one and there you will find all your extracted DLLs, which can then be decompiled.
I have managed to download and build the androidX86 src. When I ran the .iso image on a VM, I noticed that the AOSP does not include the GApps. I guess this is expected in some respect. Does anyone know how to put the Gapps in the androidX86 src so when I build an .iso image I can have the google apps preinstalled or alternatively just install the GApps . Thank you.
You can follow this modop : https://github.com/opengapps/aosp_build
I just notice you, the path of the manifest is in .repo/manifests/android-x86-X.X-rx.xml or the default.xml file if you dont used special manifest to DL (like -m android-x86-8.1-r1.xml at the end of the repo init commmand)
And you don't have to put these 2 lines :
<project path="vendor/opengapps/sources/arm" name="arm" clone-depth="1" revision="master" remote="nezor" />
<project path="vendor/opengapps/sources/arm64" name="arm64" clone-depth="1" revision="master" remote="nezor" />
You depend of x86 not arm and it can make you issue if you put them.
after add it, do your repo sync commands.
and the makefile to change is in device/generic/x86_64/android_x86_64.mk, add package of opengapps you want. (comparaison here : https://github.com/opengapps/opengapps/wiki/Package-Comparison)
I Hope this is usefull.
Regards, Bastien
I have created a qt installer and I am trying to set some icons on it,
Working on linux with the InstallerApplicationIcon I have managed the application logo to be displayed on each of Installer's page but building the same installer on Windows the Icon does not appear. I have tried several solutions with .ico or .bmp files but I have not managed to make it work
I found that in Windows 'InstallerApplicationIcon' without filename extension, but 'InstallerWindowIcon' needs it.
I have tried it on windows and it worked for me.
Inside my config directory I have two files Coffee.ico and document.png. The Coffee.ico is shown in the explorer for the installer icon, whereas the document.png is shown on every installer page on the top.
My config.xml basically looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Your application</Name>
<Version>1.0.0</Version>
<Title>Your application Installer</Title>
<InstallerApplicationIcon>Coffee</InstallerApplicationIcon>
<InstallerWindowIcon>Document.png</InstallerWindowIcon>
</Installer>
Here is what I'll see:
I was created one nuget package using following step.
First I created one Asp.net Mvc application
The I created spec file using nuget spec command
Then I edited $id$,$version$,$author$,$description$ ect..
Then I created package using following command.
nuget pack myproject.csproj -Build -Properties Configuration=Release
It was created one myproject.1.0.0.0.nupkg
Then I copy the file And past into C:\LocalNuGetFeed\myproject.1.0.0.0.nupkg
I already configure the local repository in my VS
My problem is
When I install this package from any other project it ask following question.
But as per my requirement I don't want to move this file to target project. Suppose user give y the it overwrite the target project file because of it i face lot reference problem.
**File Conflict
File 'Web.config' already exists in project 'CRM'. Do you want to overwrite it?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "N"):
File Conflict
File 'Global.asax' already exists in project 'CRM'. Do you want to overwrite it?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "N"):**
But in my package I don't want to move this above two file from package to target project.
Is any way to avoid transform Global.asax and Web.config move from package to target project.
In my .nuspec file I added following line
<files>
<file src="Web.config" target = "" exclude="Web.config"/>
<file src="*.asax" target = "" exclude="*.asax"/>
<file src="Content\*.css" target="Content\" />
<file src="Scripts\*.js" target="Content\Scripts\" />
</files>
But it include the web.config file AND Global.aspx file in Content folder My resultant package look like bellow
myproject.1.0.0.0
>> Content
....css
>>Script
..Js file
web.config
Global.asax
I was solved this using following command to crate package
nuget pack CrmHtmlController.csproj -IncludeReferencedProjects -Exclude **\*.config;**\*.asax
so it exclude all .congig and .asax file from package.
Take a look at your .nuspec file. It's just an XML file, so you can open it up with any text editor. See how it define which files to include at <package><files>? Remove those files that you don't want. A handy tool if you want to do this with a GUI is NuGet Package Manager.
Nuget includes the web.config in your package, because the build action of the web.config is "Content". This is by default and necessary for a classic publish of an asp.net web site.
If you don't want this, propably because your assembly is only a component of another web site, you can change the build action to "None" and nuget will not take it any longer.
Is there a way I can run the Qt application as an administrator? I have an auto-updater for my application. It needs administrator privileges to replace the files in Program Files folder and hence it requires administrator privileges.
Running your application with administrator privileges does not have a whole lot to do with Qt. There are two approaches.
The "simple" one is to manually set your application to run with administrator privileges. You can do so by right-clicking on the executable. Then on the "Compatibilty" tab, you can choose to "Run this application as an administrator" under "Privilege level".
However, if you automatically want to achieve the same, you will have to embed a manifest into your application. What you're looking for is to set the requestedExecutionLevel to requireAdministrator. A bit more information can be found on MSDN or in this Wikipedia entry on UAC.
For your application as built in Qt Creator, it means you will need to embed the manifest by including a reference to it in a Resource (.rc) file. This resource file can then be added to your .pro file by specifying RC_FILE = myapp.rc. An informative blog post on this very issue is this one, as well as this post on the QtCentre forum.
A very simple solution for this, if you're using MSVC toolkit, is to add the following into the project file:
QMAKE_LFLAGS_WINDOWS += "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\""
I am using Qt 5.12 msvc2017.
I've found this to be quite neat, as from what I see in generated Makefile, Qt is already adding some manifest related link flags, and this approach wouldn't interfere with already embedding manifest, as manually adding manifest from existing file.
Other manifest link options can be easily added. You can read the docs for VS compiler, and/or you can check what flags/options Visual Studio IDE has to offer in Project properties/Linker/Manifest File and then check Command Line section of the Linker to see how it adds them.
Not sure how would this be done in gcc or clang builds, it would probably require solutions provided by #H Aßdøµ, and #Bart.
From the article that referred to Mr #Bart:
Application Manifest
First, we have to prepare an application manifest file. This one below is for application that does not require administrator rights:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="2.0.2.0" processorArchitecture="X86" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Second, we need the MT.exe tool from the Microsoft Windows SDK to embed this XML in our executable. To do it use the following command:
mt.exe –manifest MyApp.exe.manifest -outputresource:MyApp.exe;1
Automatic Manifest Embedding
Manually executing the mt command after each compilation is a tedious task. What about convincing qmake to do it for us? After studying the docs it looks like the following line should do the trick:
win32 {
WINSDK_DIR = C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A
WIN_PWD = $$replace(PWD, /, \\)
OUT_PWD_WIN = $$replace(OUT_PWD, /, \\)
QMAKE_POST_LINK = "$$WINSDK_DIR/bin/x64/mt.exe -manifest $$quote($$WIN_PWD\\$$basename(TARGET).manifest) -outputresource:$$quote($$OUT_PWD_WIN\\${DESTDIR_TARGET};1)"
}
The above code will automatically execute the mt.exe program from WINSDK_DIR and embed a manifest file that is located in the project root directory and named after project's target (ie. MyApp.manifest). That's all to adding a manifest, now let's move on and specify the version information.
Orginal post: http://blog.strixcode.com/2010/08/embedding-application-manifest-and.html