- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我在为 MacOSX 构建的独立包中添加 DMG 背景的自定义图标时遇到问题。我在项目的根目录中添加了一个包。正在从中加载自定义图标,但没有加载 DMG 背景图标。我正在使用 Java fx 2.2.3 和 jdk1.7.0_09。这是为相同生成的详细输出。
Detected JavaFX Ant API version 1.2 Launching <fx:jar> task from
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar
Launching <fx:deploy> task from
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/lib/ant-javafx.jar
Copying 102 files to
/Users/apple/NetBeansProjects/JavaFXApplication2/dist Using base JDK
at: /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk Using default
package resource [Bundle config file] (add package/macosx/Info.plist
to the class path to customize) Using custom package resource [icon]
(loaded from file
/Users/apple/NetBeansProjects/JavaFXApplication2/package/macosx/javaFXApplication2.icns)
Creating app bundle:
/Users/apple/NetBeansProjects/JavaFXApplication2/dist/bundles/JavaFXApplication2.app
Config files are saved to
/var/folders/vd/nyxf14z53tx56g2_lbqcnfrr0000gn/T/build1722966263281326253.fxbundler/macosx.
Use them to customize package. Building DMG package for
JavaFXApplication2 Using default package resource [Bundle config
file] (add package/macosx/Info.plist to the class path to customize)
Using custom package resource [icon] (loaded from file
/Users/apple/NetBeansProjects/JavaFXApplication2/package/macosx/javaFXApplication2.icns)
Config files are saved to
/var/folders/vd/nyxf14z53tx56g2_lbqcnfrr0000gn/T/build1722966263281326253.fxbundler/macosx.
Use them to customize package. Using default package resource [dmg
background] (add package/macosx/JavaFXApplication2-background.png to
the class path to customize) Using custom package resource [volume
icon] (loaded from file
/Users/apple/NetBeansProjects/JavaFXApplication2/package/macosx/javaFXApplication2.icns)
Using default package resource [script to run after application
image is populated] (add
package/macosx/JavaFXApplication2-post-image.sh to the class path to
customize) Using default package resource [DMG setup script] (add
package/macosx/JavaFXApplication2-dmg-setup.scpt to the class path
to customize) Result DMG installer for JavaFXApplication2:
/Users/apple/NetBeansProjects/JavaFXApplication2/dist/bundles/JavaFXApplication2.dmg
Config files are saved to
/var/folders/vd/nyxf14z53tx56g2_lbqcnfrr0000gn/T/build1722966263281326253.fxbundler/macosx.
Use them to customize package.
这是列出我所有图标文件的目录:-
Apples-MacBook-Pro-2:~ apple$ ls -l /Users/apple/NetBeansProjects/JavaFXApplication2/package/macosx/
total 136
-rw-r--r--@ 1 apple staff 1251 Nov 1 19:02 Info.plist
-rw-r--r-- 1 apple staff 18017 Nov 1 18:22 JavaFXApplication2-background.png
-rw-r--r--@ 1 apple staff 902 Nov 2 13:55 JavaFXApplication2-dmg-setup.scpt
-rw-r--r-- 1 apple staff 38115 Jan 19 2006 JavaFXApplication2.icns
如您所见,图标是从包中加载的,但 DMG 背景文件不是,即使我也在同一目录中添加了该文件。
最佳答案
OS X 中文件夹的背景由 Finder 在 .DS_Store 文件中设置。如果您注意不要更改背景文件的文件夹路径和名称,则可以使用 Finder 设置背景图像,然后复制 .DS_Store 文件并在构建过程中将其复制过来。如果你想要更好的东西,我们使用这个 Perl 脚本来设置文件夹的背景(它依赖于其他一些 Perl 库,你应该可以找到它们)。
#!/usr/bin/perl
use Mac::Finder::DSStore::BuddyAllocator;
use Mac::Finder::DSStore;
use IO::File;
use Data::Dumper;
use Config;
use Mac::Files;
use Mac::Memory;
use Mac::Finder::DSStore qw( writeDSDBEntries makeEntries );
use Sys::Filesystem::ID;
use File::Basename;
die "Usage: $0 <Folder path> <bg path relative to folder>\n"
unless @ARGV == 2;
$folderPath=$ARGV[0];
while ($folderPath =~ /\/$/)
{
chop($folderPath);
}
die "$folderPath is not a directory" unless -d $folderPath;
$bgPath=$folderPath."/".$ARGV[1];
die "$bgPath is not a file" unless -f $bgPath;
# When we're setting the background for the root, the info lives
# in the .DS_Store file in the directory, otherwise it lives in
# the parent directory
if (Sys::Filesystem::ID::_arg_to_mount_point($folderPath) eq $folderPath)
{
$dsStoreFile=$folderPath."/.DS_Store";
$ourName=".";
}
else
{
$dsStoreFile=$folderPath."/../.DS_Store";
($ourName, $path, $suffix) = fileparse($folderPath);
}
#print "Setting bg for $folderPath to $bgPath, .DS_Store file = $dsStoreFile ourName=$ourName\n";
#We use byFilename to keep track of the records for everybody
# we will pull out the records for . and remove any BKGD records
@otherRecs=();
@ourRecs=();
if (-f $dsStoreFile)
{
$store = Mac::Finder::DSStore::BuddyAllocator->open(new IO::File $dsStoreFile, '<');
@records=&Mac::Finder::DSStore::getDSDBEntries($store);
foreach my $curRec (@records)
{
if ($curRec->filename ne $ourName)
{
push(@otherRecs, $curRec);
}
else
{
push(@oldRecs, $curRec);
}
}
if ( @oldRecs != 0)
{
foreach $curRec(@oldRecs)
{
if ($curRec->strucId ne "BKGD" && $curRec->strucId ne "pict" && $curRec->strucId ne "bwsp" && $curRec->strucId ne "icvp")
{
push(@ourRecs, $curRec);
}
}
}
}
undef $store;
if ($ourRec == 0)
{
push(@ourRecs, &makeEntries($ourName, ICVO => 1,
icvo => pack('A4 n A4 A4 n*', "icv4", 48, "none", "botm", 0, 0, 0, 0, 0, 1, 0, 100, 1)));
}
@bgRecs=&makeEntries($ourName, BKGD_alias => NewAliasMinimal($bgPath));
@ourRecs=(@ourRecs,@bgRecs);
&writeDSDBEntries($dsStoreFile, @ourRecs, @otherRecs);
关于java - 用于 DMG 背景的自定义插入式图标,用于 MacOSX 上的应用程序打包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13208070/
我正在使用 C++11 线程构建一个应用程序,但我似乎无法让它在 MacOSX 10.9 上与 clang++ 一起工作。这是我能找到的导致问题的最简单示例: #include #include
我无法弄清楚为什么我的二进制文件无法加载。它是由MATLAB加载的dylib(MEX文件),并链接到位于不同位置的许多dylib。 MATLAB告诉我它无法加载MEX文件,但是我无法弄清它找不到哪个依
我正在尝试让我的程序自动关联要由它打开的某些文件扩展名,但我不确定如何在 MacOSX 中执行此操作。我不是在问如何将程序与 GUI 中的文件扩展名相关联,我希望能够将它编程到我的程序中。 最佳答案
我的应用程序通过我的 mac 上的 nginx 在本地主机端口 80 上运行了很长一段时间。最近我做了一些软件更新,并试图在不同的端口上运行其他应用程序,现在我无法在 localhost:80 上运行
我想用默认的邮件客户端创建一个新邮件并自动附加一个文件。 创建新邮件到 dummy@somewhere.com与主题 foo和 body bar ,我可以执行以下操作: open "mailto:du
我正在使用 MacOS Mojave 版本 10.14.16,我正在尝试安装 http://www.rpl2.net/index.php (一种使用反向波兰表示法的编程语言,可在某些 HP 计算器(如
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我正在尝试为 OS X 构建一个基本的动态库,它只显示一个用于打开文件的对话框。我的代码看起来像这样: NSOpenPanel * dlg = [NSOpenPanel openPanel]; ...
通过应用程序 Utilities/Console.app,我可以看到应用程序的控制台输出。 有没有办法从另一个应用程序访问此日志? 更具体地说:我正在为我的应用程序编写一个崩溃处理程序,我希望它将控制
我最近使用页面 https://github.com/ingenuitas/simplecv 中的 osX-Lion 设置说明安装了 SimpleCV 然后我在终端中输入 python,当我尝试以下操
问题 MacOSX 附带的字典存储在 /Library/Dictionaries 中。我想解析它们以编程方式获取字典结果(通过终端、AppleScript 或 Automator)。这些词典是 Mac
我正在尝试创建一个静态库并将其链接到 MacOS X(几个版本)上: 文件 foo.c : char foo[111]; 文件 bar.c : #include extern char foo[];
我有一个名为 youtube-dl 的命令..但不知道它安装在哪里..我可以从 shell 运行它..我如何找到它的安装位置? youtube-dl 什么也没说.. 最佳答案 Bash 有一个命令可以
我有 macosx,我为 mail.app 创建了一个 html 签名,但是当我发送电子邮件时,有人使用 Windows 属性 font-family 选择它时不起作用。 当我从 MAC 发送到 MA
几个 clGet*Info OpenCL 函数允许 (a) 获取所需信息的大小,或 (b) 信息本身。这在某些情况下是必需的,例如获取设备的名称: char* name; size_t size_of
我在使用 python3 在我的 macosx10.7 上设置 pycharm ide 时遇到了问题。 我已经搜索了所有可用的资源并尝试了数百种方法,此时我必须承认自己的无能并通过此 channel
Environment.OSVersion.Platform 返回一个 PlatformID ( Info: MSDN PlatformID )。 此 PlatformID 的值也可以是“Unix”或
我正在尝试在 Maverick 10.9 的命令行上编译一个项目。该项目在 Linux 上完美编译。显然,MacOSX 上的 ctime 似乎存在问题。错误是 $ make Compiling src
在 Netbeans 使用的 Java 桌面应用程序模板中,菜单栏是使用 JMenuBar 和 JMenuItems 创建的。 我怎样才能让那个栏显示在顶部,菜单栏在 MacOSX 中显示,而不是像在
我正在制作一个自定义窗口(带有 NSBorderlessWindowMask 的 NSWindow)到目前为止,我已经能够处理拖动、调整大小、cmd+单击,甚至在允许的情况下通过双击进行小型化(请参阅
我是一名优秀的程序员,十分优秀!