You are here

How can I create a x86/x64 hybrid app with different registry entries?

8 posts / 0 new
Last post
GermanChatplosion
Offline
Last seen: 6 years 2 months ago
Joined: 2018-01-17 02:57
How can I create a x86/x64 hybrid app with different registry entries?

Hello community,

a young unemployed german autistic computer sciene expert for systemintegration (only very low basic programming experience) wants to try something new.
I am trying to create a portable app of a CAD software. The software is avialable in x86 and x64.
It uses phython 2.7 32 bit and 64 bit, Trolltech libraries (Qt*.dll) in 32 bit and 64 bit and OpenSCAD in 32 bit and 64 bit.
The complete package can be 1.02gb~1.2gb (based on your filesystem blocksize).
And it is based on the latest portableapp template.
Also the registry entries are different from the 32 bit and 64 bit software.
Unfotunately there are absolute paths needed in the registry and the 32 bit & 64 bit are very different in the registry values.
But fortunately the app autodetects the language and accepts relative paths for the ccx.exe and OpenSCAD.exe inside the user.cfg file.

Splitting the app into a 32 bit and a 64 bit is not what I want.

GermanChatplosion
Offline
Last seen: 6 years 2 months ago
Joined: 2018-01-17 02:57
The application is named

The application is named FreeCAD.

I don't know how to quote my .ini files and other text i wrote in the process.
Please help the freshman.

My Appinfo.ini:

;This is an example appinfo.ini that is part of the PortableApps.com Template
;It uses a standard Windows INI format, so any line starting with a semi-colon is treated as a comment
;It is recommended that you use a coding text editor to edit this
;If editing with Notepad++, be sure you have turned off the option to add a BOM as it will break the INI
;Full details on this file: http://portableapps.com/development/portableapps.com_format#appinfo

[Format]
;This section is used by the PortableApps.com Installer and does not normally need to be edited
Type=PortableAppsFormat
Version=3.4

[Details]
;The app details that will be shown to the user and used by the PortableApps.com Platform
;Name is the name of the app. Generally the normal name of the app with " Portable" added to the end
Name=FreeCAD Portable
;AppId is a unique id used by the Platform's updater and app store as well as the Installer
AppId=FreeCADPortable
;Publisher includes the name of the original publisher and the organization packaging if different
Publisher=FreeCAD Team & PortableApps.com
;Homepage is the URL of the portable app's homepage which may differ from the app's main homepage
Homepage=freecadweb.org
;Donate is the URL for donations to contribute money to help with development
;Donate=AppName.com/donations
;Category is the type of app. It is used by the Platform for organization. Valid entries are: Accessibility, Development, Education, Games, Graphics & Pictures, Internet, Music & Video, Office, Security or Utilities. Only these exact entries are accepted
Category=Utilities
;Description is a short description of the app. The app name should be omitted. Examples include: "Web browser", "Email client", etc
Description="FreeCAD" is a parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history and changing its parameters. FreeCAD is open-source and highly customizable, scriptable and extensible.
;Language indicates how the installer will be built. If a single language, the installer will be built in that language. If Multilingual, a standard installer with all languages will be built. Generally, only Multilingual or English apps are released by PortableApps.com. A full list of languages is available
Language=Multilingual

[License]
;This section includes licensing details on the bundled app.
;Shareable indicates whether an app may be shared from one user to another. Generally true except for commercial apps
Shareable=true
;OpenSource indicates whether an app is open source under an OSI license
OpenSource=true
;Freeware indicates whether an app is freeware and may be used with no charge to the user
Freeware=true
;CommercialUse indicates whether this app may legally be used in a business setting. Some freeware prohibits this
CommercialUse=true
;EULAVersion is the version of the license that comes with the app that the user must agree to before use. This is included as a file EULA.txt within the AppInfo directory. An EULA should *only* be used if the user is required to agree to it before installing. Each time a major change is made to the EULA (not just a formatting change) the version should be increased. Note that open source licenses (GPL, MIT, etc) do not need to be agreed to by the user and should not be included as an EULA.txt.
;EULAVersion=1

[Dependencies]
;This section indicates to the launcher and platform what this app needs to function
;See details at: http://portableapps.com/development/portableapps.com_format#appinfo
;UsesGhostscript=optional
;UsesJava=no
;UsesDotNetVersion=

[Version]
;PackageVersion is used by the installer and the updater. It must be in dotted quad X.X.X.X format for use by Windows. You must ensure that each successive version has a higher package version than the previous or it will not be treated as a newer version by the platform's updater. Generally, the PackageVersion is based on the DisplayVersion. So an app with version 3.4 will have a package version of 3.4.0.0.
PackageVersion=0.16.6706.0
;DisplayVersion is displayed to the user and used in naming the installer
DisplayVersion=0.16
;Some example Display and Package versions
;3.4 would be 3.4.0.0
;4.5a would be 4.5.1.0
;1.2 Dev Test 1 would be 1.1.99.1 Why? So we can have room to grow and still use 1.2.0.0 as the official stable release. Dev tests with 3 and 4 digit numbers can be indicated similarly. 4.5.1 Dev Test 1 would be 4.4.1.991 and 4.5.1.1 Dev Test 1 would be 4.5.0.991.

[Control]
;This indicates to the platform how many icons a given app should have and how the app should be started. All official apps should generally have a single icon. The only exception is for office suites that include multiple big apps. See LibreOffice Portable for an example.
Icons=1
;Start is the EXE that should be run to start the app
Start=FreeCADPortable.exe

;[Associations]
;This section indicates to the platform which extensions the app can handle and how to start the app
;See details at: http://portableapps.com/development/portableapps.com_format#appinfo
;FileTypes=html,htm,xhtml,xhtm,xht,shtml
;FileTypeCommandLine=/Open=%1
;FileTypeCommandLine-extension=/OpenExtension=%1
;Protocols=http,https,gtp,gopher
;ProtocolCommandLine=--protocolhandler=%1
;ProtocolCommandLine-protocol=--http:%1
;SendTo=true
;SendToCommandLine=-multiplefiles "%1"
;Shell=true
;ShellCommand=/idlist,%I,%L

;[FileTypeIcons]
;This section indicates which icons to associate with the file types listed in Associations
;See details at: http://portableapps.com/development/portableapps.com_format#appinfo
;swf=video
;ttp=custom
;qwe=app

GermanChatplosion
Offline
Last seen: 6 years 2 months ago
Joined: 2018-01-17 02:57
Because until now I didnt get

Because until now I didnt get any idea from nobody, I feel forced to split the app into a 32 bit ad a 64 bit.

So I want to try the 32 bit app first.

Problems to solve:

1. Paths in the Trolltech.reg
2. Paths in the user.cfg, because it uses sometimes "/" instead of "\", also the not supportet %APPDATA% and %TEMP% variables are not supportet.

Here is the Trolltech.reg (32 bit):

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Trolltech]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:\C:\]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:\C:\Program Files (x86)]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:\C:\Program Files (x86)\FreeCAD]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:\C:\Program Files (x86)\FreeCAD\bin]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QIconEngineFactoryInterfaceV2:\C:\Program Files (x86)\FreeCAD\bin\iconengines]
"qsvgicon4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,\
38,00,73,76,67,00,73,76,67,7A,00,73,76,67,2E,67,7A,00,00

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:\C:\]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:\C:\Program Files (x86)]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:\C:\Program Files (x86)\FreeCAD]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:\C:\Program Files (x86)\FreeCAD\bin]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Factory Cache 4.8\com.trolltech.Qt.QImageIOHandlerFactoryInterface:\C:\Program Files (x86)\FreeCAD\bin\imageformats]
"qgif4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,\
67,69,66,00,00
"qico4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,\
69,63,6F,00,00
"qjpeg4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,\
00,6A,70,65,67,00,6A,70,67,00,00
"qmng4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,\
6D,6E,67,00,00
"qsvg4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,\
73,76,67,00,73,76,67,7A,00,00
"qtga4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,\
74,67,61,00,00
"qtiff4.dll"=hex(7):32,30,31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,\
00,74,69,66,66,00,74,69,66,00,00

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\Program Files (x86)]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\Program Files (x86)\FreeCAD]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\Program Files (x86)\FreeCAD\bin]

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\Program Files (x86)\FreeCAD\bin\iconengines]
"qsvgicon4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,\
76,63,20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,\
31,34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00

[HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.8.false\C:\Program Files (x86)\FreeCAD\bin\imageformats]
"qgif4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,63,\
20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,34,\
2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qico4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,63,\
20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,34,\
2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qjpeg4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,\
63,20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,\
34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qmng4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,63,\
20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,34,\
2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qsvg4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,63,\
20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,34,\
2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qtga4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,63,\
20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,34,\
2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00
"qtiff4.dll"=hex(7):34,30,38,30,36,00,30,00,57,69,6E,64,6F,77,73,20,6D,73,76,\
63,20,72,65,6C,65,61,73,65,20,66,75,6C,6C,2D,63,6F,6E,66,69,67,00,32,30,31,\
34,2D,31,32,2D,30,34,54,31,38,3A,35,39,3A,31,38,00,00

Here is my user.cfg (32 bit):

<?xml version="1.0" encoding="UTF-8" standalone="no" ??>StartWorkbenchC:/Users/1/AppData/Roaming/FreeCAD/MacroFullScript.FCScript./openscad.exeAP214CD11111111110111Konstruktion0.09,0.050.09,0.05,0.02,0.050.02,0.02./ccx.exec:\users\1\appdata\local\tempIfcProduct30, 10http://localhost:8082TempCamera.incTempPart.inc+P +Ahttp://en.wikipedia.org/wiki/All_rights_reservedCourierGui::CADNavigationStyle0 mm

And here is my FreeCADPortable.ini (32 bit) from the Launcher folder:

;This is an example launcher INI that is part of the PortableApps.com Template
;It uses a standard Windows INI format, so any line starting with a semi-colon is treated as a comment
;It is recommended that you use a coding text editor to edit this, preferably one with context highlighting
;If editing with Notepad++, be sure you have turned off the option to add a BOM as it will break the INI
;Full details: http://portableapps.com/manuals/PortableApps.comLauncher/

[Launch]
;This section details how an app is started and where it works
;ProgramExecutable is the EXE to run to start the app relative to the AppNamePortable\App directory
ProgramExecutable=FreeCAD\bin\FreeCAD.exe
;ProgramExecutable64 is an optional EXE to run if running on Windows 64-bit
;ProgramExecutable64=
;CommandLineArguments is an optional setting that will cause the above EXE to be launched with this string passed
CommandLineArguments=-u "%PAL:DataDir%\user.cfg" -s "%PAL:DataDir%\system.cfg"
;DirectoryMoveOK indicates whether a directory can be moved to a different path rather than just supporting drive letter changes
DirectoryMoveOK=yes
;SupportsUNC indicates whether an app can run from a Windows UNC path, often referred to as a network path
SupportsUNC=no
;RunAsAdmin indicates whether an app requires admin rights to run. This should generally be avoided when possible
;Details: http://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.in...
;RunAsAdmin=try

[Activate]
;This section lets the launcher know what functionality needs to be included.
;IMPORTANT: Any changes to this section will require the launcher to be recompiled.
;Registry indicates whether we will be reading or writing to the registry. If not, setting to false will make the launcher slightly smaller and cause it to start slightly faster.
Registry=true
;Java indicates whether the app needs Java to run
;Java=find
;XML indicates whether the launcher will need to read or write to XML paths within settings files of the app. If not, setting to false will make the launcher slightly smaller and cause it to start slightly faster.
XML=true

[Environment]
;This section lets the launcher know what environment variables need to be set. If not needed, this can be removed.
;AppNameExamplePath=%PAL:AppDir%\App\AppName

[RegistryKeys]
;This section allows you to backup and restore a given key and the keys below it within the registry. Any existing data in the same location will be backed up before the app is run and restored on exit. The portable app's data will be stored in a .reg key with the name at the beginning of each line within the Data directory. It's best to take as little of the registry as possible. In our example, taking the whole ExamplePublisher section isn't necessary because all our app's data is stored within AppName. If we took ExamplePublisher, we might run into problems with other apps from the same publisher.
FreeCAD=HKCU\Software\FreeCAD
Trolltech=HKCU\Software\Trolltech
;If there is some data in the registry that the app creates but does not need to be saved between sessions of the portable app, it can be handled using a - instead of a name for a .reg file as follows:
;-=HKCU\Software\ExamplePublisher\GarbageData

[RegistryCleanupIfEmpty]
;This section allows you to remove sections of the registry if they are empty when the app exits. In this example, we're removing the app publisher's section if no local apps from the same publisher exit after our portable app exits so we don't leave behind an empty bit of registry.
1=HKCU\Software\FreeCAD
2=HKCU\Software\Trolltech

;ENVIRONMENT VARIABLES FOR USE WITH DIRECTORIES AND FILES
;These next sections deal with directory and file handling. For these, environment variable substitutions will apply
;Environment variables: http://portableapps.com/manuals/PortableApps.comLauncher/ref/envsub.html...

[DirectoriesMove]
;This section allows you to configure directories that need to be moved from the Data directory to either the app's directory or to the local machine. Many standard environment variables are supported here including things like APPDATA.

;This first entry will move the contents of AppNamePortable\Data\AppNameConfig to C:\Users\[user]\AppData\Roaming\ExamplePublisher\AppName while the app is running and back when complete. Any existing data will be backed up and restored.
FreeCADConfig=%APPDATA%\FreeCAD

;This second entry will move the contents of AppNamePortable\Data\AppNamePortableConfig to AppNamePortable\App\AppName while the app is running and back when complete.
;AppNamePortableConfig=%PAL:AppDir%\AppName\Config

;This entry indicates that the contents of C:\Users\[user]\AppData\Roaming\ExamplePublisher\GarbageData should be disposed of when the app is done running. Any existing data will be backed up and restored when complete.
-=%APPDATA%\FreeCAD

[FilesMove]
;This section allows you to configure directories that need to be moved from the Data directory to either the app's directory or to the local machine. Many standard environment variables are supported here including things like APPDATA.

;This first entry will move the file AppNamePortable\Data\appnameexample.config to C:\Users\[user]\AppData\Roaming\ExamplePublisher while the app is running and back when complete. Any existing data will be backed up and restored.
appnameexample.config=%APPDATA%\ExamplePublisher

;This second entry will move the file of AppNamePortable\Data\appnameportableexample.config to AppNamePortable\App\AppName while the app is running and back when complete.
appnameportableexample.config=%PAL:AppDir%\AppName

[DirectoriesCleanupIfEmpty]
;This section allows you to remove directories if they are empty when the app exits. In this example, we are removing the ExamplePublisher directory if it is empty so we don't leave a blank directory behind from the app.
1=%APPDATA%\ExamplePublisher

;FILEWRITE
;These entries allow you to update the paths within configuration and registry files
;The entries use the standard environment variables along with some additional modifiers
;Environment variables: http://portableapps.com/manuals/PortableApps.comLauncher/ref/envsub.html...

;For these examples, we'll update the relative paths in both a standard config file and a .reg file

;FileWrite1 to 3 will update the drive letter, relative path, and full path in a config file
;Note the order from most specific path to least, ensuring we don't change a drive letter alone before a full path
[FileWrite1]
Type=Replace
File=%PAL:DataDir%\FreeCADConfig\user.cfg
Find=Macro
Replace=%TEMP%\FreeCAD\Macro;%PAL:Drive%%PAL:PackagePartialDir%\

[FileWrite2]
Type=Replace
File=%PAL:DataDir%\FreeCADConfig\user.cfg
Find=TEMP
Replace=%TEMP%\FreeCAD;%PAL:Drive%%PAL:PortableAppsBaseDir%\

;[FileWrite3]
;Type=Replace
;File=%PAL:DataDir%\settings\appnameportableexample.config
;Find=%PAL:LastDrive%\
;Replace=%PAL:Drive%\

;FileWrite4 to 6 will update the drive letter, relative path, and full path in a registry file
;Note that we use double backslashes for the paths instead of singles because that is the way a .reg file stores them

[FileWrite4]
Type=Replace
File=%PAL:DataDir%\Trolltech.reg
Find=%PAL:LastDrive%%PAL:LastPackagePartialDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PackagePartialDir:DoubleBackslash%\\

[FileWrite5]
Type=Replace
File=%PAL:DataDir%\Trolltech.reg
Find=%PAL:LastDrive%%PAL:LastPortableAppsBaseDir:DoubleBackslash%\\
Replace=%PAL:Drive%%PAL:PortableAppsBaseDir:DoubleBackslash%\\

[FileWrite6]
Type=Replace
File=%PAL:DataDir%\Trolltech.reg
Find=%PAL:LastDrive%\\
Replace=%PAL:Drive%\\

;FileWrite 7 is an example of writing a value directly to a file, to specify a path to plugins for example

;[FileWrite7]
;Type=INI
;File=%PAL:DataDir%\settings\appnameportableexample.config
;Section=Paths
;Key=PluginsPath
;Value=%PAL:AppDir%\AppName\plugins

;Language switching is a bit beyond an example package such as this. The PortableApps.com Launcher does support automatic language switching with the platform but it is not required for portable apps.
;Details: http://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.in...

;[Language]
;Base=%PortableApps.comLanguageCode%
;CheckIfExists=%PAL:AppDir%\Languages\%PAL:LanguageCustom%.locale
;DefaultIfNotExists=en

;[LanguageStrings]
;ar-sa=ar

;[LanguageFile]
;Type=INI
;File=%PAL:DataDir%\settings\appnameportableexample.config
;Section=Language
;Key=Language

;Lastly, we'd need to save our changes to the language setting back to the configuration file

;[FileWrite8]
;Type=INI
;File=%PAL:DataDir%\settings\appnameportableexample.config
;Section=Language
;Key=Language
;Value=%PAL:LanguageCustom%

So far, nothing is working yet.

This is really frustrating and kills my nerves.

How do I need to modify the filewrite commands to get the folders in the reg files and in the user.cfg correctly modified?

And how does the temporarely insert to the registry work?

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 4 hours 34 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
I don't have the time to sift

I don't have the time to sift through the entire thing, but have you seen the [QtKeysCleanup] documentation in the manual? It looks like it would be of use to you and might give you a step in the right direction.

One problem I did notice you have - FileWrites must be consecutive numbers - commenting out 3 will break any that come after it.

GermanChatplosion
Offline
Last seen: 6 years 2 months ago
Joined: 2018-01-17 02:57
I corrected the numbers of

I corrected the numbers of filewrite.
But I Need to replace the "MacroPath" and the "WorkingDir" in a XML file called user.cfg.
It ist not C:\ it is C:/. And there is the problem.
Two fliewrite actions are needed to Change C:/Users/1/AppData/Roaming/FreeCAD/Macro and c:\users\1\appdata\local\temp to %APPDATA%/FreeCAD/Macro and %TEMP% in absolute paths.
So how shall I modify my filewrite?

[update 23.01.2018]
I was able to construct a enviroment variable for Windows Vista/7/8/8.1/10

MacroPathVista=%SystemDrive%/Users/%USERNAME%/AppData/Roaming/FreeCAD/Macro

But how must I create it for XP?

[update 24.01.2018]

I got my filewrite 1 &2 correct.

[FileWrite1]
Type=XML text
File=%PAL:DataDir%\FreeCADConfig\user.cfg
XPath=/FCParameters/FCParamGroup[@Name="Root"]/FCParamGroup[@Name="BaseApp"]/FCParamGroup[1]/FCParamGroup[3]//FCText[1]/text()
Value=%MacroPathVista%

[FileWrite2]
Type=XML text
File=%PAL:DataDir%\FreeCADConfig\user.cfg
XPath=/FCParameters/FCParamGroup[@Name="Root"]/FCParamGroup[@Name="BaseApp"]/FCParamGroup[1]/FCParamGroup[4]/FCParamGroup[4]//FCText[2]/text()
Value=%TEMP%

But how shall I manipulate the .reg files?

rdd
rdd's picture
Offline
Last seen: 4 days 7 hours ago
Translator
Joined: 2013-03-22 06:59
Table of Contents

It ist not C:\ it is C:/. And there is the problem.

You need ForwardSlash for C:/. Check here https://portableapps.com/manuals/PortableApps.comLauncher/ref/envsub.htm...

But how shall I manipulate the .reg files?

Check this https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.i...

GermanChatplosion
Offline
Last seen: 6 years 2 months ago
Joined: 2018-01-17 02:57
I did some extra hours and

I did some extra hours and after a long headache I created for the first time something that seems to be working.
I can't post the paf-installer here. So if anyone wants to check it, please mail me.
Or try it on this hyperlink http://www.filehosting.at/file/details/721504/FreeCADPortable_0.16.paf.exe

It seems that possibly one oremore XPath expressions are incorrect.

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 6 days ago
DeveloperModerator
Joined: 2008-07-24 18:46
Post test

Please feel free to post in the Beta testing forum, using the Development Test template.

Log in or register to post comments